diff --git a/.travis.yml b/.travis.yml index ff4ab4bc9..1ff0ad2c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,8 @@ matrix: - g++-7 env: _="Build" script: - - ./build_tools.sh g++-7 + - make -j2 tools CXX=g++-7 - make -j2 compare + - make -j2 modern after_success: - .travis/calcrom/webhook.sh pokeemerald diff --git a/INSTALL.md b/INSTALL.md index fcdd8b655..a76175862 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -13,12 +13,6 @@ Then get the compiler from https://github.com/pret/agbcc and run the following c ./install.sh PATH_OF_POKEEMERALD_DIRECTORY ``` -Then in the pokeemerald directory, build the tools. - -``` -./build_tools.sh -``` - Finally, build the rom. ``` @@ -101,3 +95,22 @@ If you've only changed `.c` or `.s` files, you can turn off the dependency scann `make NODEP=1` +# Building with devkitARM's C compiler + +This project supports the `arm-none-eabi-gcc` compiler which ships with devkitARM r52. To build this target, simply run: + + make modern + +# Building with your own toolchain + +To build Pokemon Emerald with a toolchain other than devkitARM, override the `TOOLCHAIN` environment variable with the path to your toolchain. Example: + + make compare TOOLCHAIN=/usr/local/arm-none-eabi + +The path you pass to the `TOOLCHAIN` variable must contain the subdirectory `bin`. If you compile the `modern` target with this toolchain, the subdirectories `lib`, `include`, and `arm-none-eabi` must also be present. + +# Building with debug info + +To build the ELF file with enhanced debug info, use the `DINFO` variable: + + make compare DINFO=1 diff --git a/Makefile b/Makefile index bf8c498ae..22f9cb452 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,13 @@ -include $(DEVKITARM)/base_tools +TOOLCHAIN := $(DEVKITARM) +ifneq (,$(wildcard $(TOOLCHAIN)/base_tools)) +include $(TOOLCHAIN)/base_tools +else +export PATH := $(TOOLCHAIN)/bin:$(PATH) +PREFIX := arm-none-eabi- +OBJCOPY := $(PREFIX)objcopy +export CC := $(PREFIX)gcc +export AS := $(PREFIX)as +endif export CPP := $(PREFIX)cpp export LD := $(PREFIX)ld @@ -12,12 +21,10 @@ TITLE := POKEMON EMER GAME_CODE := BPEE MAKER_CODE := 01 REVISION := 0 +MODERN ?= 0 SHELL := /bin/bash -o pipefail -ROM := pokeemerald.gba -OBJ_DIR := build/emerald - ELF = $(ROM:.gba=.elf) MAP = $(ROM:.gba=.map) @@ -34,16 +41,32 @@ DATA_ASM_BUILDDIR = $(OBJ_DIR)/$(DATA_ASM_SUBDIR) SONG_BUILDDIR = $(OBJ_DIR)/$(SONG_SUBDIR) MID_BUILDDIR = $(OBJ_DIR)/$(MID_SUBDIR) -ASFLAGS := -mcpu=arm7tdmi +ASFLAGS := -mcpu=arm7tdmi --defsym MODERN=$(MODERN) +GCC_VER = $(shell $(CC) -dumpversion) + +ifeq ($(MODERN),0) CC1 := tools/agbcc/bin/agbcc$(EXE) override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Werror -O2 -fhex-asm +ROM := pokeemerald.gba +OBJ_DIR := build/emerald +LIBPATH := -L ../../tools/agbcc/lib +else +CC1 = $(shell $(CC) --print-prog-name=cc1) -quiet +override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -fno-aggressive-loop-optimizations -Wno-pointer-to-int-cast +ROM := pokeemerald_modern.gba +OBJ_DIR := build/modern +LIBPATH := -L $(TOOLCHAIN)/lib/gcc/arm-none-eabi/$(GCC_VER)/thumb -L $(TOOLCHAIN)/arm-none-eabi/lib/thumb +endif -CPPFLAGS := -I tools/agbcc/include -I tools/agbcc -iquote include -Wno-trigraphs +CPPFLAGS := -iquote include -Wno-trigraphs -DMODERN=$(MODERN) +ifeq ($(MODERN),0) +CPPFLAGS += -I tools/agbcc/include -I tools/agbcc +endif LDFLAGS = -Map ../../$(MAP) -LIB := -L ../../tools/agbcc/lib -lgcc -lc +LIB := $(LIBPATH) -lgcc -lc SHA1 := $(shell { command -v sha1sum || command -v shasum; } 2>/dev/null) -c GFX := tools/gbagfx/gbagfx$(EXE) @@ -56,6 +79,12 @@ FIX := tools/gbafix/gbafix$(EXE) MAPJSON := tools/mapjson/mapjson$(EXE) JSONPROC := tools/jsonproc/jsonproc$(EXE) +TOOLDIRS := $(filter-out tools/agbcc tools/binutils,$(wildcard tools/*)) +TOOLBASE = $(TOOLDIRS:tools/%=%) +TOOLS = $(foreach tool,$(TOOLBASE),tools/$(tool)/$(tool)$(EXE)) + +MAKEFLAGS += --no-print-directory + # Clear the default suffixes .SUFFIXES: # Don't delete intermediate files @@ -66,7 +95,17 @@ JSONPROC := tools/jsonproc/jsonproc$(EXE) # Secondary expansion is required for dependency variables in object rules. .SECONDEXPANSION: -.PHONY: rom clean compare tidy +.PHONY: all rom clean compare tidy tools mostlyclean clean-tools $(TOOLDIRS) + +infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line)))) + +# Build tools when building the rom +# Disable dependency scanning for clean/tidy/tools +ifeq (,$(filter-out all compare,$(MAKECMDGOALS))) +$(call infoshell, $(MAKE) tools) +else +NODEP := 1 +endif C_SRCS := $(wildcard $(C_SUBDIR)/*.c $(C_SUBDIR)/*/*.c $(C_SUBDIR)/*/*/*.c) C_OBJS := $(patsubst $(C_SUBDIR)/%.c,$(C_BUILDDIR)/%.o,$(C_SRCS)) @@ -92,15 +131,27 @@ AUTO_GEN_TARGETS := $(shell mkdir -p $(SUBDIRS)) +all: rom + +tools: $(TOOLDIRS) + +$(TOOLDIRS): + @$(MAKE) -C $@ + rom: $(ROM) # For contributors to make sure a change didn't affect the contents of the ROM. -compare: $(ROM) +compare: all @$(SHA1) rom.sha1 -clean: tidy +clean: mostlyclean clean-tools + +clean-tools: + @$(foreach tooldir,$(TOOLDIRS),$(MAKE) clean -C $(tooldir);) + +mostlyclean: tidy rm -f sound/direct_sound_samples/*.bin - rm -f $(SONG_OBJS) $(MID_OBJS) $(MID_SUBDIR)/*.s + rm -f $(MID_SUBDIR)/*.s find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' -o -iname '*.latfont' -o -iname '*.hwjpnfont' -o -iname '*.fwjpnfont' \) -exec rm {} + rm -f $(DATA_ASM_SUBDIR)/layouts/layouts.inc $(DATA_ASM_SUBDIR)/layouts/layouts_table.inc rm -f $(DATA_ASM_SUBDIR)/maps/connections.inc $(DATA_ASM_SUBDIR)/maps/events.inc $(DATA_ASM_SUBDIR)/maps/groups.inc $(DATA_ASM_SUBDIR)/maps/headers.inc @@ -109,7 +160,10 @@ clean: tidy tidy: rm -f $(ROM) $(ELF) $(MAP) - rm -r build/* + rm -r $(OBJ_DIR) +ifeq ($(MODERN),0) + @$(MAKE) tidy MODERN=1 +endif include graphics_file_rules.mk include map_data_rules.mk @@ -133,6 +187,7 @@ sound/direct_sound_samples/cry_%.bin: sound/direct_sound_samples/cry_%.aif ; $(A sound/%.bin: sound/%.aif ; $(AIF) $< $@ +ifeq ($(MODERN),0) $(C_BUILDDIR)/libc.o: CC1 := tools/agbcc/bin/old_agbcc $(C_BUILDDIR)/libc.o: CFLAGS := -O2 @@ -145,6 +200,7 @@ $(C_BUILDDIR)/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork $(C_BUILDDIR)/m4a.o: CC1 := tools/agbcc/bin/old_agbcc $(C_BUILDDIR)/record_mixing.o: CFLAGS += -ffreestanding +endif ifeq ($(NODEP),1) $(C_BUILDDIR)/%.o: c_dep := @@ -192,12 +248,23 @@ $(OBJ_DIR)/sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt) $(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt $(RAMSCRGEN) ewram_data $< ENGLISH > $@ -$(OBJ_DIR)/ld_script.ld: ld_script.txt $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld - cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../ld_script.txt > ld_script.ld +ifeq ($(MODERN),0) +LD_SCRIPT := ld_script.txt +LD_SCRIPT_DEPS := $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld +else +LD_SCRIPT := ld_script_modern.txt +LD_SCRIPT_DEPS := +endif + +$(OBJ_DIR)/ld_script.ld: $(LD_SCRIPT) $(LD_SCRIPT_DEPS) + cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../$(LD_SCRIPT) > ld_script.ld $(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) cd $(OBJ_DIR) && $(LD) $(LDFLAGS) -T ld_script.ld -o ../../$@ $(OBJS_REL) $(LIB) + $(FIX) $@ -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent $(ROM): $(ELF) $(OBJCOPY) -O binary $< $@ - $(FIX) $@ -p -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent + $(FIX) $@ -p --silent + +modern: ; @$(MAKE) MODERN=1 diff --git a/asm/dodrio_berry_picking.s b/asm/dodrio_berry_picking.s deleted file mode 100755 index 8203696be..000000000 --- a/asm/dodrio_berry_picking.s +++ /dev/null @@ -1,7859 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_8026988 -sub_8026988: @ 8026988 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x44 - adds r0, 0x48 - ldrb r0, [r0] - mov r8, r0 - ldrb r6, [r1] - cmp r6, r8 - bcs _08026A7A - ldr r0, =gUnknown_082F449C - mov r9, r0 -_080269A8: - ldr r0, =gUnknown_02022C98 - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0x28 - ldrb r1, [r0] - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - ldr r2, =0x000031a0 - adds r0, r2 - adds r7, r3, r0 - movs r0, 0xB - adds r2, r1, 0 - muls r2, r0 - adds r2, r6, r2 - adds r3, 0x24 - ldrb r1, [r3] - subs r1, 0x1 - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 3 - subs r0, r1 - adds r2, r0 - add r2, r9 - ldrb r4, [r2] - adds r0, r7, 0 - adds r0, 0x1F - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _080269FC - adds r0, r6, 0 - movs r1, 0 - bl sub_8028BF8 - b _08026A04 - .pool -_080269FC: - adds r0, r6, 0 - movs r1, 0x1 - bl sub_8028BF8 -_08026A04: - adds r0, r7, 0 - adds r0, 0x1F - adds r5, r0, r4 - ldrb r0, [r5] - cmp r0, 0x9 - bls _08026A30 - adds r0, r7, 0 - adds r0, 0x14 - adds r0, r4 - ldrb r1, [r0] - adds r1, 0x3 - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_8028CA4 - ldrb r1, [r5] - lsls r1, 25 - movs r0, 0xFF - lsls r0, 24 - adds r1, r0 - b _08026A52 -_08026A30: - adds r0, r7, 0 - adds r0, 0x14 - adds r3, r0, r4 - ldrb r0, [r3] - cmp r0, 0x3 - bne _08026A5C - movs r0, 0x7 - strb r0, [r5] - adds r0, r6, 0 - movs r1, 0x6 - bl sub_8028CA4 - ldrb r1, [r5] - lsls r1, 25 - movs r2, 0xFF - lsls r2, 24 - adds r1, r2 -_08026A52: - lsrs r1, 24 - adds r0, r6, 0 - bl sub_8028C7C - b _08026A70 -_08026A5C: - ldrb r1, [r3] - adds r0, r6, 0 - bl sub_8028CA4 - ldrb r1, [r5] - lsls r1, 25 - lsrs r1, 24 - adds r0, r6, 0 - bl sub_8028C7C -_08026A70: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r8 - bcc _080269A8 -_08026A7A: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8026988 - - thumb_func_start sub_8026A88 -sub_8026A88: @ 8026A88 - push {r4-r6,lr} - ldr r1, =gUnknown_02022C98 - ldr r0, [r1] - adds r0, 0x24 - ldrb r5, [r0] - movs r4, 0 - cmp r4, r5 - bcs _08026ABA - adds r6, r1, 0 -_08026A9A: - lsls r0, r4, 4 - subs r0, r4 - lsls r0, 2 - ldr r1, [r6] - adds r0, r1 - ldr r1, =0x000031cc - adds r0, r1 - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_80286B4 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026A9A -_08026ABA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026A88 - - thumb_func_start sub_8026AC8 -sub_8026AC8: @ 8026AC8 - push {r4,r5,lr} - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r5, [r0] - movs r4, 0 - cmp r4, r5 - bcs _08026AEA -_08026AD8: - adds r0, r4, 0 - movs r1, 0x4 - bl sub_80286B4 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026AD8 -_08026AEA: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026AC8 - - thumb_func_start sub_8026AF4 -sub_8026AF4: @ 8026AF4 - push {lr} - bl sub_8026988 - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bls _08026B10 - bl sub_8026AC8 - b _08026B14 - .pool -_08026B10: - bl sub_8026A88 -_08026B14: - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x40 - ldrb r0, [r0] - bl sub_80288D4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026AF4 - - thumb_func_start sub_8026B28 -sub_8026B28: @ 8026B28 - push {lr} - bl sub_8026988 - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x9 - bls _08026B44 - bl sub_8026AC8 - b _08026B48 - .pool -_08026B44: - bl sub_8026A88 -_08026B48: - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x40 - ldrb r0, [r0] - bl sub_80288D4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026B28 - - thumb_func_start sub_8026B5C -sub_8026B5C: @ 8026B5C - push {lr} - adds r3, r1, 0 - lsls r0, 24 - lsrs r0, 24 - subs r0, 0x1 - cmp r0, 0x4 - bhi _08026BB4 - lsls r0, 2 - ldr r1, =_08026B78 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08026B78: - .4byte _08026B8C - .4byte _08026B94 - .4byte _08026B9C - .4byte _08026BA4 - .4byte _08026BAC -_08026B8C: - movs r0, 0x4 - strb r0, [r3] - movs r0, 0x7 - b _08026BB2 -_08026B94: - movs r0, 0x3 - strb r0, [r3] - movs r0, 0x8 - b _08026BB2 -_08026B9C: - movs r0, 0x2 - strb r0, [r3] - movs r0, 0x9 - b _08026BB2 -_08026BA4: - movs r0, 0x1 - strb r0, [r3] - movs r0, 0xA - b _08026BB2 -_08026BAC: - movs r0, 0 - strb r0, [r3] - movs r0, 0xB -_08026BB2: - strb r0, [r2] -_08026BB4: - pop {r0} - bx r0 - thumb_func_end sub_8026B5C - - thumb_func_start sub_8026BB8 -sub_8026BB8: @ 8026BB8 - push {r4-r6,lr} - ldr r1, =gUnknown_02022C98 - ldr r0, [r1] - adds r0, 0x24 - ldrb r5, [r0] - movs r4, 0x1 - cmp r4, r5 - bcs _08026C1E - adds r6, r1, 0 -_08026BCA: - ldr r0, [r6] - movs r1, 0xAC - lsls r1, 1 - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08026BEC - adds r0, r4, 0 - bl sub_8027DFC - ldr r1, [r6] - movs r2, 0xAC - lsls r2, 1 - adds r1, r2 - adds r1, r4 - strb r0, [r1] -_08026BEC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026BCA - cmp r4, r5 - bcs _08026C1E - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - movs r2, 0xAC - lsls r2, 1 - adds r1, r0, r2 -_08026C04: - adds r0, r1, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08026C14 - movs r0, 0 - b _08026C20 - .pool -_08026C14: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026C04 -_08026C1E: - movs r0, 0x1 -_08026C20: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8026BB8 - - thumb_func_start sub_8026C28 -sub_8026C28: @ 8026C28 - push {r4,lr} - movs r1, 0 - ldr r4, =gUnknown_02022C98 - movs r3, 0xAC - lsls r3, 1 - movs r2, 0 -_08026C34: - ldr r0, [r4] - adds r0, r3 - adds r0, r1 - strb r2, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0x4 - bls _08026C34 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026C28 - - thumb_func_start sub_8026C50 -sub_8026C50: @ 8026C50 - push {r4,lr} - ldr r3, =gUnknown_02022C98 - ldr r1, [r3] - adds r2, r1, 0 - adds r2, 0x40 - ldrb r0, [r2] - cmp r0, 0x9 - bls _08026C88 - movs r4, 0x90 - lsls r4, 1 - adds r0, r1, r4 - ldr r0, [r0] - cmp r0, 0 - bne _08026C88 - movs r0, 0xA - strb r0, [r2] - ldr r0, [r3] - movs r1, 0x96 - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _08026C88 - movs r0, 0x1 - b _08026C8A - .pool -_08026C88: - movs r0, 0 -_08026C8A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8026C50 - - thumb_func_start sub_8026C90 -sub_8026C90: @ 8026C90 - push {r4-r6,lr} - ldr r4, =gUnknown_02022C98 - ldr r1, [r4] - adds r2, r1, 0 - adds r2, 0x40 - ldrb r0, [r2] - cmp r0, 0x9 - bls _08026D14 - adds r0, r1, 0 - adds r0, 0x44 - ldrb r3, [r0] - adds r0, 0x4 - ldrb r5, [r0] - movs r0, 0xA - strb r0, [r2] - ldr r4, [r4] - mov r12, r4 - movs r0, 0x96 - lsls r0, 1 - add r0, r12 - ldr r0, [r0] - cmp r0, 0 - beq _08026D14 - adds r4, r3, 0 - cmp r4, r5 - bcs _08026D04 - mov r0, r12 - adds r0, 0x28 - ldrb r3, [r0] - lsls r1, r3, 4 - subs r1, r3 - lsls r1, 2 - ldr r6, =gUnknown_082F449C - subs r0, 0x4 - ldrb r2, [r0] - subs r2, 0x1 - add r1, r12 - movs r0, 0xB - muls r3, r0 - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 3 - subs r2, r0, r2 - ldr r0, =0x000031bf - adds r1, r0 -_08026CEA: - adds r0, r4, r3 - adds r0, r2 - adds r0, r6 - ldrb r0, [r0] - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0xA - bne _08026D14 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08026CEA -_08026D04: - movs r0, 0x1 - b _08026D16 - .pool -_08026D14: - movs r0, 0 -_08026D16: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8026C90 - - thumb_func_start sub_8026D1C -sub_8026D1C: @ 8026D1C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_082F7A9C - mov r8, r0 - ldr r0, =gUnknown_02022C98 - ldr r6, [r0] - adds r0, r6, 0 - adds r0, 0x90 - adds r0, r5 - mov r9, r0 - ldrb r7, [r0] - adds r0, r7, 0 - movs r1, 0x7 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - add r4, r8 - adds r0, r7, 0 - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldrb r4, [r4] - adds r0, r4 - lsls r0, 24 - lsls r5, 1 - adds r6, 0x86 - adds r6, r5 - ldrh r1, [r6] - lsrs r0, 24 - cmp r1, r0 - bcc _08026D76 - adds r0, r7, 0x1 - mov r1, r9 - strb r0, [r1] -_08026D76: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8026D1C - - thumb_func_start sub_8026D8C -sub_8026D8C: @ 8026D8C - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_082F449C+0x1AC - ldr r1, =gUnknown_02022C98 - ldr r1, [r1] - adds r1, 0x24 - ldrb r1, [r1] - subs r1, 0x1 - movs r2, 0xB - muls r1, r2 - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8026D8C - - thumb_func_start sub_8026DB0 -sub_8026DB0: @ 8026DB0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - ldr r4, =gUnknown_02022C98 - ldr r1, [r4] - adds r1, 0x24 - ldrb r2, [r1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldr r3, =gUnknown_082F449C+0x15E - lsls r1, r0, 1 - adds r1, r0 - lsls r0, r2, 4 - subs r0, r2 - adds r1, r0 - adds r0, r1, r3 - ldrb r0, [r0] - mov r12, r0 - adds r0, r3, 0x1 - adds r0, r1, r0 - ldrb r7, [r0] - adds r3, 0x2 - adds r1, r3 - ldrb r1, [r1] - mov r8, r1 - movs r3, 0 - ldr r1, =gUnknown_082F449C+0x1E3 - lsls r0, r2, 2 - adds r2, r0, r2 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _08026E18 - adds r6, r1, 0 -_08026DFE: - adds r0, r3, r2 - adds r0, r6 - ldrb r0, [r0] - cmp r5, r0 - beq _08026E3C - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r3, r2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _08026DFE -_08026E18: - ldr r0, [r4] - adds r0, 0x90 - mov r1, r12 - adds r2, r0, r1 - adds r1, r0, r7 - ldrb r0, [r2] - ldrb r3, [r1] - cmp r0, r3 - bls _08026E46 - adds r1, r0, 0 - b _08026E48 - .pool -_08026E3C: - ldr r0, [r4] - adds r0, 0x90 - adds r0, r7 - ldrb r0, [r0] - b _08026E5A -_08026E46: - ldrb r1, [r1] -_08026E48: - ldr r0, [r4] - adds r0, 0x90 - mov r2, r8 - adds r4, r0, r2 - ldrb r0, [r4] - cmp r0, r1 - bls _08026E58 - adds r1, r0, 0 -_08026E58: - adds r0, r1, 0 -_08026E5A: - adds r1, r5, 0 - bl sub_8026E70 - lsls r0, 24 - lsrs r0, 24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8026DB0 - - thumb_func_start sub_8026E70 -sub_8026E70: @ 8026E70 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_02022C98 - ldr r2, [r2] - adds r2, 0xE8 - adds r2, r1 - ldrb r4, [r2] - movs r1, 0x7 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x6 - bhi _08026EDE - lsls r0, 2 - ldr r1, =_08026EA4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08026EA4: - .4byte _08026EDE - .4byte _08026ED6 - .4byte _08026EE2 - .4byte _08026EC0 - .4byte _08026EC6 - .4byte _08026ECC - .4byte _08026ED2 -_08026EC0: - cmp r4, 0 - beq _08026ED6 - b _08026EDE -_08026EC6: - cmp r4, 0 - beq _08026EE2 - b _08026EDE -_08026ECC: - cmp r4, 0x2 - beq _08026ED6 - b _08026EE2 -_08026ED2: - cmp r4, 0 - bne _08026EDA -_08026ED6: - movs r0, 0x1 - b _08026EE4 -_08026EDA: - cmp r4, 0x1 - beq _08026EE2 -_08026EDE: - movs r0, 0 - b _08026EE4 -_08026EE2: - movs r0, 0x2 -_08026EE4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8026E70 - - thumb_func_start sub_8026EEC -sub_8026EEC: @ 8026EEC - push {r4-r6,lr} - movs r6, 0 - movs r5, 0 - adds r4, r0, 0 - b _08026EFE -_08026EF6: - ldrh r0, [r4, 0x6] - adds r6, r0 - adds r4, 0xC - adds r5, 0x1 -_08026EFE: - bl GetLinkPlayerCount - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _08026EF6 - cmp r6, 0xA - bgt _08026F12 - movs r0, 0 - b _08026F14 -_08026F12: - movs r0, 0x1 -_08026F14: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8026EEC - - thumb_func_start sub_8026F1C -sub_8026F1C: @ 8026F1C - push {r4-r6,lr} - lsls r0, 24 - lsrs r3, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r6, =gUnknown_02022C98 - ldr r1, [r6] - adds r0, r1, 0 - adds r0, 0x24 - ldrb r5, [r0] - cmp r3, 0 - bge _08026F3A - b _0802722C -_08026F3A: - cmp r3, 0x2 - ble _08026F48 - cmp r3, 0x3 - beq _08026F78 - b _0802722C - .pool -_08026F48: - ldr r3, =0x000031b4 - adds r0, r1, r3 - adds r0, r4 - ldrb r4, [r0] - lsls r4, 1 - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r4, r0 - adds r0, r1, 0 - adds r0, 0x4A - adds r0, r4 - ldrh r0, [r0] - ldr r1, =0x00004e20 - bl sub_8027A28 - ldr r1, [r6] - adds r1, 0x4A - adds r1, r4 - b _0802722A - .pool -_08026F78: - adds r0, r1, 0 - adds r0, 0x4A - bl sub_8026EEC - cmp r0, 0 - beq _08026F86 - b _0802722C -_08026F86: - cmp r5, 0x3 - bne _08026F8C - b _08027154 -_08026F8C: - cmp r5, 0x3 - bgt _08026F98 - cmp r5, 0x2 - bne _08026F96 - b _080271E8 -_08026F96: - b _0802722C -_08026F98: - cmp r5, 0x4 - bne _08026F9E - b _08027090 -_08026F9E: - cmp r5, 0x5 - beq _08026FA4 - b _0802722C -_08026FA4: - cmp r4, 0x9 - bls _08026FAA - b _0802722C -_08026FAA: - lsls r0, r4, 2 - ldr r1, =_08026FB8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08026FB8: - .4byte _08026FE0 - .4byte _08026FF8 - .4byte _08027004 - .4byte _0802701C - .4byte _08027028 - .4byte _08027040 - .4byte _0802704C - .4byte _08027060 - .4byte _0802706C - .4byte _08027084 -_08026FE0: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x68 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x74 - b _08027226 - .pool -_08026FF8: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x74 - b _08027226 - .pool -_08027004: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x74 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x80 - b _08027226 - .pool -_0802701C: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x80 - b _08027226 - .pool -_08027028: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x80 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x50 - b _08027226 - .pool -_08027040: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x50 - b _08027226 - .pool -_0802704C: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 - .pool -_08027060: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - b _08027224 - .pool -_0802706C: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x5C - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x68 - b _08027226 - .pool -_08027084: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x68 - b _08027226 - .pool -_08027090: - subs r0, r4, 0x1 - cmp r0, 0x7 - bls _08027098 - b _0802722C -_08027098: - lsls r0, 2 - ldr r1, =_080270A8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080270A8: - .4byte _080270C8 - .4byte _080270E0 - .4byte _080270EC - .4byte _08027104 - .4byte _08027110 - .4byte _08027124 - .4byte _08027130 - .4byte _08027148 -_080270C8: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x68 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x74 - b _08027226 - .pool -_080270E0: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x74 - b _08027226 - .pool -_080270EC: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x74 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x50 - b _08027226 - .pool -_08027104: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x50 - b _08027226 - .pool -_08027110: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 - .pool -_08027124: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - b _08027224 - .pool -_08027130: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x5C - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x68 - b _08027226 - .pool -_08027148: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x68 - b _08027226 - .pool -_08027154: - subs r0, r4, 0x2 - cmp r0, 0x5 - bhi _0802722C - lsls r0, 2 - ldr r1, =_08027168 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08027168: - .4byte _08027180 - .4byte _08027198 - .4byte _080271A4 - .4byte _080271BC - .4byte _080271C8 - .4byte _080271DC -_08027180: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x5C - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x68 - b _08027226 - .pool -_08027198: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x68 - b _08027226 - .pool -_080271A4: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x68 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - adds r1, 0x50 - b _08027226 - .pool -_080271BC: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x50 - b _08027226 - .pool -_080271C8: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 - .pool -_080271DC: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - b _08027224 - .pool -_080271E8: - cmp r4, 0x4 - beq _0802720E - cmp r4, 0x4 - bgt _080271F6 - cmp r4, 0x3 - beq _08027200 - b _0802722C -_080271F6: - cmp r4, 0x5 - beq _08027214 - cmp r4, 0x6 - beq _08027222 - b _0802722C -_08027200: - ldr r1, [r6] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 -_0802720E: - ldr r1, [r6] - adds r1, 0x50 - b _08027226 -_08027214: - ldr r1, [r6] - adds r2, r1, 0 - adds r2, 0x50 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - b _08027224 -_08027222: - ldr r1, [r6] -_08027224: - adds r1, 0x5C -_08027226: - ldrh r0, [r1] - adds r0, 0x1 -_0802722A: - strh r0, [r1] -_0802722C: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8026F1C - - thumb_func_start sub_8027234 -sub_8027234: @ 8027234 - push {r4,r5,lr} - adds r1, r0, 0 - ldr r4, =gUnknown_02022C98 - ldr r3, [r4] - adds r0, r3, 0 - adds r0, 0x24 - ldrb r0, [r0] - cmp r0, 0x5 - bne _0802729E - cmp r1, 0x1 - bne _08027280 - movs r5, 0x89 - lsls r5, 1 - adds r1, r3, r5 - ldrh r0, [r1] - adds r2, r0, 0x1 - strh r2, [r1] - movs r0, 0x8A - lsls r0, 1 - adds r1, r3, r0 - lsls r0, r2, 16 - lsrs r0, 16 - ldrh r3, [r1] - cmp r0, r3 - bls _08027268 - strh r2, [r1] -_08027268: - ldr r0, [r4] - adds r2, r0, r5 - ldrh r0, [r2] - ldr r1, =0x0000270f - cmp r0, r1 - bls _0802729E - strh r1, [r2] - b _0802729E - .pool -_08027280: - movs r2, 0x89 - lsls r2, 1 - adds r0, r3, r2 - movs r5, 0x8A - lsls r5, 1 - adds r1, r3, r5 - ldrh r0, [r0] - ldrh r3, [r1] - cmp r0, r3 - bls _08027296 - strh r0, [r1] -_08027296: - ldr r0, [r4] - adds r0, r2 - movs r1, 0 - strh r1, [r0] -_0802729E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_8027234 - - thumb_func_start sub_80272A4 -sub_80272A4: @ 80272A4 - push {r4,r5,lr} - movs r3, 0 - ldr r2, =gUnknown_02022C98 - ldr r0, [r2] - adds r0, 0x24 - ldrb r0, [r0] - cmp r3, r0 - bcs _080272DC - adds r5, r2, 0 - movs r4, 0x8A - lsls r4, 1 -_080272BA: - ldr r2, [r5] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x54 - adds r1, r0 - adds r0, r2, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r2, 0x24 - ldrb r2, [r2] - cmp r3, r2 - bcc _080272BA -_080272DC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80272A4 - - thumb_func_start sub_80272E8 -sub_80272E8: @ 80272E8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r5, 0 - ldr r7, =gUnknown_02022C98 - movs r4, 0 - ldr r0, =0x000031bf - mov r10, r0 -_080272FC: - movs r2, 0 - lsls r6, r5, 4 - lsls r1, r5, 1 - mov r8, r1 - lsls r0, r5, 3 - mov r12, r0 - adds r1, r5, 0x1 - mov r9, r1 - subs r0, r6, r5 - lsls r3, r0, 2 -_08027310: - ldr r0, [r7] - adds r1, r2, r3 - add r0, r10 - adds r0, r1 - strb r4, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xA - bls _08027310 - ldr r0, [r7] - subs r1, r6, r5 - lsls r1, 2 - adds r0, r1 - ldr r2, =0x000031cc - adds r0, r2 - strb r4, [r0] - ldr r0, [r7] - adds r0, r1 - ldr r1, =0x000031d0 - adds r0, r1 - strb r4, [r0] - ldr r0, [r7] - adds r0, 0x90 - adds r0, r5 - strb r4, [r0] - ldr r1, [r7] - adds r0, r1, 0 - adds r0, 0x86 - add r0, r8 - strh r4, [r0] - add r1, r12 - ldr r2, =0x00003308 - adds r1, r2 - strb r4, [r1] - ldr r2, [r7] - ldr r1, =0x0000330c - adds r0, r2, r1 - add r0, r12 - str r4, [r0] - mov r0, r8 - adds r1, r0, r5 - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0x4A - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x4E - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x50 - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x52 - adds r0, r1 - strh r4, [r0] - adds r0, r2, 0 - adds r0, 0x54 - adds r0, r1 - strh r4, [r0] - mov r1, r9 - lsls r0, r1, 24 - lsrs r5, r0, 24 - cmp r5, 0x4 - bls _080272FC - ldr r2, =gUnknown_02022C98 - ldr r0, [r2] - movs r1, 0xAA - lsls r1, 1 - adds r0, r1 - movs r2, 0 - strb r2, [r0] - ldr r1, =gUnknown_02022C98 - ldr r0, [r1] - movs r1, 0x89 - lsls r1, 1 - adds r3, r0, r1 - movs r1, 0 - strh r2, [r3] - adds r0, 0x40 - strb r1, [r0] - bl sub_8026A88 - bl sub_8026988 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80272E8 - - thumb_func_start sub_80273F0 -sub_80273F0: @ 80273F0 - push {r4,r5,lr} - movs r4, 0 - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r0, [r0] - cmp r0, 0x4 - beq _0802740C - cmp r0, 0x5 - beq _08027410 - b _08027412 - .pool -_0802740C: - movs r4, 0x1 - b _08027412 -_08027410: - movs r4, 0x2 -_08027412: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - lsls r1, r4, 2 - ldr r5, =gUnknown_02022C98 - ldr r2, =gUnknown_082F7AA4 - adds r1, r4 - lsls r1, 1 - adds r0, r1 - adds r0, r2 - ldrb r2, [r0] -_08027436: - ldr r1, [r5] - lsls r0, r3, 1 - adds r0, r3 - lsls r0, 2 - adds r1, 0x52 - adds r1, r0 - strh r2, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x4 - bls _08027436 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80273F0 - - thumb_func_start sub_802745C -sub_802745C: @ 802745C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_02022C98 - ldr r2, [r1] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r0, r2, 0 - adds r0, 0x4A - adds r0, r1 - ldrh r3, [r0] - adds r0, r2, 0 - adds r0, 0x4C - adds r0, r1 - ldrh r0, [r0] - adds r2, 0x4E - adds r2, r1 - adds r3, r0 - ldrh r2, [r2] - adds r0, r3, r2 - ldr r1, =0x0000270f - cmp r0, r1 - bls _0802748E - adds r0, r1, 0 -_0802748E: - pop {r1} - bx r1 - .pool - thumb_func_end sub_802745C - - thumb_func_start sub_802749C -sub_802749C: @ 802749C - push {r4-r6,lr} - ldr r5, =gUnknown_02022C98 - ldr r0, [r5] - adds r0, 0x28 - ldrb r0, [r0] - bl sub_802745C - ldr r1, =0x0000270f - bl sub_8027A38 - adds r4, r0, 0 - ldr r0, [r5] - adds r0, 0x28 - ldrb r0, [r0] - bl sub_80276C0 - ldr r1, =0x000f4236 - bl sub_8027A38 - adds r2, r0, 0 - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - movs r6, 0x83 - lsls r6, 2 - adds r1, r0, r6 - ldr r0, [r1] - cmp r0, r2 - bcs _080274D6 - str r2, [r1] -_080274D6: - ldr r0, [r3] - movs r2, 0x84 - lsls r2, 2 - adds r1, r0, r2 - ldrh r0, [r1] - cmp r0, r4 - bcs _080274E6 - strh r4, [r1] -_080274E6: - ldr r0, [r3] - ldr r6, =0x00000212 - adds r2, r0, r6 - ldr r0, [r5] - movs r1, 0x8A - lsls r1, 1 - adds r0, r1 - ldrh r1, [r0] - ldrh r0, [r2] - cmp r0, r1 - bcs _080274FE - strh r1, [r2] -_080274FE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802749C - - thumb_func_start sub_8027518 -sub_8027518: @ 8027518 - push {r4-r7,lr} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gUnknown_02022C98 - ldr r0, [r1] - adds r0, 0x9B - ldrb r6, [r0] - movs r3, 0x3 - adds r5, r1, 0 - adds r4, r5, 0 -_0802752C: - ldr r0, [r4] - adds r0, 0x98 - adds r2, r0, r3 - subs r1, r3, 0x1 - adds r0, r1 - ldrb r0, [r0] - strb r0, [r2] - lsls r1, 24 - lsrs r3, r1, 24 - cmp r3, 0 - bne _0802752C - ldr r0, [r5] - adds r0, 0x98 - strb r7, [r0] - adds r0, r6, 0 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8027518 - - thumb_func_start sub_8027554 -sub_8027554: @ 8027554 - push {r4,lr} - ldr r4, =gUnknown_02022C98 - ldr r3, [r4] - adds r0, r3, 0 - adds r0, 0x28 - ldrb r1, [r0] - adds r0, 0x88 - adds r2, r0, r1 - ldrb r0, [r2] - cmp r0, 0 - bne _080275FC - ldr r0, =gMain - ldrh r2, [r0, 0x2E] - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _08027594 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r3, r0 - ldr r1, =0x000031cc - adds r0, r1 - movs r1, 0x2 - b _080275CA - .pool -_08027594: - movs r0, 0x20 - ands r0, r2 - cmp r0, 0 - beq _080275B0 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r3, r0 - ldr r1, =0x000031cc - adds r0, r1 - movs r1, 0x3 - b _080275CA - .pool -_080275B0: - movs r0, 0x10 - ands r0, r2 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _080275E8 - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r3, r0 - ldr r1, =0x000031cc - adds r0, r1 - movs r1, 0x1 -_080275CA: - strb r1, [r0] - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x28 - adds r0, 0xB0 - ldrb r1, [r1] - adds r0, r1 - movs r1, 0x6 - strb r1, [r0] - movs r0, 0xD4 - bl PlaySE - b _08027600 - .pool -_080275E8: - lsls r0, r1, 4 - subs r0, r1 - lsls r0, 2 - adds r0, r3, r0 - ldr r1, =0x000031cc - adds r0, r1 - strb r2, [r0] - b _08027600 - .pool -_080275FC: - subs r0, 0x1 - strb r0, [r2] -_08027600: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8027554 - - thumb_func_start sub_8027608 -sub_8027608: @ 8027608 - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x28 - ldrb r2, [r0] - lsls r0, r2, 4 - subs r0, r2 - lsls r0, 2 - adds r1, r0 - ldr r0, =0x000031cc - adds r1, r0 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8027608 - - thumb_func_start sub_802762C -sub_802762C: @ 802762C - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x28 - ldrb r2, [r0] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r1, 0x52 - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x85 - lsls r0, 16 - lsrs r0, 16 - bx lr - .pool - thumb_func_end sub_802762C - - thumb_func_start sub_8027650 -sub_8027650: @ 8027650 - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8027650 - - thumb_func_start sub_8027660 -sub_8027660: @ 8027660 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - bne _0802768C - ldr r0, =gUnknown_02022C98 - lsls r1, r2, 4 - subs r1, r2 - lsls r1, 2 - ldr r2, =0x000031a0 - adds r1, r2 - ldr r0, [r0] - b _08027694 - .pool -_0802768C: - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - ldr r1, =gLinkPlayers + 8 -_08027694: - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8027660 - - thumb_func_start sub_80276A0 -sub_80276A0: @ 80276A0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r2, =gUnknown_02022C98 - ldr r3, [r2] - lsrs r1, 23 - lsls r2, r0, 1 - adds r2, r0 - lsls r2, 2 - adds r1, r2 - adds r3, 0x4A - adds r3, r1 - ldrh r0, [r3] - bx lr - .pool - thumb_func_end sub_80276A0 - - thumb_func_start sub_80276C0 -sub_80276C0: @ 80276C0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - movs r3, 0 - ldr r0, =gUnknown_02022C98 - mov r9, r0 - ldr r2, =gUnknown_082F7B24 - mov r10, r2 - ldr r2, [r0] - lsls r1, r4, 1 - adds r0, r1, r4 - lsls r0, 2 - str r0, [sp] - adds r6, r2, 0 - adds r6, 0x4A - mov r12, r1 - mov r8, r10 -_080276EE: - lsls r1, r3, 1 - ldr r7, [sp] - adds r0, r1, r7 - adds r0, r6, r0 - ldrh r2, [r0] - add r1, r8 - movs r7, 0 - ldrsh r0, [r1, r7] - muls r0, r2 - adds r5, r0 - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x2 - bls _080276EE - mov r0, r9 - ldr r1, [r0] - mov r2, r12 - adds r0, r2, r4 - lsls r0, 2 - adds r1, 0x50 - adds r1, r0 - ldrh r1, [r1] - mov r3, r10 - movs r7, 0x6 - ldrsh r0, [r3, r7] - muls r0, r1 - cmp r5, r0 - bls _08027734 - subs r0, r5, r0 - b _08027736 - .pool -_08027734: - movs r0, 0 -_08027736: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80276C0 - - thumb_func_start sub_8027748 -sub_8027748: @ 8027748 - push {r4-r6,lr} - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r6, [r0] - movs r0, 0 - bl sub_80276C0 - adds r5, r0, 0 - movs r4, 0x1 - cmp r4, r6 - bcs _08027776 -_08027760: - adds r0, r4, 0 - bl sub_80276C0 - cmp r0, r5 - bls _0802776C - adds r5, r0, 0 -_0802776C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _08027760 -_08027776: - ldr r1, =0x000f4236 - adds r0, r5, 0 - bl sub_8027A38 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8027748 - - thumb_func_start sub_802778C -sub_802778C: @ 802778C - push {r4,r5,lr} - lsls r0, 24 - ldr r1, =gUnknown_02022C98 - ldr r2, [r1] - adds r1, r2, 0 - adds r1, 0x24 - ldrb r5, [r1] - lsrs r4, r0, 23 - adds r2, 0x4A - adds r0, r2, r4 - ldrh r3, [r0] - movs r1, 0 - cmp r1, r5 - bcs _080277C4 -_080277A8: - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r4, r0 - adds r0, r2, r0 - ldrh r0, [r0] - cmp r0, r3 - bls _080277BA - adds r3, r0, 0 -_080277BA: - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, r5 - bcc _080277A8 -_080277C4: - adds r0, r3, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802778C - - thumb_func_start sub_80277D0 -sub_80277D0: @ 80277D0 - push {r4-r7,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0x1 - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r5, [r0] - movs r4, 0 - cmp r4, r5 - bcs _080277FE -_080277E8: - adds r0, r4, 0 - bl sub_80276C0 - lsls r1, r4, 2 - add r1, sp - str r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _080277E8 -_080277FE: - lsls r7, 2 - mov r12, r7 - cmp r6, 0 - beq _08027838 - subs r7, r5, 0x1 -_08027808: - movs r6, 0 - movs r4, 0 - cmp r6, r7 - bge _08027834 - adds r5, r7, 0 -_08027812: - lsls r0, r4, 2 - mov r2, sp - adds r1, r2, r0 - adds r4, 0x1 - lsls r0, r4, 2 - adds r3, r2, r0 - ldr r0, [r1] - ldr r2, [r3] - cmp r0, r2 - bcs _0802782C - str r2, [r1] - str r0, [r3] - movs r6, 0x1 -_0802782C: - lsls r0, r4, 24 - lsrs r4, r0, 24 - cmp r4, r5 - blt _08027812 -_08027834: - cmp r6, 0 - bne _08027808 -_08027838: - mov r0, sp - add r0, r12 - ldr r0, [r0] - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80277D0 - - thumb_func_start sub_802784C -sub_802784C: @ 802784C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0 - mov r10, r0 - mov r8, r0 - mov r9, r0 - ldr r6, =gUnknown_02022C98 - ldr r0, [r6] - adds r0, 0x24 - ldrb r5, [r0] - bl sub_8027748 - bl sub_8027748 - cmp r0, 0 - bne _080278A0 - movs r4, 0 - cmp r9, r5 - bcs _080278A0 - adds r2, r6, 0 - ldr r1, =0x00003308 - mov r12, r1 - movs r7, 0 - movs r6, 0x4 - ldr r3, =0x0000330c -_08027884: - ldr r0, [r2] - lsls r1, r4, 3 - adds r0, r1 - add r0, r12 - strb r6, [r0] - ldr r0, [r2] - adds r0, r3 - adds r0, r1 - str r7, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08027884 -_080278A0: - movs r4, 0 - cmp r4, r5 - bcs _080278CA -_080278A6: - adds r0, r4, 0 - bl sub_80276C0 - ldr r1, =0x000f4236 - bl sub_8027A38 - ldr r1, =gUnknown_02022C98 - ldr r1, [r1] - lsls r2, r4, 3 - ldr r3, =0x0000330c - adds r1, r3 - adds r1, r2 - str r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _080278A6 -_080278CA: - mov r0, r10 - bl sub_80277D0 - adds r6, r0, 0 - mov r3, r8 - movs r4, 0 - cmp r4, r5 - bcs _08027916 - ldr r7, =gUnknown_02022C98 - mov r10, r7 -_080278DE: - mov r0, r10 - ldr r2, [r0] - lsls r1, r4, 3 - ldr r7, =0x0000330c - adds r0, r2, r7 - adds r0, r1 - ldr r0, [r0] - cmp r6, r0 - bne _0802790C - adds r0, r2, r1 - ldr r1, =0x00003308 - adds r0, r1 - strb r3, [r0] - mov r0, r8 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - mov r0, r9 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0802790C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _080278DE -_08027916: - mov r10, r8 - cmp r9, r5 - bcc _080278CA - movs r0, 0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802784C - - thumb_func_start sub_802793C -sub_802793C: @ 802793C - lsls r1, 24 - ldr r2, =gUnknown_02022C98 - ldr r2, [r2] - lsrs r1, 21 - ldr r3, =0x00003308 - adds r2, r3 - adds r2, r1 - ldr r1, [r2] - ldr r2, [r2, 0x4] - str r1, [r0] - str r2, [r0, 0x4] - bx lr - .pool - thumb_func_end sub_802793C - - thumb_func_start sub_802795C -sub_802795C: @ 802795C - push {r4-r7,lr} - sub sp, 0x14 - lsls r0, 24 - lsrs r6, r0, 24 - movs r7, 0 - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r5, [r0] - mov r0, sp - movs r1, 0 - movs r2, 0x14 - bl memset - movs r4, 0 - cmp r7, r5 - bcs _08027994 -_0802797E: - adds r0, r4, 0 - bl sub_80276C0 - lsls r1, r4, 2 - add r1, sp - str r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _0802797E -_08027994: - lsls r0, r6, 2 - add r0, sp - ldr r1, [r0] - movs r4, 0 -_0802799C: - cmp r4, r6 - beq _080279B0 - lsls r0, r4, 2 - add r0, sp - ldr r0, [r0] - cmp r1, r0 - bcs _080279B0 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 -_080279B0: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _0802799C - adds r0, r7, 0 - add sp, 0x14 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802795C - - thumb_func_start sub_80279C8 -sub_80279C8: @ 80279C8 - push {r4-r6,lr} - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x28 - ldrb r4, [r0] - bl sub_802762C - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, r5, 0 - adds r0, r4, 0 - bl sub_80276C0 - adds r4, r0, 0 - bl sub_8027748 - cmp r4, r0 - beq _080279F4 - movs r0, 0x3 - b _08027A22 - .pool -_080279F4: - adds r0, r5, 0 - movs r1, 0x1 - bl CheckBagHasSpace - lsls r0, 24 - cmp r0, 0 - bne _08027A06 - movs r0, 0x2 - b _08027A22 -_08027A06: - adds r0, r6, 0 - movs r1, 0x1 - bl AddBagItem - adds r0, r6, 0 - movs r1, 0x1 - bl CheckBagHasSpace - lsls r0, 24 - cmp r0, 0 - beq _08027A20 - movs r0, 0 - b _08027A22 -_08027A20: - movs r0, 0x1 -_08027A22: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_80279C8 - - thumb_func_start sub_8027A28 -sub_8027A28: @ 8027A28 - push {lr} - adds r2, r0, 0 - adds r0, r1, 0 - cmp r2, r0 - bcs _08027A34 - adds r0, r2, 0x1 -_08027A34: - pop {r1} - bx r1 - thumb_func_end sub_8027A28 - - thumb_func_start sub_8027A38 -sub_8027A38: @ 8027A38 - push {lr} - adds r2, r0, 0 - adds r0, r1, 0 - cmp r2, r0 - bcs _08027A44 - adds r0, r2, 0 -_08027A44: - pop {r1} - bx r1 - thumb_func_end sub_8027A38 - - thumb_func_start sub_8027A48 -sub_8027A48: @ 8027A48 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_02022C98 - ldr r1, [r1] - adds r1, 0x34 - adds r1, r0 - ldrb r0, [r1] - bx lr - .pool - thumb_func_end sub_8027A48 - - thumb_func_start sub_8027A5C -sub_8027A5C: @ 8027A5C - push {r4-r6,lr} - movs r5, 0 - ldr r6, =gSpecialVar_Result -_08027A62: - movs r0, 0x64 - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0x5 - bl GetMonData - cmp r0, 0 - beq _08027A94 - adds r0, r4, 0 - movs r1, 0x41 - bl GetMonData - cmp r0, 0x55 - bne _08027A94 - movs r0, 0x1 - strh r0, [r6] - b _08027AA0 - .pool -_08027A94: - adds r5, 0x1 - cmp r5, 0x5 - ble _08027A62 - ldr r1, =gSpecialVar_Result - movs r0, 0 - strh r0, [r1] -_08027AA0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027A5C - - thumb_func_start sub_8027AAC -sub_8027AAC: @ 8027AAC - push {r4,lr} - ldr r4, =sub_8027ACC - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027AAC - - thumb_func_start sub_8027ACC -sub_8027ACC: @ 8027ACC - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - movs r1, 0 - ldrsh r0, [r7, r1] - cmp r0, 0x1 - beq _08027B94 - cmp r0, 0x1 - bgt _08027AF4 - cmp r0, 0 - beq _08027AFE - b _08027BE2 - .pool -_08027AF4: - cmp r0, 0x2 - beq _08027BA0 - cmp r0, 0x3 - beq _08027BC8 - b _08027BE2 -_08027AFE: - ldr r0, =gUnknown_082F7B2C - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - ldr r1, =gText_BerryPickingRecords - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0 - movs r6, 0 - ldr r5, =gUnknown_082F7B34 -_08027B18: - ldr r1, [r5] - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r0, 0x32 - cmp r0, r4 - ble _08027B2A - adds r4, r0, 0 -_08027B2A: - adds r5, 0x4 - adds r6, 0x1 - cmp r6, 0x2 - bls _08027B18 - adds r0, r4, 0x7 - cmp r0, 0 - bge _08027B3A - adds r0, 0x7 -_08027B3A: - asrs r4, r0, 3 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _08027B46 - adds r4, 0x1 -_08027B46: - movs r1, 0x1E - subs r1, r4 - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - lsls r1, 24 - lsrs r1, 16 - ldr r2, =0xffff00ff - ldr r0, [sp] - ands r0, r2 - orrs r0, r1 - lsls r2, r4, 24 - ldr r1, =0x00ffffff - ands r0, r1 - orrs r0, r2 - str r0, [sp] - mov r0, sp - bl AddWindow - strh r0, [r7, 0x2] - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_8027BEC - ldrb r0, [r7, 0x2] - movs r1, 0x3 - b _08027BB6 - .pool -_08027B94: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08027BE2 - b _08027BBA -_08027BA0: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _08027BE2 - ldrb r0, [r7, 0x2] - bl rbox_fill_rectangle - ldrb r0, [r7, 0x2] - movs r1, 0x1 -_08027BB6: - bl CopyWindowToVram -_08027BBA: - ldrh r0, [r7] - adds r0, 0x1 - strh r0, [r7] - b _08027BE2 - .pool -_08027BC8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08027BE2 - ldrb r0, [r7, 0x2] - bl RemoveWindow - adds r0, r4, 0 - bl DestroyTask - bl EnableBothScriptContexts -_08027BE2: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8027ACC - - thumb_func_start sub_8027BEC -sub_8027BEC: @ 8027BEC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - str r1, [sp, 0x18] - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - movs r2, 0x84 - lsls r2, 2 - adds r0, r1, r2 - ldrh r0, [r0] - str r0, [sp, 0xC] - subs r2, 0x4 - adds r0, r1, r2 - ldr r0, [r0] - str r0, [sp, 0x10] - ldr r0, =0x00000212 - adds r1, r0 - ldrh r0, [r1] - str r0, [sp, 0x14] - ldr r4, =0x0000021d - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0xD0 - bl LoadUserWindowBorderGfx_ - adds r0, r7, 0 - adds r1, r4, 0 - movs r2, 0xD - bl DrawTextBorderOuter - adds r0, r7, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r4, =gText_BerryPickingRecords - ldr r0, [sp, 0x18] - lsls r2, r0, 3 - movs r0, 0x1 - adds r1, r4, 0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r4, 0 - bl AddTextPrinterParameterized - movs r6, 0 - ldr r2, =gStringVar1 - mov r8, r2 - movs r0, 0xFF - mov r10, r0 - mov r9, r6 - mov r2, sp - adds r2, 0xC - str r2, [sp, 0x1C] -_08027C76: - lsls r4, r6, 2 - ldr r0, [sp, 0x1C] - ldm r0!, {r1} - str r0, [sp, 0x1C] - ldr r0, =gUnknown_082F7B40 - adds r0, r6, r0 - ldrb r3, [r0] - mov r0, r8 - movs r2, 0 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - mov r1, r8 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - adds r5, r0, 0 - ldr r0, =gUnknown_082F7B34 - adds r4, r0 - ldr r2, [r4] - ldr r0, =gUnknown_082F7B44 - lsls r4, r6, 1 - adds r0, r4, r0 - ldrb r0, [r0] - str r0, [sp] - mov r0, r10 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - ldr r2, [sp, 0x18] - lsls r3, r2, 3 - subs r3, r5 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_082F7B4A - adds r4, r0 - ldrb r0, [r4] - str r0, [sp] - mov r0, r10 - str r0, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - mov r2, r8 - bl AddTextPrinterParameterized - adds r6, 0x1 - cmp r6, 0x2 - ble _08027C76 - adds r0, r7, 0 - bl PutWindowTilemap - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027BEC - - thumb_func_start sub_8027D20 -sub_8027D20: @ 8027D20 - push {lr} - bl GetLinkPlayerCount - ldr r1, =gUnknown_02022C98 - ldr r1, [r1] - adds r1, 0x24 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027D20 - - thumb_func_start sub_8027D38 -sub_8027D38: @ 8027D38 - push {r4-r7,lr} - ldr r0, =gUnknown_02022C98 - ldr r0, [r0] - adds r0, 0x24 - ldrb r4, [r0] - cmp r4, 0x4 - bhi _08027D66 - ldr r5, =gUnknown_082F7B90 -_08027D48: - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - ldr r1, =gLinkPlayers + 8 - adds r0, r1 - lsls r1, r4, 2 - adds r1, r5 - ldr r1, [r1] - bl StringCopy - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _08027D48 -_08027D66: - ldr r0, =gUnknown_02022C98 - ldr r1, [r0] - adds r1, 0x24 - movs r2, 0x5 - strb r2, [r1] - movs r1, 0 - mov r12, r0 -_08027D74: - movs r4, 0 - mov r2, r12 - ldr r0, [r2] - adds r0, 0x24 - adds r5, r1, 0x1 - ldrb r0, [r0] - cmp r4, r0 - bcs _08027DB2 - ldr r7, =gUnknown_02022C98 - lsls r3, r1, 1 - ldr r6, =gUnknown_082F7B50 -_08027D8A: - ldr r2, [r7] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r3, r0 - adds r1, r2, 0 - adds r1, 0x4A - adds r1, r0 - lsls r0, r4, 3 - adds r0, r3, r0 - adds r0, r6 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - adds r2, 0x24 - ldrb r2, [r2] - cmp r4, r2 - bcc _08027D8A -_08027DB2: - lsls r0, r5, 24 - lsrs r1, r0, 24 - cmp r1, 0x3 - bls _08027D74 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027D38 - - thumb_func_start sub_8027DD0 -sub_8027DD0: @ 8027DD0 - push {lr} - sub sp, 0x8 - ldr r3, =0xffffff00 - ldr r1, [sp] - ands r1, r3 - movs r2, 0x1 - orrs r1, r2 - str r1, [sp] - lsls r0, 24 - lsrs r0, 24 - ldr r1, [sp, 0x4] - ands r1, r3 - orrs r1, r0 - str r1, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8027DD0 - - thumb_func_start sub_8027DFC -sub_8027DFC: @ 8027DFC - push {lr} - adds r2, r0, 0 - ldr r3, =gRecvCmds - ldrh r0, [r3] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _08027E1E - lsls r0, r2, 4 - adds r1, r3, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0x1 - beq _08027E28 -_08027E1E: - movs r0, 0 - b _08027E2A - .pool -_08027E28: - ldrb r0, [r1, 0x4] -_08027E2A: - pop {r1} - bx r1 - thumb_func_end sub_8027DFC - - thumb_func_start sub_8027E30 -sub_8027E30: @ 8027E30 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r4, [sp, 0x48] - lsls r4, 24 - str r4, [sp, 0x1C] - movs r4, 0x14 - adds r4, r0 - mov r9, r4 - mov r5, sp - movs r4, 0x2 - strb r4, [r5] - mov r10, sp - mov r5, r9 - ldrb r4, [r5, 0xB] - movs r7, 0xF - adds r5, r7, 0 - ands r5, r4 - mov r6, r10 - ldrb r6, [r6, 0x1] - mov r8, r6 - movs r4, 0x10 - negs r4, r4 - mov r6, r8 - ands r4, r6 - orrs r4, r5 - mov r5, r10 - strb r4, [r5, 0x1] - mov r8, sp - mov r6, r9 - ldrb r5, [r6, 0xC] - lsls r5, 4 - ands r4, r7 - orrs r4, r5 - mov r5, r8 - strb r4, [r5, 0x1] - ldrb r5, [r6, 0xD] - movs r6, 0xF - ands r5, r6 - mov r4, r10 - ldrb r4, [r4, 0x2] - mov r8, r4 - movs r4, 0x10 - negs r4, r4 - mov r6, r8 - ands r4, r6 - orrs r4, r5 - mov r5, r10 - strb r4, [r5, 0x2] - mov r8, sp - mov r6, r9 - ldrb r5, [r6, 0xE] - lsls r5, 4 - ands r4, r7 - orrs r4, r5 - mov r5, r8 - strb r4, [r5, 0x2] - ldrb r5, [r6, 0xF] - movs r6, 0xF - ands r5, r6 - mov r4, r10 - ldrb r4, [r4, 0x3] - mov r8, r4 - movs r4, 0x10 - negs r4, r4 - mov r6, r8 - ands r4, r6 - orrs r4, r5 - mov r5, r10 - strb r4, [r5, 0x3] - mov r8, sp - mov r6, r9 - ldrb r5, [r6, 0x10] - lsls r5, 4 - ands r4, r7 - orrs r4, r5 - mov r5, r8 - strb r4, [r5, 0x3] - ldrb r5, [r6, 0x11] - movs r6, 0xF - ands r5, r6 - mov r4, r10 - ldrb r4, [r4, 0x4] - mov r8, r4 - movs r4, 0x10 - negs r4, r4 - mov r6, r8 - ands r4, r6 - orrs r4, r5 - mov r5, r10 - strb r4, [r5, 0x4] - mov r8, sp - mov r6, r9 - ldrb r5, [r6, 0x12] - lsls r5, 4 - ands r4, r7 - orrs r4, r5 - mov r5, r8 - strb r4, [r5, 0x4] - ldrb r4, [r6, 0x13] - movs r6, 0xF - ands r4, r6 - mov r6, r8 - ldrb r5, [r6, 0x5] - movs r6, 0x10 - negs r6, r6 - ands r6, r5 - orrs r6, r4 - str r6, [sp, 0xC] - mov r4, r8 - strb r6, [r4, 0x5] - mov r5, sp - mov r6, r9 - ldrb r4, [r6, 0x14] - lsls r4, 4 - ldr r6, [sp, 0xC] - ands r6, r7 - orrs r6, r4 - strb r6, [r5, 0x5] - mov r7, sp - movs r4, 0x3 - mov r8, r4 - ldrb r0, [r0, 0x14] - mov r5, r8 - ands r0, r5 - ldrb r5, [r7, 0x6] - movs r6, 0x4 - negs r6, r6 - mov r10, r6 - mov r4, r10 - ands r4, r5 - orrs r4, r0 - strb r4, [r7, 0x6] - mov r5, r9 - ldrb r0, [r5, 0x1] - mov r6, r8 - ands r0, r6 - lsls r0, 2 - movs r5, 0xD - negs r5, r5 - ands r5, r4 - orrs r5, r0 - strb r5, [r7, 0x6] - mov r0, r9 - ldrb r4, [r0, 0x2] - ands r4, r6 - lsls r4, 4 - movs r0, 0x31 - negs r0, r0 - ands r0, r5 - orrs r0, r4 - strb r0, [r7, 0x6] - mov r5, sp - mov r6, r9 - ldrb r4, [r6, 0x3] - lsls r4, 6 - movs r6, 0x3F - ands r0, r6 - orrs r0, r4 - strb r0, [r5, 0x6] - mov r4, r9 - ldrb r0, [r4, 0x4] - mov r5, r8 - ands r0, r5 - ldrb r5, [r7, 0x7] - mov r4, r10 - ands r4, r5 - orrs r4, r0 - strb r4, [r7, 0x7] - mov r6, r9 - ldrb r0, [r6, 0x5] - mov r5, r8 - ands r0, r5 - lsls r0, 2 - movs r5, 0xD - negs r5, r5 - ands r5, r4 - orrs r5, r0 - strb r5, [r7, 0x7] - ldrb r4, [r6, 0x6] - mov r6, r8 - ands r4, r6 - lsls r4, 4 - movs r0, 0x31 - negs r0, r0 - ands r0, r5 - orrs r0, r4 - strb r0, [r7, 0x7] - mov r5, sp - mov r6, r9 - ldrb r4, [r6, 0x7] - lsls r4, 6 - movs r6, 0x3F - ands r0, r6 - orrs r0, r4 - strb r0, [r5, 0x7] - mov r8, sp - mov r0, r9 - ldrb r4, [r0, 0x8] - movs r7, 0x3 - adds r0, r7, 0 - ands r0, r4 - mov r4, r8 - ldrb r5, [r4, 0x8] - mov r4, r10 - ands r4, r5 - orrs r4, r0 - mov r5, r8 - strb r4, [r5, 0x8] - mov r6, r9 - ldrb r5, [r6, 0x9] - adds r0, r7, 0 - ands r0, r5 - lsls r0, 2 - movs r5, 0xD - negs r5, r5 - ands r5, r4 - orrs r5, r0 - mov r0, r8 - strb r5, [r0, 0x8] - ldrb r0, [r1] - adds r4, r7, 0 - ands r4, r0 - lsls r4, 4 - movs r0, 0x31 - negs r0, r0 - ands r0, r5 - orrs r0, r4 - mov r4, r8 - strb r0, [r4, 0x8] - mov r5, sp - ldrb r4, [r2] - lsls r4, 6 - movs r6, 0x3F - ands r0, r6 - orrs r0, r4 - strb r0, [r5, 0x8] - ldrb r4, [r3] - adds r0, r7, 0 - ands r0, r4 - ldrb r4, [r5, 0x9] - mov r6, r10 - ands r6, r4 - orrs r6, r0 - mov r10, r6 - strb r6, [r5, 0x9] - ldr r0, [sp, 0x40] - ldrb r4, [r0] - adds r0, r7, 0 - ands r0, r4 - lsls r0, 2 - movs r4, 0xD - negs r4, r4 - ands r6, r4 - orrs r6, r0 - str r6, [sp, 0x10] - strb r6, [r5, 0x9] - mov r4, sp - ldr r5, [sp, 0x44] - ldrb r0, [r5] - adds r6, r7, 0 - ands r6, r0 - lsls r0, r6, 4 - subs r7, 0x34 - ldr r5, [sp, 0x10] - ands r7, r5 - orrs r7, r0 - strb r7, [r4, 0x9] - mov r5, sp - ldrb r0, [r1, 0x4] - movs r6, 0x1 - mov r12, r6 - mov r4, r12 - ands r4, r0 - lsls r4, 6 - movs r0, 0x41 - negs r0, r0 - mov r10, r0 - ands r0, r7 - orrs r0, r4 - strb r0, [r5, 0x9] - ldrb r4, [r2, 0x4] - lsls r4, 7 - movs r5, 0x7F - ands r0, r5 - orrs r0, r4 - mov r4, r8 - strb r0, [r4, 0x9] - ldrb r4, [r3, 0x4] - mov r0, r12 - ands r0, r4 - mov r5, r8 - ldrb r4, [r5, 0xA] - movs r7, 0x2 - negs r7, r7 - adds r5, r7, 0 - ands r5, r4 - orrs r5, r0 - mov r6, r8 - strb r5, [r6, 0xA] - mov r9, sp - ldr r4, [sp, 0x40] - ldrb r0, [r4, 0x4] - mov r4, r12 - ands r4, r0 - lsls r4, 1 - movs r6, 0x3 - negs r6, r6 - mov r8, r6 - mov r0, r8 - ands r0, r5 - orrs r0, r4 - mov r4, r9 - strb r0, [r4, 0xA] - ldr r6, [sp, 0x44] - ldrb r5, [r6, 0x4] - mov r4, r12 - ands r4, r5 - lsls r4, 2 - movs r5, 0x5 - negs r5, r5 - ands r0, r5 - orrs r0, r4 - mov r4, r9 - strb r0, [r4, 0xA] - mov r4, sp - ldrb r1, [r1, 0x8] - mov r0, r12 - ands r0, r1 - lsls r0, 2 - ldrb r1, [r4, 0xB] - ands r5, r1 - orrs r5, r0 - strb r5, [r4, 0xB] - ldrb r1, [r2, 0x8] - mov r0, r12 - ands r0, r1 - lsls r0, 3 - movs r1, 0x9 - negs r1, r1 - ands r1, r5 - orrs r1, r0 - strb r1, [r4, 0xB] - ldrb r2, [r3, 0x8] - mov r0, r12 - ands r0, r2 - lsls r0, 4 - movs r2, 0x11 - negs r2, r2 - ands r2, r1 - orrs r2, r0 - strb r2, [r4, 0xB] - mov r3, sp - ldr r5, [sp, 0x40] - ldrb r0, [r5, 0x8] - mov r1, r12 - ands r1, r0 - lsls r1, 5 - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3, 0xB] - mov r2, sp - ldrb r1, [r6, 0x8] - mov r6, r12 - ands r6, r1 - lsls r1, r6, 6 - mov r3, r10 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0xB] - ldr r4, [sp, 0x1C] - lsrs r3, r4, 21 - ldrb r1, [r2, 0xA] - movs r0, 0x7 - ands r0, r1 - orrs r0, r3 - strb r0, [r2, 0xA] - mov r1, sp - ldr r5, [sp, 0x4C] - movs r6, 0x1 - ands r5, r6 - lsls r2, r5, 1 - ldrb r0, [r1, 0xB] - mov r3, r8 - ands r3, r0 - orrs r3, r2 - mov r8, r3 - strb r3, [r1, 0xB] - mov r0, sp - ldr r4, [sp, 0x50] - ands r4, r6 - mov r5, r8 - ands r5, r7 - orrs r5, r4 - strb r5, [r0, 0xB] - bl sub_800FE50 - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8027E30 - - thumb_func_start sub_8028164 -sub_8028164: @ 8028164 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r1, 0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r0, [sp, 0x1C] - mov r12, r0 - ldr r1, [sp, 0x20] - mov r8, r1 - ldr r0, [sp, 0x24] - mov r9, r0 - adds r2, r7, 0 - adds r2, 0x14 - ldr r4, =gRecvCmds - ldrh r0, [r4] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _0802819C - adds r3, r4, 0x2 - ldrb r0, [r4, 0x2] - cmp r0, 0x2 - beq _080281A4 -_0802819C: - movs r0, 0 - b _080282DE - .pool -_080281A4: - ldrb r0, [r3, 0x1] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0xB] - ldrb r0, [r3, 0x1] - lsrs r0, 4 - strb r0, [r2, 0xC] - ldrb r0, [r3, 0x2] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0xD] - ldrb r0, [r3, 0x2] - lsrs r0, 4 - strb r0, [r2, 0xE] - ldrb r0, [r3, 0x3] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0xF] - ldrb r0, [r3, 0x3] - lsrs r0, 4 - strb r0, [r2, 0x10] - ldrb r0, [r3, 0x4] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0x11] - ldrb r0, [r3, 0x4] - lsrs r0, 4 - strb r0, [r2, 0x12] - ldrb r0, [r3, 0x5] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0x13] - ldrb r0, [r3, 0x5] - lsrs r0, 4 - strb r0, [r2, 0x14] - ldrb r0, [r3, 0x1] - lsls r0, 28 - lsrs r0, 28 - strb r0, [r2, 0x15] - ldrb r0, [r3, 0x6] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r7, 0x14] - ldrb r0, [r3, 0x6] - lsls r0, 28 - lsrs r0, 30 - strb r0, [r2, 0x1] - ldrb r0, [r3, 0x6] - lsls r0, 26 - lsrs r0, 30 - strb r0, [r2, 0x2] - ldrb r0, [r3, 0x6] - lsrs r0, 6 - strb r0, [r2, 0x3] - ldrb r0, [r3, 0x7] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r2, 0x4] - ldrb r0, [r3, 0x7] - lsls r0, 28 - lsrs r0, 30 - strb r0, [r2, 0x5] - ldrb r0, [r3, 0x7] - lsls r0, 26 - lsrs r0, 30 - strb r0, [r2, 0x6] - ldrb r0, [r3, 0x7] - lsrs r0, 6 - strb r0, [r2, 0x7] - ldrb r0, [r3, 0x8] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r2, 0x8] - ldrb r0, [r3, 0x8] - lsls r0, 28 - lsrs r0, 30 - strb r0, [r2, 0x9] - ldrb r0, [r3, 0x6] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r2, 0xA] - ldrb r0, [r3, 0x8] - lsls r0, 26 - lsrs r0, 30 - strb r0, [r5] - ldrb r0, [r3, 0x9] - lsls r0, 25 - lsrs r0, 31 - strb r0, [r5, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 29 - lsrs r0, 31 - strb r0, [r5, 0x8] - ldrb r0, [r3, 0x8] - lsrs r0, 6 - strb r0, [r6] - ldrb r0, [r3, 0x9] - lsrs r0, 7 - strb r0, [r6, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 28 - lsrs r0, 31 - strb r0, [r6, 0x8] - ldrb r0, [r3, 0x9] - lsls r0, 30 - lsrs r0, 30 - mov r1, r12 - strb r0, [r1] - ldrb r0, [r3, 0xA] - lsls r0, 31 - lsrs r0, 31 - strb r0, [r1, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 27 - lsrs r0, 31 - strb r0, [r1, 0x8] - ldrb r0, [r3, 0x9] - lsls r0, 28 - lsrs r0, 30 - mov r1, r8 - strb r0, [r1] - ldrb r0, [r3, 0xA] - lsls r0, 30 - lsrs r0, 31 - strb r0, [r1, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 26 - lsrs r0, 31 - strb r0, [r1, 0x8] - ldrb r0, [r3, 0x9] - lsls r0, 26 - lsrs r0, 30 - mov r1, r9 - strb r0, [r1] - ldrb r0, [r3, 0xA] - lsls r0, 29 - lsrs r0, 31 - strb r0, [r1, 0x4] - ldrb r0, [r3, 0xB] - lsls r0, 25 - lsrs r0, 31 - strb r0, [r1, 0x8] - ldrb r0, [r3, 0xA] - lsrs r0, 3 - ldr r1, [sp, 0x28] - strb r0, [r1] - ldrb r0, [r3, 0xB] - lsls r0, 30 - lsrs r0, 31 - ldr r1, [sp, 0x2C] - str r0, [r1] - ldrb r0, [r3, 0xB] - lsls r0, 31 - lsrs r0, 31 - ldr r1, [sp, 0x30] - str r0, [r1] - movs r0, 0x1 -_080282DE: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8028164 - - thumb_func_start sub_80282EC -sub_80282EC: @ 80282EC - push {lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r0, 24 - ldr r3, =0xffffff00 - ldr r1, [sp] - ands r1, r3 - movs r2, 0x3 - orrs r1, r2 - str r1, [sp] - ldr r1, [sp, 0x4] - ands r1, r3 - orrs r1, r0 - str r1, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80282EC - - thumb_func_start sub_8028318 -sub_8028318: @ 8028318 - push {r4,lr} - adds r2, r0, 0 - adds r4, r1, 0 - ldr r3, =gRecvCmds - ldrh r0, [r3] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _0802833C - lsls r0, r2, 4 - adds r1, r3, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0x3 - beq _08028344 -_0802833C: - movs r0, 0 - b _0802834A - .pool -_08028344: - ldrb r0, [r1, 0x4] - strb r0, [r4] - movs r0, 0x1 -_0802834A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8028318 - - thumb_func_start sub_8028350 -sub_8028350: @ 8028350 - push {lr} - sub sp, 0x8 - ldr r2, =0xffffff00 - ldr r1, [sp] - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - str r1, [sp] - str r0, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028350 - - thumb_func_start sub_8028374 -sub_8028374: @ 8028374 - push {lr} - adds r2, r0, 0 - ldr r3, =gRecvCmds - ldrh r0, [r3] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _08028396 - lsls r0, r2, 4 - adds r1, r3, 0x2 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0x4 - beq _080283A0 -_08028396: - movs r0, 0 - b _080283A2 - .pool -_080283A0: - ldr r0, [r1, 0x4] -_080283A2: - pop {r1} - bx r1 - thumb_func_end sub_8028374 - - thumb_func_start sub_80283A8 -sub_80283A8: @ 80283A8 - push {r4,r5,lr} - sub sp, 0x18 - movs r5, 0xC0 - lsls r5, 6 - adds r0, r5, 0 - bl AllocZeroed - adds r4, r0, 0 - ldr r0, =gUnknown_082FB2D8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - ldr r0, =gUnknown_082FB2E0 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x10] - str r1, [sp, 0x14] - ldr r0, =gDodrioBerryPkmnGfx - adds r1, r4, 0 - bl LZ77UnCompWram - cmp r4, 0 - beq _080283E8 - str r4, [sp] - str r5, [sp, 0x4] - mov r0, sp - bl LoadSpriteSheet - adds r0, r4, 0 - bl Free -_080283E8: - add r0, sp, 0x8 - bl LoadSpritePalette - add r0, sp, 0x10 - bl LoadSpritePalette - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80283A8 - - thumb_func_start sub_8028408 -sub_8028408: @ 8028408 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x30 - adds r6, r1, 0 - mov r8, r2 - adds r5, r3, 0 - lsls r6, 24 - lsrs r6, 24 - mov r1, r8 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - lsls r5, 24 - lsrs r5, 24 - add r1, sp, 0x18 - movs r3, 0 - strh r3, [r1] - ldrb r2, [r0] - mov r0, sp - adds r0, 0x1A - strh r2, [r0] - ldr r0, =gUnknown_082FB1E0 - str r0, [sp, 0x1C] - ldr r0, =gUnknown_082FB228 - str r0, [sp, 0x20] - str r3, [sp, 0x24] - ldr r0, =gDummySpriteAffineAnimTable - str r0, [sp, 0x28] - ldr r0, =sub_80284A8 - str r0, [sp, 0x2C] - mov r0, sp - movs r2, 0x18 - bl memcpy - movs r0, 0x4 - bl AllocZeroed - ldr r1, =gUnknown_02022C9C - mov r2, r8 - lsls r4, r2, 2 - adds r4, r1 - str r0, [r4] - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_8028F14 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - mov r0, sp - movs r2, 0x88 - movs r3, 0x3 - bl CreateSprite - ldr r1, [r4] - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - movs r0, 0x1 - mov r1, r8 - bl sub_8028654 - add sp, 0x30 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028408 - - thumb_func_start sub_80284A8 -sub_80284A8: @ 80284A8 - push {lr} - movs r2, 0x2E - ldrsh r1, [r0, r2] - cmp r1, 0x1 - beq _080284BC - cmp r1, 0x1 - ble _080284C6 - cmp r1, 0x2 - beq _080284C2 - b _080284C6 -_080284BC: - bl sub_802853C - b _080284C6 -_080284C2: - bl sub_80285AC -_080284C6: - pop {r0} - bx r0 - thumb_func_end sub_80284A8 - - thumb_func_start sub_80284CC -sub_80284CC: @ 80284CC - push {lr} - bl GetMultiplayerId - ldr r1, =gUnknown_02022C9C - lsls r0, 24 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - strh r2, [r0, 0x32] - strh r2, [r0, 0x34] - strh r2, [r0, 0x36] - pop {r0} - bx r0 - .pool - thumb_func_end sub_80284CC - - thumb_func_start sub_8028504 -sub_8028504: @ 8028504 - push {lr} - bl GetMultiplayerId - ldr r1, =gUnknown_02022C9C - lsls r0, 24 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r2, 0 - movs r1, 0x2 - strh r1, [r0, 0x2E] - strh r2, [r0, 0x30] - strh r2, [r0, 0x32] - strh r2, [r0, 0x34] - strh r2, [r0, 0x36] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028504 - - thumb_func_start sub_802853C -sub_802853C: @ 802853C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r2, r0, 16 - lsrs r0, 31 - adds r0, r2, r0 - asrs r1, r0, 1 - adds r0, r1, 0 - cmp r1, 0 - bge _08028558 - adds r0, r1, 0x3 -_08028558: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 24 - lsrs r0, 24 - cmp r2, 0x2 - ble _080285A2 - cmp r0, 0x2 - bgt _0802856E - cmp r0, 0x1 - bge _08028572 -_0802856E: - movs r0, 0x1 - b _08028574 -_08028572: - movs r0, 0xFF -_08028574: - lsls r0, 24 - asrs r0, 24 - ldrh r1, [r4, 0x20] - adds r0, r1 - strh r0, [r4, 0x20] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - ble _080285A2 - movs r0, 0 - strh r0, [r4, 0x2E] - bl sub_8027650 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0 - bl sub_8028F14 - strh r0, [r4, 0x20] -_080285A2: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802853C - - thumb_func_start sub_80285AC -sub_80285AC: @ 80285AC - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0xD - bl __divsi3 - lsls r0, 16 - asrs r1, r0, 16 - adds r0, r1, 0 - cmp r1, 0 - bge _080285CC - adds r0, r1, 0x3 -_080285CC: - asrs r0, 2 - lsls r0, 2 - subs r0, r1, r0 - lsls r0, 24 - lsrs r4, r0, 24 - movs r1, 0x30 - ldrsh r0, [r5, r1] - movs r1, 0xD - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _080285F0 - cmp r4, 0 - beq _080285F0 - movs r0, 0xD4 - bl PlaySE -_080285F0: - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0x67 - ble _080285FE - movs r0, 0 - strh r0, [r5, 0x2E] - movs r4, 0 -_080285FE: - bl GetMultiplayerId - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - bl sub_80286B4 - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80285AC - - thumb_func_start sub_8028614 -sub_8028614: @ 8028614 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 - cmp r4, r5 - bcs _08028646 - ldr r6, =gUnknown_02022C9C -_08028622: - lsls r0, r4, 2 - adds r0, r6 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - cmp r0, 0 - beq _0802863C - bl DestroySpriteAndFreeResources -_0802863C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _08028622 -_08028646: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028614 - - thumb_func_start sub_8028654 -sub_8028654: @ 8028654 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, =gSprites - ldr r2, =gUnknown_02022C9C - lsrs r1, 22 - adds r1, r2 - ldr r1, [r1] - ldrh r1, [r1] - lsls r2, r1, 4 - adds r2, r1 - lsls r2, 2 - adds r2, r3 - adds r2, 0x3E - movs r1, 0x1 - ands r0, r1 - lsls r0, 2 - ldrb r3, [r2] - movs r1, 0x5 - negs r1, r1 - ands r1, r3 - orrs r1, r0 - strb r1, [r2] - bx lr - .pool - thumb_func_end sub_8028654 - - thumb_func_start sub_802868C -sub_802868C: @ 802868C - push {r4-r6,lr} - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - movs r4, 0 - cmp r4, r5 - bcs _080286AE -_0802869C: - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_8028654 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _0802869C -_080286AE: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802868C - - thumb_func_start sub_80286B4 -sub_80286B4: @ 80286B4 - push {lr} - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_02022C9C - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ldrh r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - bl StartSpriteAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_80286B4 - - thumb_func_start nullsub_15 -nullsub_15: @ 80286E0 - bx lr - thumb_func_end nullsub_15 - - thumb_func_start sub_80286E4 -sub_80286E4: @ 80286E4 - push {r4-r7,lr} - movs r4, 0 - ldr r0, =gSprites - mov r12, r0 - movs r6, 0 - ldr r5, =gUnknown_02022CF4 -_080286F0: - ldr r3, [r5] - lsls r1, r4, 1 - adds r0, r3, 0 - adds r0, 0x2A - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r12 - lsls r0, r4, 4 - adds r0, 0x30 - strh r0, [r1, 0x20] - lsls r2, r4, 3 - movs r7, 0x8 - negs r7, r7 - adds r0, r7, 0 - subs r0, r2 - strh r0, [r1, 0x22] - adds r3, 0xC - adds r3, r4 - strb r6, [r3] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080286F0 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80286E4 - - thumb_func_start sub_8028734 -sub_8028734: @ 8028734 - push {r4-r6,lr} - sub sp, 0x28 - movs r4, 0xC0 - lsls r4, 1 - adds r0, r4, 0 - bl AllocZeroed - adds r6, r0, 0 - ldr r0, =gUnknown_082FB2E8 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x20] - str r1, [sp, 0x24] - ldr r0, =gDodrioBerryStatusGfx - adds r1, r6, 0 - bl LZ77UnCompWram - cmp r6, 0 - beq _080287C4 - str r6, [sp, 0x18] - add r5, sp, 0x18 - movs r0, 0x80 - lsls r0, 9 - orrs r0, r4 - str r0, [r5, 0x4] - mov r1, sp - ldr r0, =gUnknown_082FB2F0 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r4, =gUnknown_02022CF4 - movs r0, 0x40 - bl AllocZeroed - str r0, [r4] - adds r0, r5, 0 - bl LoadSpriteSheet - add r0, sp, 0x20 - bl LoadSpritePalette - movs r4, 0 -_0802878A: - lsls r1, r4, 20 - movs r0, 0xC0 - lsls r0, 14 - adds r1, r0 - asrs r1, 16 - lsls r0, r4, 3 - movs r3, 0x8 - negs r3, r3 - adds r2, r3, 0 - subs r2, r0 - lsls r2, 16 - asrs r2, 16 - mov r0, sp - movs r3, 0 - bl CreateSprite - ldr r1, =gUnknown_02022CF4 - ldr r1, [r1] - lsls r2, r4, 1 - adds r1, 0x2A - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _0802878A -_080287C4: - adds r0, r6, 0 - bl Free - add sp, 0x28 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028734 - - thumb_func_start sub_80287E4 -sub_80287E4: @ 80287E4 - push {r4,r5,lr} - movs r4, 0 -_080287E8: - ldr r5, =gUnknown_02022CF4 - ldr r0, [r5] - lsls r1, r4, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - cmp r0, 0 - beq _08028806 - bl DestroySpriteAndFreeResources -_08028806: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080287E8 - ldr r0, [r5] - bl Free - movs r0, 0 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80287E4 - - thumb_func_start sub_8028828 -sub_8028828: @ 8028828 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - movs r3, 0 - movs r6, 0 - ldr r0, =gUnknown_02022CF4 - mov r9, r0 -_0802883A: - mov r7, r9 - ldr r2, [r7] - lsls r5, r6, 1 - adds r0, r2, 0 - adds r0, 0x2A - adds r0, r5 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r4, r0, r1 - adds r0, r2, 0 - adds r0, 0x16 - adds r0, r5 - movs r1, 0x2 - strh r1, [r0] - adds r0, r2, 0 - adds r0, 0xC - adds r2, r0, r6 - ldrb r1, [r2] - cmp r1, 0 - beq _08028870 - movs r7, 0x22 - ldrsh r0, [r4, r7] - cmp r0, 0x8 - beq _080288A6 -_08028870: - movs r3, 0x1 - movs r7, 0x22 - ldrsh r0, [r4, r7] - cmp r0, 0x8 - bne _08028896 - cmp r1, 0 - bne _080288A6 - strb r3, [r2] - mov r1, r9 - ldr r0, [r1] - adds r0, 0x16 - adds r0, r5 - ldr r1, =0x0000fff0 - strh r1, [r0] - movs r0, 0x24 - str r3, [sp] - bl PlaySE - ldr r3, [sp] -_08028896: - mov r7, r9 - ldr r0, [r7] - adds r0, 0x16 - adds r0, r5 - ldrh r0, [r0] - ldrh r1, [r4, 0x22] - adds r0, r1 - strh r0, [r4, 0x22] -_080288A6: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x9 - bls _0802883A - cmp r3, 0 - bne _080288C4 - movs r0, 0x1 - b _080288C6 - .pool -_080288C4: - movs r0, 0 -_080288C6: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8028828 - - thumb_func_start sub_80288D4 -sub_80288D4: @ 80288D4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xA - bls _08028910 - movs r4, 0 -_080288E0: - ldr r0, =gUnknown_02022CF4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl StartSpriteAnim - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080288E0 - b _080289DA - .pool -_08028910: - movs r4, 0 - movs r0, 0xA - subs r0, r5 - cmp r4, r0 - bge _080289D6 - ldr r6, =gSprites -_0802891C: - cmp r5, 0x6 - bls _08028984 - ldr r0, =gUnknown_02022CF4 - ldr r2, [r0] - ldr r1, =0x0000fffa - adds r0, r1, 0 - ldrh r1, [r2, 0x3E] - adds r0, r1 - adds r0, r5 - movs r1, 0 - strh r0, [r2, 0x3E] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1E - bls _0802894C - strh r1, [r2, 0x3E] - b _0802899E - .pool -_0802894C: - cmp r0, 0xA - bls _0802896A - lsls r1, r4, 1 - adds r0, r2, 0 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x2 - bl StartSpriteAnim - b _0802899E -_0802896A: - lsls r1, r4, 1 - adds r0, r2, 0 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0 - bl StartSpriteAnim - b _0802899E -_08028984: - ldr r0, =gUnknown_02022CF4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0 - bl StartSpriteAnim -_0802899E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0xA - subs r0, r5 - cmp r4, r0 - blt _0802891C - b _080289D6 - .pool -_080289B4: - ldr r0, =gUnknown_02022CF4 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x1 - bl StartSpriteAnim - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080289D6: - cmp r4, 0x9 - bls _080289B4 -_080289DA: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80288D4 - - thumb_func_start sub_80289E8 -sub_80289E8: @ 80289E8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r7, =gSprites - movs r1, 0x1 - ands r0, r1 - lsls r4, r0, 2 - movs r6, 0x5 - negs r6, r6 - ldr r5, =gUnknown_02022CF4 -_080289FE: - ldr r0, [r5] - lsls r1, r3, 1 - adds r0, 0x2A - adds r0, r1 - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - orrs r0, r4 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x9 - bls _080289FE - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80289E8 - - thumb_func_start sub_8028A34 -sub_8028A34: @ 8028A34 - push {r4,r5,lr} - sub sp, 0x10 - movs r5, 0x90 - lsls r5, 3 - adds r0, r5, 0 - bl AllocZeroed - adds r4, r0, 0 - ldr r0, =gUnknown_082FB314 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x8] - str r1, [sp, 0xC] - ldr r0, =gDodrioBerrySpritesGfx - adds r1, r4, 0 - bl LZ77UnCompWram - cmp r4, 0 - beq _08028A6A - str r4, [sp] - movs r0, 0x80 - lsls r0, 10 - orrs r0, r5 - str r0, [sp, 0x4] - mov r0, sp - bl LoadSpriteSheet -_08028A6A: - add r0, sp, 0x8 - bl LoadSpritePalette - adds r0, r4, 0 - bl Free - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028A34 - - thumb_func_start sub_8028A88 -sub_8028A88: @ 8028A88 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x30 - mov r1, sp - ldr r0, =gUnknown_082FB324 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - add r2, sp, 0x18 - adds r1, r2, 0 - ldr r0, =gUnknown_082FB33C - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - movs r5, 0 - mov r9, r2 -_08028AB0: - movs r0, 0x4 - bl AllocZeroed - ldr r1, =gUnknown_02022CB8 - lsls r4, r5, 2 - adds r4, r1 - str r0, [r4] - lsls r0, r5, 3 - lsls r1, r5, 4 - adds r1, r0 - mov r0, sp - movs r2, 0x8 - movs r3, 0x1 - bl CreateSprite - ldr r1, [r4] - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - adds r0, r5, 0 - movs r1, 0x1 - bl sub_8028BF8 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xA - bls _08028AB0 - movs r5, 0 - ldr r7, =gUnknown_02022CE4 - ldr r4, =gUnknown_082FB31C - mov r8, r4 -_08028AF0: - movs r0, 0x4 - bl AllocZeroed - lsls r1, r5, 2 - adds r4, r1, r7 - str r0, [r4] - adds r6, r1, 0 - cmp r5, 0x3 - bne _08028B2C - mov r0, r8 - movs r2, 0x6 - ldrsh r1, [r0, r2] - mov r0, r9 - movs r2, 0x31 - movs r3, 0 - bl CreateSprite - ldr r1, [r7, 0xC] - b _08028B40 - .pool -_08028B2C: - lsls r0, r5, 1 - add r0, r8 - movs r3, 0 - ldrsh r1, [r0, r3] - mov r0, r9 - movs r2, 0x34 - movs r3, 0 - bl CreateSprite - ldr r1, [r4] -_08028B40: - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - adds r0, r6, r7 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - adds r1, r5, 0 - bl StartSpriteAnim - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08028AF0 - movs r0, 0x1 - bl sub_8028C30 - add sp, 0x30 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028A88 - - thumb_func_start sub_8028B80 -sub_8028B80: @ 8028B80 - push {r4-r6,lr} - movs r5, 0 - ldr r6, =gUnknown_02022CB8 -_08028B86: - lsls r0, r5, 2 - adds r4, r0, r6 - ldr r0, [r4] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - cmp r0, 0 - beq _08028BA0 - bl DestroySprite -_08028BA0: - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xA - bls _08028B86 - movs r5, 0 - ldr r6, =gUnknown_02022CE4 -_08028BB8: - lsls r0, r5, 2 - adds r4, r0, r6 - ldr r0, [r4] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - cmp r0, 0 - beq _08028BD2 - bl DestroySprite -_08028BD2: - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _08028BB8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028B80 - - thumb_func_start sub_8028BF8 -sub_8028BF8: @ 8028BF8 - lsls r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gSprites - ldr r2, =gUnknown_02022CB8 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ldrh r0, [r0] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r3 - adds r2, 0x3E - movs r0, 0x1 - ands r1, r0 - lsls r1, 2 - ldrb r3, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_8028BF8 - - thumb_func_start sub_8028C30 -sub_8028C30: @ 8028C30 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r7, =gSprites - ldr r6, =gUnknown_02022CE4 - movs r1, 0x1 - ands r0, r1 - lsls r4, r0, 2 - movs r5, 0x5 - negs r5, r5 -_08028C46: - lsls r0, r3, 2 - adds r0, r6 - ldr r0, [r0] - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r5, 0 - ands r0, r2 - orrs r0, r4 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x3 - bls _08028C46 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028C30 - - thumb_func_start sub_8028C7C -sub_8028C7C: @ 8028C7C - lsls r0, 24 - lsls r1, 24 - ldr r3, =gSprites - ldr r2, =gUnknown_02022CB8 - lsrs r0, 22 - adds r0, r2 - ldr r0, [r0] - ldrh r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - lsrs r1, 21 - strh r1, [r0, 0x22] - bx lr - .pool - thumb_func_end sub_8028C7C - - thumb_func_start sub_8028CA4 -sub_8028CA4: @ 8028CA4 - push {lr} - lsls r0, 16 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_02022CB8 - lsrs r0, 14 - adds r0, r2 - ldr r0, [r0] - ldrh r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - ldr r2, =gSprites - adds r0, r2 - bl StartSpriteAnim - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028CA4 - - thumb_func_start sub_8028CD0 -sub_8028CD0: @ 8028CD0 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSprites - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, 0x32 - strh r1, [r2, 0x20] - movs r0, 0x32 - strh r0, [r2, 0x22] - bx lr - .pool - thumb_func_end sub_8028CD0 - - thumb_func_start sub_8028CF4 -sub_8028CF4: @ 8028CF4 - push {r4-r7,lr} - adds r4, r0, 0 - adds r0, 0x42 - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0x1 - beq _08028D36 - movs r3, 0 - ldr r7, =gUnknown_082FB354 - ldr r6, =gUnknown_02022CB0 - movs r5, 0 -_08028D0A: - lsls r0, r3, 2 - adds r2, r0, r6 - ldr r1, [r2] - ldrh r0, [r1, 0x2] - adds r0, 0x1 - strh r0, [r1, 0x2] - adds r1, r3, r7 - lsls r0, 16 - lsrs r0, 16 - ldrb r1, [r1] - cmp r0, r1 - bls _08028D2C - ldrh r0, [r4, 0x20] - subs r0, 0x1 - strh r0, [r4, 0x20] - ldr r0, [r2] - strh r5, [r0, 0x2] -_08028D2C: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _08028D0A -_08028D36: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028CF4 - - thumb_func_start sub_8028D44 -sub_8028D44: @ 8028D44 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x28 - movs r4, 0x80 - lsls r4, 3 - adds r0, r4, 0 - bl AllocZeroed - adds r6, r0, 0 - ldr r0, =gUnknown_082FB360 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp, 0x20] - str r1, [sp, 0x24] - ldr r0, =gDodrioBerryPlatformGfx - adds r1, r6, 0 - bl LZ77UnCompWram - cmp r6, 0 - beq _08028DD2 - str r6, [sp, 0x18] - add r0, sp, 0x18 - movs r1, 0xA0 - lsls r1, 11 - orrs r1, r4 - str r1, [r0, 0x4] - mov r2, sp - ldr r1, =gUnknown_082FB368 - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - ldm r1!, {r3-r5} - stm r2!, {r3-r5} - bl LoadSpriteSheet - add r0, sp, 0x20 - bl LoadSpritePalette - movs r5, 0 - ldr r7, =gUnknown_082FB356 - adds r0, r7, 0x2 - mov r9, r0 - ldr r1, =gUnknown_02022CB0 - mov r8, r1 -_08028D9E: - movs r0, 0x4 - bl AllocZeroed - lsls r2, r5, 2 - mov r3, r8 - adds r4, r2, r3 - str r0, [r4] - adds r0, r2, r7 - movs r3, 0 - ldrsh r1, [r0, r3] - add r2, r9 - movs r0, 0 - ldrsh r2, [r2, r0] - mov r0, sp - movs r3, 0x4 - bl CreateSprite - ldr r1, [r4] - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _08028D9E -_08028DD2: - adds r0, r6, 0 - bl Free - add sp, 0x28 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028D44 - - thumb_func_start sub_8028DFC -sub_8028DFC: @ 8028DFC - push {r4-r7,lr} - movs r3, 0 - ldr r0, =gUnknown_02022CB0 - mov r12, r0 - ldr r4, =gUnknown_082FB356 - adds r7, r4, 0x2 - ldr r6, =gSprites - movs r5, 0x1 -_08028E0C: - lsls r2, r3, 2 - mov r1, r12 - adds r0, r2, r1 - ldr r0, [r0] - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - adds r0, r1, 0 - adds r0, 0x42 - strh r5, [r0] - adds r0, r2, r4 - ldrh r0, [r0] - strh r0, [r1, 0x20] - adds r2, r7 - ldrh r0, [r2] - strh r0, [r1, 0x22] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _08028E0C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028DFC - - thumb_func_start sub_8028E4C -sub_8028E4C: @ 8028E4C - push {r4,r5,lr} - movs r2, 0 - ldr r5, =gUnknown_02022CB0 - ldr r4, =gSprites - movs r3, 0 -_08028E56: - lsls r0, r2, 2 - adds r0, r5 - ldr r0, [r0] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x42 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x1 - bls _08028E56 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028E4C - - thumb_func_start sub_8028E84 -sub_8028E84: @ 8028E84 - push {r4-r6,lr} - movs r5, 0 - ldr r6, =gUnknown_02022CB0 -_08028E8A: - lsls r0, r5, 2 - adds r4, r0, r6 - ldr r0, [r4] - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - cmp r0, 0 - beq _08028EA4 - bl DestroySprite -_08028EA4: - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _08028E8A - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028E84 - - thumb_func_start sub_8028EC8 -sub_8028EC8: @ 8028EC8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r7, =gSprites - ldr r6, =gUnknown_02022CB0 - movs r1, 0x1 - ands r0, r1 - lsls r4, r0, 2 - movs r5, 0x5 - negs r5, r5 -_08028EDE: - lsls r0, r3, 2 - adds r0, r6 - ldr r0, [r0] - ldrh r0, [r0] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r5, 0 - ands r0, r2 - orrs r0, r4 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x1 - bls _08028EDE - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8028EC8 - - thumb_func_start sub_8028F14 -sub_8028F14: @ 8028F14 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r1, 24 - movs r3, 0 - subs r0, r1, 0x1 - cmp r0, 0x4 - bhi _08028FC6 - lsls r0, 2 - ldr r1, =_08028F34 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08028F34: - .4byte _08028FB4 - .4byte _08028F48 - .4byte _08028F52 - .4byte _08028F66 - .4byte _08028F8E -_08028F48: - cmp r2, 0 - beq _08028F7E - cmp r2, 0x1 - bne _08028FC6 - b _08028F82 -_08028F52: - cmp r2, 0x1 - beq _08028FB8 - cmp r2, 0x1 - bgt _08028F60 - cmp r2, 0 - beq _08028FB4 - b _08028FC6 -_08028F60: - cmp r2, 0x2 - bne _08028FC6 - b _08028FC4 -_08028F66: - cmp r2, 0x1 - beq _08028F82 - cmp r2, 0x1 - bgt _08028F74 - cmp r2, 0 - beq _08028F7E - b _08028FC6 -_08028F74: - cmp r2, 0x2 - beq _08028F86 - cmp r2, 0x3 - beq _08028F8A - b _08028FC6 -_08028F7E: - movs r3, 0xC - b _08028FC6 -_08028F82: - movs r3, 0x12 - b _08028FC6 -_08028F86: - movs r3, 0x18 - b _08028FC6 -_08028F8A: - movs r3, 0x6 - b _08028FC6 -_08028F8E: - cmp r2, 0x4 - bhi _08028FC6 - lsls r0, r2, 2 - ldr r1, =_08028FA0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08028FA0: - .4byte _08028FB4 - .4byte _08028FB8 - .4byte _08028FBC - .4byte _08028FC0 - .4byte _08028FC4 -_08028FB4: - movs r3, 0xF - b _08028FC6 -_08028FB8: - movs r3, 0x15 - b _08028FC6 -_08028FBC: - movs r3, 0x1B - b _08028FC6 -_08028FC0: - movs r3, 0x3 - b _08028FC6 -_08028FC4: - movs r3, 0x9 -_08028FC6: - lsls r0, r3, 3 - pop {r1} - bx r1 - thumb_func_end sub_8028F14 - - thumb_func_start sub_8028FCC -sub_8028FCC: @ 8028FCC - push {r4,lr} - movs r4, 0 -_08028FD0: - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8028BF8 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8028C7C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xA - bls _08028FD0 - movs r0, 0 - bl sub_80289E8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8028FCC - - thumb_func_start sub_8028FF8 -sub_8028FF8: @ 8028FF8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl GetWindowFrameTilesPal - ldr r1, [r0] - movs r2, 0x90 - lsls r2, 1 - movs r0, 0 - movs r3, 0x1 - bl LoadBgTiles - adds r0, r4, 0 - bl GetWindowFrameTilesPal - ldr r0, [r0, 0x4] - movs r1, 0xA0 - movs r2, 0x20 - bl LoadPalette - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8028FF8 - - thumb_func_start sub_802902C -sub_802902C: @ 802902C - push {lr} - movs r0, 0 - movs r1, 0xA - movs r2, 0xB0 - bl LoadUserWindowBorderGfx_ - pop {r0} - bx r0 - thumb_func_end sub_802902C - - thumb_func_start sub_802903C -sub_802903C: @ 802903C - ldr r3, =gUnknown_02022CF8 - ldr r0, [r3] - movs r2, 0xC0 - lsls r2, 6 - adds r1, r0, r2 - movs r2, 0 - str r2, [r1] - ldr r1, =0x00003014 - adds r0, r1 - strb r2, [r0] - ldr r0, [r3] - adds r1, 0x4 - adds r0, r1 - strb r2, [r0] - ldr r0, [r3] - adds r1, 0x8 - adds r0, r1 - strb r2, [r0] - ldr r0, [r3] - adds r1, 0x4 - adds r0, r1 - strb r2, [r0] - bx lr - .pool - thumb_func_end sub_802903C - - thumb_func_start sub_8029074 -sub_8029074: @ 8029074 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r6, 0xA - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4, 0x3] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x2 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x3 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - str r5, [sp] - ldrb r0, [r4, 0x4] - str r0, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x4 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - str r5, [sp] - ldrb r0, [r4, 0x4] - str r0, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x6 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x4] - ldrb r0, [r4, 0x2] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x7 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - ldrb r3, [r4, 0x4] - ldrb r0, [r4, 0x2] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4, 0x3] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x8 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x4] - ldrb r4, [r4, 0x2] - adds r3, r4 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x9 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8029074 - - thumb_func_start sub_8029174 -sub_8029174: @ 8029174 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r6, 0xB - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r5, 0x1 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xA - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4, 0x3] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xB - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - subs r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xC - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - str r5, [sp] - ldrb r0, [r4, 0x4] - str r0, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xD - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x2] - str r5, [sp] - ldrb r0, [r4, 0x4] - str r0, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0xF - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - subs r2, 0x1 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x4] - ldrb r0, [r4, 0x2] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x10 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x1] - ldrb r3, [r4, 0x4] - ldrb r0, [r4, 0x2] - adds r3, r0 - lsls r3, 24 - lsrs r3, 24 - ldrb r0, [r4, 0x3] - str r0, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x11 - bl FillBgTilemapBufferRect - ldrb r2, [r4, 0x3] - ldrb r0, [r4, 0x1] - adds r2, r0 - lsls r2, 24 - lsrs r2, 24 - ldrb r3, [r4, 0x4] - ldrb r4, [r4, 0x2] - adds r3, r4 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - str r5, [sp, 0x4] - str r6, [sp, 0x8] - movs r0, 0 - movs r1, 0x12 - bl FillBgTilemapBufferRect - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8029174 - - thumb_func_start sub_8029274 -sub_8029274: @ 8029274 - push {r4,lr} - ldr r4, =gUnknown_02022CF8 - str r0, [r4] - movs r2, 0xC0 - lsls r2, 6 - adds r1, r0, r2 - movs r2, 0 - str r2, [r1] - ldr r3, =0x00003014 - adds r1, r0, r3 - strb r2, [r1] - ldr r1, =0x00003018 - adds r0, r1 - strb r2, [r0] - ldr r0, [r4] - adds r3, 0xC - adds r0, r3 - strb r2, [r0] - ldr r0, [r4] - adds r1, 0xC - adds r0, r1 - strb r2, [r0] - ldr r0, =sub_8029314 - movs r1, 0x3 - bl CreateTask - ldr r1, [r4] - ldr r2, =0x00003004 - adds r1, r2 - strb r0, [r1] - ldr r0, =sub_8029338 - bl sub_802A72C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8029274 - - thumb_func_start sub_80292D4 -sub_80292D4: @ 80292D4 - push {lr} - bl FreeAllWindowBuffers - pop {r0} - bx r0 - thumb_func_end sub_80292D4 - - thumb_func_start sub_80292E0 -sub_80292E0: @ 80292E0 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0 - ldr r5, =gUnknown_082FB40C - adds r7, r5, 0x4 -_080292EC: - lsls r1, r4, 3 - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, r6 - bne _080292FE - adds r0, r1, r7 - ldr r0, [r0] - bl sub_802A72C -_080292FE: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _080292EC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80292E0 - - thumb_func_start sub_8029314 -sub_8029314: @ 8029314 - push {lr} - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - bne _0802932E - bl sub_802A75C - bl _call_via_r0 -_0802932E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8029314 - - thumb_func_start sub_8029338 -sub_8029338: @ 8029338 - push {lr} - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r2, =0x00003014 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x4 - bhi _08029430 - lsls r0, 2 - ldr r1, =_08029360 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08029360: - .4byte _08029374 - .4byte _0802937A - .4byte _08029394 - .4byte _080293D8 - .4byte _08029404 -_08029374: - bl sub_802A7A8 - b _08029414 -_0802937A: - bl sub_802A8E8 - cmp r0, 0x1 - bne _0802943A - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r2, =0x00003014 - adds r1, r2 - b _0802941C - .pool -_08029394: - ldr r1, =gDodrioBerryBgTilemap1 - movs r0, 0x3 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gDodrioBerryBgTilemap2Left - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r1, =gDodrioBerryBgTilemap2Right - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _08029414 - .pool -_080293D8: - movs r0, 0 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r2, =0x00003014 - adds r1, r2 - b _0802941C - .pool -_08029404: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x14] - lsrs r0, 3 - bl sub_8028FF8 - bl sub_802902C -_08029414: - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 -_0802941C: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802943A - .pool -_08029430: - movs r2, 0xC0 - lsls r2, 6 - adds r1, r2 - movs r0, 0x1 - str r0, [r1] -_0802943A: - pop {r0} - bx r0 - thumb_func_end sub_8029338 - - thumb_func_start sub_8029440 -sub_8029440: @ 8029440 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x1C - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r2, =0x00003014 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0 - beq _08029488 - cmp r0, 0x1 - bne _08029460 - b _080295EC -_08029460: - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xB4 - bhi _0802946E - b _0802968E -_0802946E: - bl sub_8027650 - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0 - cmp r6, r7 - bcc _0802947E - b _08029666 -_0802947E: - b _08029640 - .pool -_08029488: - bl sub_8027650 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gUnknown_082FB3C8 - subs r0, r7, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r5, [r0] - ldr r2, =0xffffff00 - ldr r0, [sp, 0xC] - ands r0, r2 - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0xE0 - lsls r1, 19 - orrs r0, r1 - str r0, [sp, 0xC] - ldr r0, [sp, 0x10] - ands r0, r2 - movs r1, 0x2 - orrs r0, r1 - ldr r1, =0xffff00ff - ands r0, r1 - movs r1, 0xD0 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0x98 - lsls r1, 13 - orrs r0, r1 - str r0, [sp, 0x10] - movs r6, 0 - cmp r6, r7 - bcs _080295B8 - mov r3, sp - adds r3, 0xC - str r3, [sp, 0x18] - mov r10, r4 - ldr r0, =0x00003008 - mov r9, r0 -_080294DC: - movs r1, 0 - mov r8, r1 - adds r0, r6, 0 - bl sub_8027A48 - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - bl sub_8027660 - adds r1, r0, 0 - movs r0, 0x1 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - movs r1, 0x38 - subs r1, r0 - lsrs r1, 1 - str r1, [sp, 0x14] - ldrb r0, [r5] - lsls r0, 8 - ldr r2, =0xffff00ff - ldr r1, [sp, 0xC] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0xC] - ldrb r2, [r5, 0x1] - lsls r2, 16 - ldr r0, =0xff00ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp, 0xC] - add r0, sp, 0xC - bl AddWindow - mov r2, r10 - ldr r1, [r2] - add r1, r9 - adds r1, r6 - strb r0, [r1] - ldr r0, [r2] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - bl ClearWindowTilemap - mov r3, r10 - ldr r0, [r3] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - bl GetMultiplayerId - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _0802955A - movs r0, 0x2 - mov r8, r0 -_0802955A: - adds r0, r4, 0 - bl sub_8027660 - adds r4, r0, 0 - mov r1, r10 - ldr r0, [r1] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - ldr r3, [sp, 0x14] - lsls r2, r3, 24 - lsrs r2, 24 - mov r3, r8 - lsls r1, r3, 1 - add r1, r8 - ldr r3, =gUnknown_082FB380 - adds r1, r3 - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParameterized3 - mov r2, r10 - ldr r0, [r2] - add r0, r9 - adds r0, r6 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r3, [sp, 0x18] - ldrh r0, [r3, 0x6] - adds r0, 0xE - strh r0, [r3, 0x6] - add r0, sp, 0xC - bl sub_8029174 - adds r5, 0x4 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r7 - bcc _080294DC -_080295B8: - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 - b _0802962A - .pool -_080295EC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802968E - bl sub_8027650 - lsls r0, 24 - lsrs r7, r0, 24 - movs r6, 0 - cmp r6, r7 - bcs _0802961C -_08029604: - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - adds r0, r6 - ldrb r0, [r0] - bl PutWindowTilemap - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r7 - bcc _08029604 -_0802961C: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r2, =0x00003014 - adds r1, r2 -_0802962A: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802968E - .pool -_08029640: - ldr r5, =gUnknown_02022CF8 - ldr r0, [r5] - ldr r4, =0x00003008 - adds r0, r4 - adds r0, r6 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r5] - adds r0, r4 - adds r0, r6 - ldrb r0, [r0] - bl RemoveWindow - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, r7 - bcc _08029640 -_08029666: - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - movs r3, 0xC0 - lsls r3, 6 - adds r0, r3 - movs r1, 0x1 - str r1, [r0] -_0802968E: - add sp, 0x1C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8029440 - - thumb_func_start sub_80296A8 -sub_80296A8: @ 80296A8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x6C - lsls r0, 24 - movs r1, 0 - mov r8, r1 - movs r6, 0 - lsrs r7, r0, 24 - add r4, sp, 0x2C - ldr r1, =gUnknown_082FB45C - adds r0, r4, 0 - movs r2, 0x5 - bl memcpy - movs r5, 0 - cmp r5, r7 - bcs _080296F8 - add r4, sp, 0x34 -_080296D2: - mov r0, sp - adds r0, r5 - adds r0, 0x2C - strb r5, [r0] - add r0, sp, 0x5C - adds r1, r5, 0 - bl sub_802793C - lsls r2, r5, 3 - adds r2, r4, r2 - ldr r0, [sp, 0x5C] - ldr r1, [sp, 0x60] - str r0, [r2] - str r1, [r2, 0x4] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _080296D2 -_080296F8: - bl sub_8027748 - cmp r0, 0 - beq _0802972E -_08029700: - movs r5, 0 - cmp r5, r7 - bcs _08029728 - add r2, sp, 0x34 - add r1, sp, 0x2C -_0802970A: - lsls r0, r5, 3 - adds r0, r2, r0 - ldrb r0, [r0] - cmp r0, r8 - bne _0802971E - adds r0, r1, r6 - strb r5, [r0] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 -_0802971E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _0802970A -_08029728: - mov r8, r6 - cmp r6, r7 - bcc _08029700 -_0802972E: - movs r5, 0 - ldr r4, =gText_SpacePoints - cmp r5, r7 - bcs _08029754 - add r1, sp, 0x34 - add r6, sp, 0x38 - subs r3, r7, 0x1 -_0802973C: - lsls r2, r5, 3 - adds r0, r6, r2 - ldr r0, [r0] - cmp r0, 0 - bne _0802974A - adds r0, r1, r2 - strb r3, [r0] -_0802974A: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _0802973C -_08029754: - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - movs r1, 0xD8 - subs r1, r0 - str r1, [sp, 0x64] - movs r5, 0 - cmp r5, r7 - bcs _08029860 - mov r2, sp - adds r2, 0x34 - str r2, [sp, 0x68] - ldr r3, =0x00003009 - mov r10, r3 -_08029774: - movs r0, 0 - mov r8, r0 - mov r0, sp - adds r0, r5 - adds r0, 0x2C - ldrb r0, [r0] - adds r4, r0, 0 - lsls r1, r4, 3 - add r0, sp, 0x38 - adds r0, r1 - ldr r0, [r0] - mov r9, r0 - ldr r2, =gUnknown_02022CF8 - ldr r0, [r2] - add r0, r10 - ldrb r0, [r0] - ldr r2, =gUnknown_082FB3DC - ldr r3, [sp, 0x68] - adds r1, r3, r1 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r2, [r1] - ldr r3, =gUnknown_082FB402 - lsls r1, r5, 1 - adds r1, r3 - ldrb r6, [r1] - str r6, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - mov r3, r8 - str r3, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl AddTextPrinterParameterized - bl GetMultiplayerId - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bne _080297CC - movs r0, 0x2 - mov r8, r0 -_080297CC: - adds r0, r4, 0 - bl sub_8027660 - adds r3, r0, 0 - ldr r1, =gUnknown_02022CF8 - ldr r0, [r1] - add r0, r10 - ldrb r0, [r0] - mov r2, r8 - lsls r1, r2, 1 - add r1, r8 - ldr r2, =gUnknown_082FB380 - adds r1, r2 - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - str r3, [sp, 0x8] - movs r1, 0x1 - movs r2, 0x1C - adds r3, r6, 0 - bl AddTextPrinterParameterized3 - add r0, sp, 0xC - mov r1, r9 - movs r2, 0 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - adds r3, r0, 0 - ldr r2, =gUnknown_02022CF8 - ldr r0, [r2] - add r0, r10 - ldrb r0, [r0] - ldr r1, [sp, 0x64] - subs r3, r1, r3 - lsls r3, 24 - lsrs r3, 24 - str r6, [sp] - movs r2, 0xFF - str r2, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - bl AddTextPrinterParameterized - ldr r2, =gUnknown_02022CF8 - ldr r0, [r2] - add r0, r10 - ldrb r0, [r0] - ldr r1, [sp, 0x64] - lsls r3, r1, 24 - str r6, [sp] - movs r2, 0xFF - str r2, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - ldr r2, =gText_SpacePoints - lsrs r3, 24 - bl AddTextPrinterParameterized - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, r7 - bcc _08029774 -_08029860: - add sp, 0x6C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80296A8 - - thumb_func_start sub_802988C -sub_802988C: @ 802988C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - bl sub_8027650 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0xC] - ldr r6, =gUnknown_02022CF8 - ldr r1, [r6] - ldr r2, =0x00003014 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0xB - bls _080298B2 - b _08029FA8 -_080298B2: - lsls r0, 2 - ldr r1, =_080298C8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080298C8: - .4byte _080298F8 - .4byte _08029914 - .4byte _0802996C - .4byte _08029B6C - .4byte _08029BB8 - .4byte _08029BFC - .4byte _08029C60 - .4byte _08029C9C - .4byte _08029CE0 - .4byte _08029DA0 - .4byte _08029F08 - .4byte _08029F5C -_080298F8: - bl sub_802784C - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r0, =0x0000301c - adds r2, r1, r0 - movs r0, 0 - strh r0, [r2] - b _08029F8A - .pool -_08029914: - ldr r6, =gUnknown_082F7BBC - adds r0, r6, 0 - bl AddWindow - ldr r4, =gUnknown_02022CF8 - ldr r1, [r4] - ldr r2, =0x00003008 - mov r8, r2 - add r1, r8 - strb r0, [r1] - movs r0, 0x8 - adds r0, r6 - mov r9, r0 - bl AddWindow - ldr r1, [r4] - ldr r5, =0x00003009 - adds r1, r5 - strb r0, [r1] - ldr r0, [r4] - add r0, r8 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r4] - adds r0, r5 - ldrb r0, [r0] - bl ClearWindowTilemap - adds r0, r6, 0 - bl sub_8029174 - mov r0, r9 - bl sub_8029174 - b _08029F88 - .pool -_0802996C: - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r5, =0x00003008 - adds r0, r5 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r4] - ldr r1, =0x00003009 - mov r9, r1 - add r0, r9 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r2, =gText_BerryPickingResults - mov r8, r2 - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - mov r1, r8 - bl GetStringWidth - adds r1, r0, 0 - movs r0, 0xE0 - subs r0, r1 - lsrs r3, r0, 1 - ldr r0, [r4] - adds r0, r5 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r6, 0xFF - str r6, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - mov r2, r8 - bl AddTextPrinterParameterized - ldr r0, [r4] - add r0, r9 - ldrb r0, [r0] - ldr r2, =gText_10P30P50P50P - movs r1, 0x11 - str r1, [sp] - str r6, [sp, 0x4] - str r5, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x44 - bl AddTextPrinterParameterized - mov r9, r5 - ldr r0, [sp, 0xC] - cmp r9, r0 - bcc _080299E2 - b _08029B2A -_080299E2: - movs r4, 0 - bl GetMultiplayerId - lsls r0, 24 - lsrs r0, 24 - cmp r9, r0 - bne _080299F2 - movs r4, 0x2 -_080299F2: - mov r0, r9 - bl sub_8027660 - adds r6, r0, 0 - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - ldr r1, =0x00003009 - adds r0, r1 - ldrb r0, [r0] - mov r2, r9 - lsls r5, r2, 1 - ldr r2, =gUnknown_082FB3F8 - adds r1, r5, r2 - ldrb r3, [r1] - lsls r1, r4, 1 - adds r1, r4 - ldr r2, =gUnknown_082FB380 - adds r1, r2 - str r1, [sp] - movs r4, 0x1 - negs r4, r4 - str r4, [sp, 0x4] - str r6, [sp, 0x8] - movs r1, 0x1 - movs r2, 0 - bl AddTextPrinterParameterized3 - movs r7, 0 - mov r8, r5 - mov r0, r9 - adds r0, 0x1 - str r0, [sp, 0x10] - ldr r1, =gStringVar4 - mov r10, r1 -_08029A36: - mov r0, r9 - adds r1, r7, 0 - bl sub_80276A0 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000270f - bl sub_8027A38 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r7, 0 - bl sub_802778C - ldr r1, =0x0000270f - bl sub_8027A38 - lsls r0, 16 - lsrs r6, r0, 16 - mov r0, r10 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - mov r1, r10 - movs r2, 0x1 - negs r2, r2 - bl GetStringWidth - adds r5, r0, 0 - cmp r6, r4 - bne _08029AE0 - cmp r6, 0 - beq _08029AE0 - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - lsls r1, r7, 1 - ldr r2, =gUnknown_082FB3F0 - adds r1, r2 - ldrb r2, [r1] - subs r2, r5 - lsls r2, 24 - lsrs r2, 24 - ldr r1, =gUnknown_082FB3F8 - add r1, r8 - ldrb r3, [r1] - ldr r1, =gUnknown_082FB383 - str r1, [sp] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0x4] - mov r1, r10 - str r1, [sp, 0x8] - movs r1, 0x1 - bl AddTextPrinterParameterized3 - b _08029B10 - .pool -_08029AE0: - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - lsls r1, r7, 1 - ldr r2, =gUnknown_082FB3F0 - adds r1, r2 - ldrb r3, [r1] - subs r3, r5 - lsls r3, 24 - lsrs r3, 24 - ldr r1, =gUnknown_082FB3F8 - add r1, r8 - ldrb r1, [r1] - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - ldr r2, =gStringVar4 - bl AddTextPrinterParameterized -_08029B10: - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _08029A36 - ldr r1, [sp, 0x10] - lsls r0, r1, 24 - lsrs r0, 24 - mov r9, r0 - ldr r2, [sp, 0xC] - cmp r9, r2 - bcs _08029B2A - b _080299E2 -_08029B2A: - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r4] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029B6C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08029B90 - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - bl PutWindowTilemap -_08029B90: - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0 - bl sub_8028C30 - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029BB8: - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x0000301c - adds r2, r0, r1 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bhi _08029BD0 - b _08029FF8 -_08029BD0: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08029BDE - b _08029FF8 -_08029BDE: - movs r0, 0 - strh r0, [r2] - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl sub_8028C30 - b _08029F88 - .pool -_08029BFC: - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r5, =0x00003008 - adds r0, r5 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r4] - ldr r1, =0x00003009 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r6, =gText_AnnouncingRankings - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - adds r1, r6, 0 - bl GetStringWidth - adds r1, r0, 0 - movs r0, 0xE0 - subs r0, r1 - lsrs r3, r0, 1 - ldr r0, [r4] - adds r0, r5 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r1, 0x1 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r6, 0 - bl AddTextPrinterParameterized - b _08029F88 - .pool -_08029C60: - ldr r0, [sp, 0xC] - bl sub_80296A8 - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r4] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029C9C: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08029CC0 - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - bl PutWindowTilemap -_08029CC0: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029CE0: - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x0000301c - adds r2, r0, r1 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bhi _08029CF8 - b _08029FF8 -_08029CF8: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08029D06 - b _08029FF8 -_08029D06: - movs r0, 0 - strh r0, [r2] - movs r0, 0x5 - bl PlaySE - bl sub_8027748 - ldr r1, =0x00000bb7 - cmp r0, r1 - bhi _08029D3C - ldr r0, [r4] - ldr r2, =0x00003014 - adds r0, r2 - movs r1, 0x7F - strb r1, [r0] - b _08029D4C - .pool -_08029D3C: - bl StopMapMusic - ldr r1, [r4] - ldr r0, =0x00003014 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_08029D4C: - movs r0, 0x1E - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x5 - bl FillBgTilemapBufferRect_Palette0 - ldr r5, =gUnknown_02022CF8 - ldr r0, [r5] - ldr r4, =0x00003009 - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - ldr r6, =gUnknown_082F7BCC - adds r0, r6, 0 - bl AddWindow - ldr r1, [r5] - adds r1, r4 - strb r0, [r1] - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - adds r0, r6, 0 - bl sub_8029174 - b _08029FF8 - .pool -_08029DA0: - ldr r0, =0x0000016f - bl PlayNewMapMusic - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r6, =0x00003008 - adds r0, r6 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r4] - ldr r1, =0x00003009 - mov r10, r1 - add r0, r10 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =gText_AnnouncingPrizes - movs r2, 0x1 - negs r2, r2 - movs r0, 0x1 - adds r1, r5, 0 - bl GetStringWidth - adds r1, r0, 0 - movs r0, 0xE0 - subs r0, r1 - lsrs r3, r0, 1 - ldr r0, [r4] - adds r0, r6 - ldrb r0, [r0] - lsls r3, 24 - lsrs r3, 24 - movs r2, 0x1 - mov r9, r2 - str r2, [sp] - movs r1, 0xFF - mov r8, r1 - str r1, [sp, 0x4] - movs r6, 0 - str r6, [sp, 0x8] - movs r1, 0x1 - adds r2, r5, 0 - bl AddTextPrinterParameterized - bl DynamicPlaceholderTextUtil_Reset - bl sub_802762C - lsls r0, 16 - lsrs r0, 16 - ldr r5, =gStringVar1 - adds r1, r5, 0 - bl CopyItemName - movs r0, 0 - adds r1, r5, 0 - bl DynamicPlaceholderTextUtil_SetPlaceholderPtr - ldr r7, =gStringVar4 - ldr r1, =gText_FirstPlacePrize - adds r0, r7, 0 - bl DynamicPlaceholderTextUtil_ExpandPlaceholders - ldr r0, [r4] - add r0, r10 - ldrb r0, [r0] - mov r2, r9 - str r2, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r6, [sp, 0x8] - movs r1, 0x1 - adds r2, r7, 0 - movs r3, 0 - bl AddTextPrinterParameterized - bl sub_80279C8 - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - cmp r4, 0 - beq _08029EC8 - cmp r4, 0x3 - beq _08029EC8 - bl DynamicPlaceholderTextUtil_Reset - bl sub_802762C - lsls r0, 16 - lsrs r0, 16 - adds r1, r5, 0 - bl CopyItemName - movs r0, 0 - adds r1, r5, 0 - bl DynamicPlaceholderTextUtil_SetPlaceholderPtr - cmp r4, 0x2 - bne _08029E9C - ldr r1, =gText_CantHoldAnyMore - adds r0, r7, 0 - bl DynamicPlaceholderTextUtil_ExpandPlaceholders - b _08029EA8 - .pool -_08029E9C: - cmp r6, 0x1 - bne _08029EA8 - ldr r1, =gText_FilledStorageSpace - adds r0, r7, 0 - bl DynamicPlaceholderTextUtil_ExpandPlaceholders -_08029EA8: - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - ldr r2, =gStringVar4 - movs r1, 0x29 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized -_08029EC8: - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r4] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029F08: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _08029F2C - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r4] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - bl PutWindowTilemap -_08029F2C: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =0x0000020b - movs r1, 0x14 - movs r2, 0xA - bl FadeOutAndFadeInNewMapMusic - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r0, =0x00003014 - adds r1, r0 - b _08029F8E - .pool -_08029F5C: - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x0000301c - adds r2, r0, r1 - ldrh r0, [r2] - adds r0, 0x1 - strh r0, [r2] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x1D - bls _08029FF8 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08029FF8 - movs r0, 0 - strh r0, [r2] - movs r0, 0x5 - bl PlaySE -_08029F88: - ldr r1, [r4] -_08029F8A: - ldr r2, =0x00003014 - adds r1, r2 -_08029F8E: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08029FF8 - .pool -_08029FA8: - ldr r5, =0x00003008 - adds r0, r1, r5 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r6] - ldr r4, =0x00003009 - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0] - bl RemoveWindow - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, [r6] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] -_08029FF8: - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802988C - - thumb_func_start sub_802A010 -sub_802A010: @ 802A010 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r1, =gUnknown_02022CF8 - ldr r2, [r1] - ldr r3, =0x00003014 - adds r0, r2, r3 - ldrb r6, [r0] - adds r7, r1, 0 - cmp r6, 0x1 - beq _0802A0CC - cmp r6, 0x1 - bgt _0802A040 - cmp r6, 0 - beq _0802A04E - b _0802A2FC - .pool -_0802A040: - cmp r6, 0x2 - bne _0802A046 - b _0802A194 -_0802A046: - cmp r6, 0x3 - bne _0802A04C - b _0802A1D0 -_0802A04C: - b _0802A2FC -_0802A04E: - ldr r0, =gUnknown_082F7BD4 - mov r9, r0 - bl AddWindow - ldr r1, [r7] - ldr r4, =0x00003008 - adds r1, r4 - strb r0, [r1] - movs r1, 0x8 - add r1, r9 - mov r8, r1 - mov r0, r8 - bl AddWindow - ldr r1, [r7] - ldr r2, =0x00003009 - adds r1, r2 - strb r0, [r1] - ldr r0, [r7] - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r7] - ldr r3, =0x00003009 - adds r0, r3 - ldrb r0, [r0] - bl ClearWindowTilemap - mov r0, r9 - bl sub_8029174 - mov r0, r8 - bl sub_8029074 - ldr r1, [r7] - ldr r0, =0x00003014 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r7] - ldr r1, =0x00003020 - adds r0, r1 - strb r6, [r0] - ldr r0, [r7] - ldr r2, =0x00003024 - adds r0, r2 - strb r6, [r0] - b _0802A35E - .pool -_0802A0CC: - ldr r3, =0x00003008 - mov r8, r3 - adds r0, r2, r3 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r7] - ldr r1, =0x00003009 - mov r10, r1 - add r0, r10 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - ldr r2, =gText_WantToPlayAgain - movs r1, 0x5 - str r1, [sp] - movs r3, 0xFF - mov r9, r3 - str r3, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - ldr r0, [r7] - add r0, r10 - ldrb r0, [r0] - ldr r2, =gText_Yes - str r6, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl AddTextPrinterParameterized - ldr r0, [r7] - add r0, r10 - ldrb r0, [r0] - ldr r2, =gText_No - movs r1, 0x11 - str r1, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl AddTextPrinterParameterized - ldr r0, [r7] - add r0, r10 - ldrb r0, [r0] - ldr r2, =gText_SelectorArrow2 - str r6, [sp] - mov r3, r9 - str r3, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r0, [r7] - add r0, r10 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r7] - ldr r2, =0x00003014 - adds r1, r2 - b _0802A2EA - .pool -_0802A194: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802A1B6 - ldr r0, [r7] - ldr r3, =0x00003008 - adds r0, r3 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r0, [r7] - ldr r1, =0x00003009 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap -_0802A1B6: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r1, [r7] - ldr r2, =0x00003014 - adds r1, r2 - b _0802A2EA - .pool -_0802A1D0: - ldr r3, =0x00003020 - adds r0, r2, r3 - ldrb r5, [r0] - cmp r5, 0 - bne _0802A1DC - movs r5, 0x1 -_0802A1DC: - ldr r0, =0x00003009 - mov r8, r0 - adds r0, r2, r0 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - ldr r2, =gText_Yes - movs r1, 0x1 - str r1, [sp] - movs r3, 0xFF - mov r10, r3 - str r3, [sp, 0x4] - movs r1, 0 - mov r9, r1 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl AddTextPrinterParameterized - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - ldr r2, =gText_No - movs r1, 0x11 - str r1, [sp] - mov r3, r10 - str r3, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x8 - bl AddTextPrinterParameterized - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - ldr r2, =gText_SelectorArrow2 - subs r1, r5, 0x1 - lsls r1, 4 - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - mov r3, r10 - str r3, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - ldr r0, [r7] - add r0, r8 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r5, 0x1 - movs r2, 0x1 - ands r2, r1 - cmp r2, 0 - beq _0802A294 - movs r0, 0x5 - bl PlaySE - ldr r0, [r7] - ldr r3, =0x00003020 - adds r1, r0, r3 - ldrb r0, [r1] - cmp r0, 0 - bne _0802A2E4 - strb r5, [r1] - b _0802A2E4 - .pool -_0802A294: - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _0802A2CC - movs r0, 0x5 - bl PlaySE - ldr r0, [r7] - ldr r2, =0x00003020 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x1 - beq _0802A2C2 - cmp r0, 0x1 - bgt _0802A2BC - cmp r0, 0 - beq _0802A2C2 - b _0802A35E - .pool -_0802A2BC: - cmp r0, 0x2 - beq _0802A2C8 - b _0802A35E -_0802A2C2: - movs r0, 0x2 - strb r0, [r1] - b _0802A35E -_0802A2C8: - strb r5, [r1] - b _0802A35E -_0802A2CC: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0802A35E - movs r0, 0x5 - bl PlaySE - ldr r0, [r7] - ldr r3, =0x00003020 - adds r0, r3 - movs r1, 0x2 - strb r1, [r0] -_0802A2E4: - ldr r1, [r7] - ldr r0, =0x00003014 - adds r1, r0 -_0802A2EA: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802A35E - .pool -_0802A2FC: - ldr r0, [r7] - ldr r2, =0x00003020 - adds r1, r0, r2 - ldrb r1, [r1] - ldr r3, =0x00003024 - adds r0, r3 - strb r1, [r0] - ldr r0, [r7] - ldr r6, =0x00003008 - adds r0, r6 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r7] - ldr r1, =0x00003009 - adds r0, r1 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r7] - adds r0, r6 - ldrb r0, [r0] - bl RemoveWindow - ldr r0, [r7] - ldr r2, =0x00003009 - adds r0, r2 - ldrb r0, [r0] - bl RemoveWindow - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, [r7] - movs r3, 0xC0 - lsls r3, 6 - adds r0, r3 - movs r1, 0x1 - str r1, [r0] -_0802A35E: - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A010 - - thumb_func_start sub_802A380 -sub_802A380: @ 802A380 - push {r4-r6,lr} - sub sp, 0x10 - ldr r5, =gUnknown_02022CF8 - ldr r0, [r5] - ldr r6, =0x00003014 - adds r0, r6 - ldrb r4, [r0] - cmp r4, 0x1 - beq _0802A3D8 - cmp r4, 0x1 - bgt _0802A3A4 - cmp r4, 0 - beq _0802A3AE - b _0802A420 - .pool -_0802A3A4: - cmp r4, 0x2 - beq _0802A3EC - cmp r4, 0x3 - beq _0802A404 - b _0802A420 -_0802A3AE: - movs r0, 0 - movs r1, 0 - bl DrawDialogueFrame - ldr r2, =gText_SavingDontTurnOffPower - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized2 - b _0802A410 - .pool -_0802A3D8: - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, [r5] - ldr r0, =0x00003014 - adds r1, r0 - b _0802A414 - .pool -_0802A3EC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802A448 - ldr r0, =sub_8153688 - movs r1, 0 - bl CreateTask - b _0802A410 - .pool -_0802A404: - ldr r0, =sub_8153688 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _0802A448 -_0802A410: - ldr r1, [r5] - adds r1, r6 -_0802A414: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802A448 - .pool -_0802A420: - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] -_0802A448: - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A380 - - thumb_func_start sub_802A454 -sub_802A454: @ 802A454 - push {r4-r6,lr} - sub sp, 0xC - ldr r1, =gUnknown_02022CF8 - ldr r2, [r1] - ldr r6, =0x00003014 - adds r0, r2, r6 - ldrb r0, [r0] - adds r5, r1, 0 - cmp r0, 0x1 - beq _0802A4AC - cmp r0, 0x1 - bgt _0802A47C - cmp r0, 0 - beq _0802A482 - b _0802A520 - .pool -_0802A47C: - cmp r0, 0x2 - beq _0802A4F4 - b _0802A520 -_0802A482: - ldr r4, =gUnknown_082F7BEC - adds r0, r4, 0 - bl AddWindow - ldr r1, [r5] - ldr r2, =0x00003008 - adds r1, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, r2 - ldrb r0, [r0] - bl ClearWindowTilemap - adds r0, r4, 0 - bl sub_8029174 - b _0802A510 - .pool -_0802A4AC: - ldr r4, =0x00003008 - adds r0, r2, r4 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - ldr r2, =gText_CommunicationStandby3 - movs r1, 0x5 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r5] - ldr r0, =0x00003014 - adds r1, r0 - b _0802A514 - .pool -_0802A4F4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802A50A - ldr r0, [r5] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap -_0802A50A: - movs r0, 0 - bl CopyBgTilemapBufferToVram -_0802A510: - ldr r1, [r5] - adds r1, r6 -_0802A514: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802A52C - .pool -_0802A520: - ldr r0, [r5] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] -_0802A52C: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802A454 - - thumb_func_start sub_802A534 -sub_802A534: @ 802A534 - push {r4,r5,lr} - sub sp, 0x8 - ldr r5, =gUnknown_02022CF8 - ldr r0, [r5] - ldr r4, =0x00003008 - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, [r5] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A534 - - thumb_func_start sub_802A588 -sub_802A588: @ 802A588 - push {r4-r7,lr} - sub sp, 0xC - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r7, =0x00003014 - adds r2, r1, r7 - ldrb r5, [r2] - adds r6, r0, 0 - cmp r5, 0x1 - beq _0802A610 - cmp r5, 0x1 - bgt _0802A5B0 - cmp r5, 0 - beq _0802A5BA - b _0802A6A4 - .pool -_0802A5B0: - cmp r5, 0x2 - beq _0802A658 - cmp r5, 0x3 - beq _0802A684 - b _0802A6A4 -_0802A5BA: - ldr r4, =gUnknown_082F7BE4 - adds r0, r4, 0 - bl AddWindow - ldr r1, [r6] - ldr r2, =0x00003008 - adds r1, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, r2 - ldrb r0, [r0] - bl ClearWindowTilemap - adds r0, r4, 0 - bl sub_8029174 - ldr r1, [r6] - adds r1, r7 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - ldr r0, [r6] - ldr r2, =0x0000301c - adds r1, r0, r2 - movs r2, 0 - strh r5, [r1] - ldr r1, =0x00003020 - adds r0, r1 - strb r2, [r0] - ldr r0, [r6] - adds r1, 0x4 - adds r0, r1 - strb r2, [r0] - b _0802A6EA - .pool -_0802A610: - ldr r4, =0x00003008 - adds r0, r1, r4 - ldrb r0, [r0] - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - ldr r2, =gText_SomeoneDroppedOut - movs r1, 0x5 - str r1, [sp] - movs r1, 0xFF - str r1, [sp, 0x4] - movs r1, 0 - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - ldr r1, [r6] - ldr r2, =0x00003014 - adds r1, r2 - b _0802A678 - .pool -_0802A658: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802A66E - ldr r0, [r6] - ldr r1, =0x00003008 - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap -_0802A66E: - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r1, [r6] - adds r1, r7 -_0802A678: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _0802A6EA - .pool -_0802A684: - ldr r0, =0x0000301c - adds r1, r0 - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x77 - bls _0802A6EA - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] - b _0802A6EA - .pool -_0802A6A4: - ldr r0, [r6] - ldr r1, =0x00003024 - adds r0, r1 - movs r1, 0x5 - strb r1, [r0] - ldr r0, [r6] - ldr r4, =0x00003008 - adds r0, r4 - ldrb r0, [r0] - bl ClearWindowTilemap - ldr r0, [r6] - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - movs r0, 0x1E - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - ldr r0, [r6] - movs r2, 0xC0 - lsls r2, 6 - adds r0, r2 - movs r1, 0x1 - str r1, [r0] -_0802A6EA: - add sp, 0xC - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A588 - - thumb_func_start unused_0 -unused_0: @ 802A6FC - push {r4,lr} - ldr r4, =gUnknown_02022CF8 - ldr r0, [r4] - ldr r1, =0x00003004 - adds r0, r1 - ldrb r0, [r0] - bl DestroyTask - ldr r0, [r4] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - movs r1, 0x1 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end unused_0 - - thumb_func_start nullsub_16 -nullsub_16: @ 802A728 - bx lr - thumb_func_end nullsub_16 - - thumb_func_start sub_802A72C -sub_802A72C: @ 802A72C - push {r4,lr} - ldr r2, =gUnknown_02022CF8 - ldr r1, [r2] - ldr r3, =0x00003014 - adds r1, r3 - movs r3, 0 - strb r3, [r1] - ldr r1, [r2] - movs r4, 0xC0 - lsls r4, 6 - adds r2, r1, r4 - str r3, [r2] - ldr r2, =0x00003028 - adds r1, r2 - str r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A72C - - thumb_func_start sub_802A75C -sub_802A75C: @ 802A75C - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - ldr r1, =0x00003028 - adds r0, r1 - ldr r0, [r0] - bx lr - .pool - thumb_func_end sub_802A75C - - thumb_func_start sub_802A770 -sub_802A770: @ 802A770 - push {lr} - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0x1 - beq _0802A78C - movs r0, 0x1 - b _0802A78E - .pool -_0802A78C: - movs r0, 0 -_0802A78E: - pop {r1} - bx r1 - thumb_func_end sub_802A770 - - thumb_func_start sub_802A794 -sub_802A794: @ 802A794 - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - ldr r1, =0x00003024 - adds r0, r1 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_802A794 - - thumb_func_start sub_802A7A8 -sub_802A7A8: @ 802A7A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r0, sp, 0x4 - mov r8, r0 - mov r2, sp - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_0802A7CE: - strh r6, [r2] - mov r0, sp - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _0802A7CE - strh r6, [r2] - mov r2, sp - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x4] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - mov r0, sp - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_082F7BA4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - bl InitStandardTextBoxWindows - bl sub_8197200 - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - ldr r4, =gUnknown_02022CF8 - ldr r1, [r4] - movs r0, 0x3 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 5 - adds r1, r2 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - movs r0, 0x80 - lsls r0, 6 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802A7A8 - - thumb_func_start sub_802A8E8 -sub_802A8E8: @ 802A8E8 - push {lr} - sub sp, 0x4 - ldr r0, =gUnknown_02022CF8 - ldr r0, [r0] - ldr r2, =0x00003018 - adds r1, r0, r2 - ldrb r0, [r1] - cmp r0, 0x5 - bhi _0802A982 - lsls r0, 2 - ldr r1, =_0802A910 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802A910: - .4byte _0802A928 - .4byte _0802A938 - .4byte _0802A93E - .4byte _0802A94C - .4byte _0802A964 - .4byte _0802A972 -_0802A928: - ldr r0, =gDodrioBerryBgPal1 - movs r1, 0 - movs r2, 0x40 - bl LoadPalette - b _0802A98A - .pool -_0802A938: - bl reset_temp_tile_data_buffers - b _0802A98A -_0802A93E: - ldr r1, =gDodrioBerryBgGfx1 - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - b _0802A954 - .pool -_0802A94C: - ldr r1, =gDodrioBerryBgGfx2 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 -_0802A954: - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _0802A98A - .pool -_0802A964: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0802A98A - b _0802A998 -_0802A972: - movs r0, 0x3 - bl stdpal_get - movs r1, 0xD0 - movs r2, 0x20 - bl LoadPalette - b _0802A98A -_0802A982: - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _0802A99A -_0802A98A: - ldr r0, =gUnknown_02022CF8 - ldr r1, [r0] - ldr r0, =0x00003018 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_0802A998: - movs r0, 0 -_0802A99A: - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802A8E8 - - .align 2, 0 @ don't pad with nop diff --git a/asm/pokemon_jump.s b/asm/pokemon_jump.s deleted file mode 100755 index 73582cb06..000000000 --- a/asm/pokemon_jump.s +++ /dev/null @@ -1,2866 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - - - - thumb_func_start sub_802DA44 -sub_802DA44: @ 802DA44 - push {r4,lr} - ldr r4, =gUnknown_02022D00 - ldr r1, [r4] - ldrh r0, [r1, 0x12] - cmp r0, 0xFF - bne _0802DA58 -_0802DA50: - movs r0, 0 - b _0802DA84 - .pool -_0802DA58: - ldrb r0, [r1, 0xD] - cmp r0, 0 - bne _0802DA7E - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802DA82 - ldr r0, [r4] - ldrb r0, [r0, 0x12] - bl RemoveWindow - ldr r1, [r4] - movs r0, 0xFF - strh r0, [r1, 0x12] - ldrb r0, [r1, 0xD] - adds r0, 0x1 - strb r0, [r1, 0xD] - b _0802DA50 -_0802DA7E: - cmp r0, 0x1 - beq _0802DA50 -_0802DA82: - movs r0, 0x1 -_0802DA84: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802DA44 - - thumb_func_start sub_802DA8C -sub_802DA8C: @ 802DA8C - push {lr} - bl Menu_ProcessInputNoWrapClearOnChoose - lsls r0, 24 - asrs r0, 24 - pop {r1} - bx r1 - thumb_func_end sub_802DA8C - - thumb_func_start sub_802DA9C -sub_802DA9C: @ 802DA9C - push {r4-r6,lr} - sub sp, 0x8 - ldr r6, =0xffffff00 - ldr r4, [sp] - ands r4, r6 - lsls r0, 24 - lsrs r0, 16 - ldr r5, =0xffff00ff - ands r4, r5 - orrs r4, r0 - lsls r1, 24 - lsrs r1, 8 - ldr r0, =0xff00ffff - ands r4, r0 - orrs r4, r1 - lsls r2, 24 - ldr r0, =0x00ffffff - ands r4, r0 - orrs r4, r2 - str r4, [sp] - lsls r3, 24 - lsrs r3, 24 - ldr r0, [sp, 0x4] - ands r0, r6 - orrs r0, r3 - ands r0, r5 - movs r1, 0xF0 - lsls r1, 4 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0x86 - lsls r1, 15 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - bl AddWindow - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r0, r4, 24 - lsrs r0, 24 - movs r1, 0x11 - bl FillWindowPixelBuffer - adds r0, r4, 0 - add sp, 0x8 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802DA9C - - thumb_func_start sub_802DB18 -sub_802DB18: @ 802DB18 - push {r4,r5,lr} - sub sp, 0x8 - adds r3, r2, 0 - lsls r3, 24 - lsrs r3, 24 - ldr r5, =0xffffff00 - ldr r2, [sp] - ands r2, r5 - lsls r0, 24 - lsrs r0, 16 - ldr r4, =0xffff00ff - ands r2, r4 - orrs r2, r0 - lsls r1, 24 - lsrs r1, 8 - ldr r0, =0xff00ffff - ands r2, r0 - orrs r2, r1 - ldr r0, =0x00ffffff - ands r2, r0 - movs r0, 0xC0 - lsls r0, 19 - orrs r2, r0 - str r2, [sp] - ldr r0, [sp, 0x4] - ands r0, r5 - movs r1, 0x4 - orrs r0, r1 - ands r0, r4 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0xAC - lsls r1, 14 - orrs r0, r1 - str r0, [sp, 0x4] - mov r0, sp - movs r1, 0x1 - movs r2, 0xD - bl CreateYesNoMenu - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DB18 - - thumb_func_start sub_802DB8C -sub_802DB8C: @ 802DB8C - push {r4,lr} - sub sp, 0x10 - ldr r1, =gUnknown_082FE1DC - add r0, sp, 0xC - movs r2, 0x3 - bl memcpy - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - add r0, sp, 0xC - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gText_SpacePoints2 - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl AddTextPrinterParameterized3 - add r0, sp, 0xC - str r0, [sp] - str r4, [sp, 0x4] - ldr r0, =gText_SpaceTimes3 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl AddTextPrinterParameterized3 - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DB8C - - thumb_func_start sub_802DBF8 -sub_802DBF8: @ 802DBF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - bl sub_802C8AC - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - ldr r1, =gUnknown_082FE260 - subs r0, 0x2 - lsls r0, 2 - adds r0, r1 - ldr r5, [r0] - movs r6, 0 - cmp r6, r10 - bge _0802DC62 - ldr r0, =gMonFrontPicCoords - mov r9, r0 - ldr r1, =gUnknown_02022D00 - mov r8, r1 -_0802DC26: - lsls r4, r6, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl sub_802C8C8 - adds r1, r0, 0 - ldrh r0, [r1] - lsls r0, 2 - add r0, r9 - ldrb r3, [r0, 0x1] - mov r2, r8 - ldr r0, [r2] - movs r7, 0 - ldrsh r2, [r5, r7] - adds r3, 0x70 - str r4, [sp] - bl sub_802C9D4 - mov r1, r8 - ldr r0, [r1] - movs r2, 0 - ldrsh r1, [r5, r2] - movs r2, 0x70 - adds r3, r4, 0 - bl sub_802CE48 - adds r5, 0x2 - adds r6, 0x1 - cmp r6, r10 - blt _0802DC26 -_0802DC62: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DBF8 - - thumb_func_start sub_802DC80 -sub_802DC80: @ 802DC80 - ldr r2, =gUnknown_02022D00 - ldr r2, [r2] - lsls r0, 2 - ldr r3, =0x000081a8 - adds r2, r3 - adds r2, r0 - ldr r0, [r2] - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_802DC80 - - thumb_func_start sub_802DC9C -sub_802DC9C: @ 802DC9C - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - adds r1, r4, 0 - bl sub_802CF50 - ldr r0, =gUnknown_082FE1DF - adds r4, r0 - ldrb r0, [r4] - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 13 - movs r0, 0x2 - movs r2, 0 - bl ChangeBgY - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DC9C - - thumb_func_start sub_802DCCC -sub_802DCCC: @ 802DCCC - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - movs r6, 0 -_0802DCD6: - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0802DCEA - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - adds r1, r5, 0 - bl sub_802CB14 - adds r6, 0x1 -_0802DCEA: - lsrs r4, 1 - adds r5, 0x1 - cmp r5, 0x4 - ble _0802DCD6 - subs r0, r6, 0x2 - lsls r0, 24 - lsrs r0, 24 - bl sub_802E00C - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802DCCC - - thumb_func_start sub_802DD08 -sub_802DD08: @ 802DD08 - push {r4,lr} - sub sp, 0x10 - mov r1, sp - movs r0, 0x40 - strb r0, [r1] - movs r0, 0x5 - strb r0, [r1, 0x1] - movs r0, 0x8 - strb r0, [r1, 0x2] - movs r0, 0x6C - strh r0, [r1, 0x4] - movs r4, 0x6 - strh r4, [r1, 0x6] - ldr r0, =gUnknown_082FE1EC - str r0, [sp, 0x8] - ldr r0, =gUnknown_082FE1F4 - str r0, [sp, 0xC] - movs r0, 0x2 - bl sub_8034C54 - movs r0, 0 - movs r1, 0 - mov r2, sp - bl sub_8034D14 - mov r1, sp - movs r0, 0x4 - strb r0, [r1, 0x1] - movs r0, 0x1E - strh r0, [r1, 0x4] - mov r0, sp - strh r4, [r0, 0x6] - movs r0, 0x1 - movs r1, 0 - mov r2, sp - bl sub_8034D14 - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DD08 - - thumb_func_start sub_802DD64 -sub_802DD64: @ 802DD64 - push {lr} - adds r1, r0, 0 - movs r0, 0 - bl sub_8035044 - pop {r0} - bx r0 - thumb_func_end sub_802DD64 - - thumb_func_start sub_802DD74 -sub_802DD74: @ 802DD74 - push {lr} - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x1 - bl sub_8035044 - pop {r0} - bx r0 - thumb_func_end sub_802DD74 - - thumb_func_start sub_802DD88 -sub_802DD88: @ 802DD88 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - bl sub_802CBF0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DD88 - - thumb_func_start sub_802DDA0 -sub_802DDA0: @ 802DDA0 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - bl sub_802CC88 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DDA0 - - thumb_func_start sub_802DDB8 -sub_802DDB8: @ 802DDB8 - push {lr} - adds r1, r0, 0 - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - bl sub_802CC18 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802DDB8 - - thumb_func_start sub_802DDCC -sub_802DDCC: @ 802DDCC - push {lr} - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - bl sub_802CCB0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DDCC - - thumb_func_start sub_802DDE0 -sub_802DDE0: @ 802DDE0 - push {lr} - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - bl sub_802CD3C - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DDE0 - - thumb_func_start sub_802DDF4 -sub_802DDF4: @ 802DDF4 - push {lr} - adds r1, r0, 0 - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - bl sub_802CD70 - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DDF4 - - thumb_func_start sub_802DE08 -sub_802DE08: @ 802DE08 - push {lr} - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - bl sub_802CD98 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802DE08 - - thumb_func_start sub_802DE1C -sub_802DE1C: @ 802DE1C - push {r4-r7,lr} - sub sp, 0x8 - bl sub_802C8AC - lsls r0, 16 - lsrs r7, r0, 16 - ldr r1, =gUnknown_082FE234 - subs r0, r7, 0x2 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - ldr r2, =0xffffff00 - ldr r0, [sp] - ands r0, r2 - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 20 - orrs r0, r1 - str r0, [sp] - ldr r0, [sp, 0x4] - ands r0, r2 - movs r1, 0x2 - orrs r0, r1 - ldr r1, =0xffff00ff - ands r0, r1 - movs r1, 0x80 - lsls r1, 2 - orrs r0, r1 - ldr r1, =0x0000ffff - ands r0, r1 - movs r1, 0xAC - lsls r1, 14 - orrs r0, r1 - str r0, [sp, 0x4] - movs r5, 0 - cmp r5, r7 - bge _0802DEAC - mov r6, sp -_0802DE6A: - ldrb r0, [r4] - lsls r0, 8 - ldr r2, =0xffff00ff - ldr r1, [sp] - ands r1, r2 - orrs r1, r0 - str r1, [sp] - ldrb r2, [r4, 0x2] - lsls r2, 16 - ldr r0, =0xff00ffff - ands r0, r1 - orrs r0, r2 - str r0, [sp] - mov r0, sp - bl AddWindow - ldr r1, =gUnknown_02022D00 - ldr r1, [r1] - lsls r2, r5, 1 - adds r1, 0x1C - adds r1, r2 - strh r0, [r1] - lsls r0, 24 - lsrs r0, 24 - bl ClearWindowTilemap - ldrh r0, [r6, 0x6] - adds r0, 0x10 - strh r0, [r6, 0x6] - adds r4, 0x4 - adds r5, 0x1 - cmp r5, r7 - blt _0802DE6A -_0802DEAC: - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DE1C - - thumb_func_start sub_802DED8 -sub_802DED8: @ 802DED8 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x10 - adds r5, r0, 0 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - add r0, sp, 0xC - strb r1, [r0] - strb r2, [r0, 0x1] - strb r3, [r0, 0x2] - ldr r6, =gUnknown_02022D00 - ldr r0, [r6] - lsls r1, r5, 1 - mov r8, r1 - adds r0, 0x1C - add r0, r8 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - bl sub_802C8E8 - adds r1, r0, 0 - movs r2, 0x1 - negs r2, r2 - mov r9, r2 - movs r0, 0x1 - bl GetStringWidth - movs r4, 0x40 - subs r4, r0 - lsrs r4, 1 - adds r0, r5, 0 - bl sub_802C8E8 - adds r1, r0, 0 - ldr r0, [r6] - adds r0, 0x1C - add r0, r8 - ldrb r0, [r0] - lsls r4, 24 - lsrs r4, 24 - add r2, sp, 0xC - str r2, [sp] - mov r2, r9 - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - adds r2, r4, 0 - movs r3, 0x1 - bl AddTextPrinterParameterized3 - ldr r0, [r6] - adds r0, 0x1C - add r0, r8 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DED8 - - thumb_func_start sub_802DF70 -sub_802DF70: @ 802DF70 - push {r4-r6,lr} - adds r4, r0, 0 - bl sub_802C8AC - lsls r0, 16 - lsrs r5, r0, 16 - cmp r4, 0 - bne _0802DF9A - movs r4, 0 - cmp r4, r5 - bge _0802DFCC -_0802DF86: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x3 - bl sub_802DED8 - adds r4, 0x1 - cmp r4, r5 - blt _0802DF86 - b _0802DFCC -_0802DF9A: - bl sub_802C8BC - lsls r0, 16 - lsrs r6, r0, 16 - movs r4, 0 - cmp r4, r5 - bge _0802DFCC -_0802DFA8: - cmp r6, r4 - beq _0802DFBA - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x2 - movs r3, 0x3 - bl sub_802DED8 - b _0802DFC6 -_0802DFBA: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x4 - movs r3, 0x5 - bl sub_802DED8 -_0802DFC6: - adds r4, 0x1 - cmp r4, r5 - blt _0802DFA8 -_0802DFCC: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802DF70 - - thumb_func_start sub_802DFD4 -sub_802DFD4: @ 802DFD4 - push {r4,r5,lr} - bl sub_802C8AC - lsls r0, 16 - lsrs r5, r0, 16 - movs r4, 0 - cmp r4, r5 - bge _0802DFFA -_0802DFE4: - ldr r0, =gUnknown_02022D00 - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x1C - adds r0, r1 - ldrb r0, [r0] - bl PutWindowTilemap - adds r4, 0x1 - cmp r4, r5 - blt _0802DFE4 -_0802DFFA: - movs r0, 0 - bl CopyBgTilemapBufferToVram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802DFD4 - - thumb_func_start sub_802E00C -sub_802E00C: @ 802E00C - push {r4,lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r4, r1, 24 - ldr r0, =gUnknown_02022D00 - ldr r2, [r0] - movs r0, 0 - str r0, [r2, 0x18] - lsrs r1, 25 - lsls r1, 16 - movs r0, 0x1 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - ands r4, r0 - lsls r4, 8 - subs r4, 0x28 - lsls r4, 8 - adds r1, r4, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - bl ShowBg - ldr r0, =sub_802E090 - movs r1, 0x4 - bl CreateTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E00C - - thumb_func_start sub_802E058 -sub_802E058: @ 802E058 - push {r4,lr} - ldr r4, =gUnknown_02022D00 - ldr r0, [r4] - ldr r0, [r0, 0x18] - cmp r0, 0x1F - bls _0802E06C - movs r0, 0 - b _0802E08A - .pool -_0802E06C: - movs r0, 0x1 - movs r1, 0x80 - movs r2, 0x1 - bl ChangeBgY - ldr r1, [r4] - ldr r0, [r1, 0x18] - adds r0, 0x1 - str r0, [r1, 0x18] - cmp r0, 0x1F - bls _0802E088 - movs r0, 0x1 - bl HideBg -_0802E088: - movs r0, 0x1 -_0802E08A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802E058 - - thumb_func_start sub_802E090 -sub_802E090: @ 802E090 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl sub_802E058 - cmp r0, 0 - bne _0802E0A4 - adds r0, r4, 0 - bl DestroyTask -_0802E0A4: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_802E090 - - thumb_func_start sub_802E0AC -sub_802E0AC: @ 802E0AC - push {lr} - sub sp, 0xC - mov r2, sp - movs r1, 0x1 - strb r1, [r2] - ldrh r1, [r0] - strh r1, [r2, 0x2] - ldr r1, [r0, 0x4] - str r1, [sp, 0x8] - ldr r0, [r0, 0x8] - str r0, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_802E0AC - - thumb_func_start sub_802E0D0 -sub_802E0D0: @ 802E0D0 - push {r4,lr} - sub sp, 0xC - adds r4, r1, 0 - ldr r3, =gRecvCmds - lsls r2, r0, 4 - adds r0, r2, r3 - ldrh r1, [r0] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - movs r1, 0xBC - lsls r1, 6 - cmp r0, r1 - bne _0802E100 - adds r1, r3, 0x2 - adds r1, r2, r1 - mov r0, sp - movs r2, 0xC - bl memcpy - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x1 - beq _0802E108 -_0802E100: - movs r0, 0 - b _0802E118 - .pool -_0802E108: - mov r0, sp - ldrh r0, [r0, 0x2] - strh r0, [r4] - ldr r0, [sp, 0x8] - str r0, [r4, 0x4] - ldr r0, [sp, 0x4] - str r0, [r4, 0x8] - movs r0, 0x1 -_0802E118: - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802E0D0 - - thumb_func_start sub_802E120 -sub_802E120: @ 802E120 - push {lr} - sub sp, 0xC - mov r2, sp - movs r1, 0x2 - strb r1, [r2] - str r0, [sp, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0xC - pop {r0} - bx r0 - thumb_func_end sub_802E120 - - thumb_func_start sub_802E138 -sub_802E138: @ 802E138 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - mov r3, sp - movs r2, 0x3 - strb r2, [r3] - ldr r3, [r1, 0x8] - lsls r3, 15 - ldr r2, [sp, 0x8] - ldr r4, =0x00007fff - mov r8, r4 - ands r2, r4 - orrs r2, r3 - str r2, [sp, 0x8] - mov r6, sp - ldrb r2, [r1, 0x1] - movs r5, 0x1F - adds r3, r5, 0 - ands r3, r2 - ldrb r4, [r6, 0x3] - movs r2, 0x20 - negs r2, r2 - ands r2, r4 - orrs r2, r3 - strb r2, [r6, 0x3] - mov r3, sp - ldrb r2, [r1] - strb r2, [r3, 0x1] - ldrh r2, [r1, 0x2] - strh r2, [r3, 0x6] - mov r4, sp - ldrh r2, [r1, 0x4] - mov r1, r8 - ands r2, r1 - ldrh r3, [r4, 0x8] - ldr r1, =0xffff8000 - ands r1, r3 - orrs r1, r2 - strh r1, [r4, 0x8] - mov r2, sp - ldrh r1, [r0, 0x10] - strb r1, [r2, 0x2] - mov r3, sp - ldr r1, [r0, 0x14] - lsls r1, 5 - ldrb r2, [r3, 0x3] - ands r5, r2 - orrs r5, r1 - strb r5, [r3, 0x3] - mov r1, sp - ldrh r0, [r0, 0xE] - strh r0, [r1, 0x4] - mov r0, sp - bl sub_800FE50 - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E138 - - thumb_func_start sub_802E1BC -sub_802E1BC: @ 802E1BC - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - adds r4, r1, 0 - ldr r2, =gRecvCmds - ldrh r0, [r2] - movs r1, 0xFF - lsls r1, 8 - ands r1, r0 - movs r0, 0xBC - lsls r0, 6 - cmp r1, r0 - bne _0802E228 - adds r1, r2, 0x2 - mov r0, sp - movs r2, 0xC - bl memcpy - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x3 - bne _0802E228 - ldr r0, [sp, 0x8] - lsrs r0, 15 - str r0, [r4, 0x8] - mov r0, sp - ldrb r1, [r0, 0x3] - lsls r0, r1, 27 - lsrs r0, 27 - strb r0, [r4, 0x1] - mov r0, sp - ldrb r0, [r0, 0x1] - strb r0, [r4] - mov r0, sp - ldrh r0, [r0, 0x6] - strh r0, [r4, 0x2] - mov r0, sp - ldrh r0, [r0, 0x8] - lsls r0, 17 - lsrs r0, 17 - strh r0, [r4, 0x4] - mov r0, sp - ldrb r0, [r0, 0x2] - strh r0, [r5, 0x10] - lsls r1, 24 - lsrs r1, 29 - str r1, [r5, 0x14] - mov r0, sp - ldrh r0, [r0, 0x4] - strh r0, [r5, 0xE] - movs r0, 0x1 - b _0802E22A - .pool -_0802E228: - movs r0, 0 -_0802E22A: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802E1BC - - thumb_func_start sub_802E234 -sub_802E234: @ 802E234 - push {r4,lr} - sub sp, 0xC - mov r4, sp - movs r3, 0x4 - strb r3, [r4] - ldrh r3, [r0, 0x10] - strb r3, [r4, 0x1] - ldr r3, [r0, 0x14] - strb r3, [r4, 0x2] - ldr r3, [r0, 0x18] - strb r3, [r4, 0x3] - mov r3, sp - ldrh r0, [r0, 0xE] - strh r0, [r3, 0x4] - mov r0, sp - strb r1, [r0, 0x6] - strh r2, [r0, 0x8] - bl sub_800FE50 - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_802E234 - - thumb_func_start sub_802E264 -sub_802E264: @ 802E264 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - adds r5, r2, 0 - adds r6, r3, 0 - ldr r3, =gRecvCmds - lsls r2, r1, 4 - adds r0, r2, r3 - ldrh r1, [r0] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - movs r1, 0xBC - lsls r1, 6 - cmp r0, r1 - bne _0802E2C4 - adds r1, r3, 0x2 - adds r1, r2, r1 - mov r0, sp - movs r2, 0xC - bl memcpy - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x4 - bne _0802E2C4 - mov r0, sp - ldrb r0, [r0, 0x1] - strh r0, [r4, 0x10] - mov r0, sp - ldrb r0, [r0, 0x2] - str r0, [r4, 0x14] - mov r0, sp - ldrb r0, [r0, 0x3] - str r0, [r4, 0x18] - mov r0, sp - ldrh r0, [r0, 0x4] - strh r0, [r4, 0xE] - mov r0, sp - ldrb r0, [r0, 0x6] - strb r0, [r5] - mov r0, sp - ldrh r0, [r0, 0x8] - strh r0, [r6] - movs r0, 0x1 - b _0802E2C6 - .pool -_0802E2C4: - movs r0, 0 -_0802E2C6: - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_802E264 - - thumb_func_start sub_802E2D0 -sub_802E2D0: @ 802E2D0 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r3, =gRecvCmds - lsls r2, r1, 4 - adds r0, r2, r3 - ldrh r1, [r0] - movs r0, 0xFF - lsls r0, 8 - ands r0, r1 - movs r1, 0xBC - lsls r1, 6 - cmp r0, r1 - bne _0802E320 - adds r1, r3, 0x2 - adds r1, r2, r1 - mov r0, sp - movs r2, 0xC - bl memcpy - mov r0, sp - ldrb r0, [r0] - cmp r0, 0x4 - bne _0802E320 - mov r0, sp - ldrb r0, [r0, 0x1] - strh r0, [r4, 0x10] - mov r0, sp - ldrb r0, [r0, 0x2] - str r0, [r4, 0x14] - mov r0, sp - ldrb r0, [r0, 0x3] - str r0, [r4, 0x18] - mov r0, sp - ldrh r0, [r0, 0x4] - strh r0, [r4, 0xE] - movs r0, 0x1 - b _0802E322 - .pool -_0802E320: - movs r0, 0 -_0802E322: - add sp, 0xC - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802E2D0 - - thumb_func_start sub_802E32C -sub_802E32C: @ 802E32C - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - movs r1, 0xFE - lsls r1, 1 - adds r0, r1 - bx lr - .pool - thumb_func_end sub_802E32C - - thumb_func_start ResetPokeJumpResults -ResetPokeJumpResults: @ 802E33C - push {lr} - bl sub_802E32C - movs r1, 0 - strh r1, [r0] - str r1, [r0, 0xC] - strh r1, [r0, 0x4] - strh r1, [r0, 0x6] - str r1, [r0, 0x8] - strh r1, [r0, 0x2] - pop {r0} - bx r0 - thumb_func_end ResetPokeJumpResults - - thumb_func_start sub_802E354 -sub_802E354: @ 802E354 - push {r4-r6,lr} - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - lsls r2, 16 - lsrs r6, r2, 16 - bl sub_802E32C - adds r1, r0, 0 - movs r2, 0 - ldr r0, [r1, 0xC] - cmp r0, r4 - bcs _0802E378 - ldr r0, =0x00018696 - cmp r4, r0 - bhi _0802E378 - str r4, [r1, 0xC] - movs r2, 0x1 -_0802E378: - ldrh r0, [r1] - cmp r0, r5 - bcs _0802E388 - ldr r0, =0x0000270f - cmp r5, r0 - bhi _0802E388 - strh r5, [r1] - movs r2, 0x1 -_0802E388: - ldrh r0, [r1, 0x4] - cmp r0, r6 - bcs _0802E398 - ldr r0, =0x0000270f - cmp r6, r0 - bhi _0802E398 - strh r6, [r1, 0x4] - movs r2, 0x1 -_0802E398: - adds r0, r2, 0 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802E354 - - thumb_func_start sub_802E3A8 -sub_802E3A8: @ 802E3A8 - push {lr} - bl sub_802E32C - adds r2, r0, 0 - ldrh r1, [r2, 0x6] - ldr r0, =0x0000270e - cmp r1, r0 - bhi _0802E3BC - adds r0, r1, 0x1 - strh r0, [r2, 0x6] -_0802E3BC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E3A8 - - thumb_func_start sub_802E3C4 -sub_802E3C4: @ 802E3C4 - push {r4,lr} - ldr r4, =sub_802E3E4 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E3C4 - - thumb_func_start sub_802E3E4 -sub_802E3E4: @ 802E3E4 - push {r4-r7,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r7, r0, r1 - movs r1, 0 - ldrsh r0, [r7, r1] - cmp r0, 0x1 - beq _0802E4A8 - cmp r0, 0x1 - bgt _0802E40C - cmp r0, 0 - beq _0802E416 - b _0802E4F6 - .pool -_0802E40C: - cmp r0, 0x2 - beq _0802E4B4 - cmp r0, 0x3 - beq _0802E4DC - b _0802E4F6 -_0802E416: - ldr r0, =gUnknown_082FE270 - ldr r1, [r0, 0x4] - ldr r0, [r0] - str r0, [sp] - str r1, [sp, 0x4] - ldr r1, =gText_PkmnJumpRecords - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r4, r0, 0 - movs r6, 0 - ldr r5, =gUnknown_082FE278 -_0802E430: - ldr r1, [r5] - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r0, 0x26 - cmp r0, r4 - ble _0802E442 - adds r4, r0, 0 -_0802E442: - adds r5, 0x4 - adds r6, 0x1 - cmp r6, 0x2 - bls _0802E430 - adds r0, r4, 0x7 - cmp r0, 0 - bge _0802E452 - adds r0, 0x7 -_0802E452: - asrs r4, r0, 3 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0802E45E - adds r4, 0x1 -_0802E45E: - movs r1, 0x1E - subs r1, r4 - lsrs r0, r1, 31 - adds r1, r0 - asrs r1, 1 - lsls r1, 24 - lsrs r1, 16 - ldr r2, =0xffff00ff - ldr r0, [sp] - ands r0, r2 - orrs r0, r1 - lsls r2, r4, 24 - ldr r1, =0x00ffffff - ands r0, r1 - orrs r0, r2 - str r0, [sp] - mov r0, sp - bl AddWindow - strh r0, [r7, 0x2] - ldrh r0, [r7, 0x2] - adds r1, r4, 0 - bl sub_802E500 - ldrb r0, [r7, 0x2] - movs r1, 0x3 - b _0802E4CA - .pool -_0802E4A8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802E4F6 - b _0802E4CE -_0802E4B4: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - beq _0802E4F6 - ldrb r0, [r7, 0x2] - bl rbox_fill_rectangle - ldrb r0, [r7, 0x2] - movs r1, 0x1 -_0802E4CA: - bl CopyWindowToVram -_0802E4CE: - ldrh r0, [r7] - adds r0, 0x1 - strh r0, [r7] - b _0802E4F6 - .pool -_0802E4DC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _0802E4F6 - ldrb r0, [r7, 0x2] - bl RemoveWindow - adds r0, r4, 0 - bl DestroyTask - bl EnableBothScriptContexts -_0802E4F6: - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_802E3E4 - - thumb_func_start sub_802E500 -sub_802E500: @ 802E500 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r1, [sp, 0x1C] - lsls r0, 16 - lsrs r0, 16 - str r0, [sp, 0x18] - bl sub_802E32C - ldrh r1, [r0] - str r1, [sp, 0xC] - ldr r1, [r0, 0xC] - str r1, [sp, 0x10] - ldrh r0, [r0, 0x4] - str r0, [sp, 0x14] - ldr r0, [sp, 0x18] - lsls r4, r0, 24 - lsrs r4, 24 - ldr r5, =0x0000021d - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0xD0 - bl LoadUserWindowBorderGfx_ - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0xD - bl DrawTextBorderOuter - adds r0, r4, 0 - movs r1, 0x11 - bl FillWindowPixelBuffer - ldr r5, =gText_PkmnJumpRecords - ldr r1, [sp, 0x1C] - lsls r2, r1, 3 - movs r0, 0x1 - adds r1, r5, 0 - bl GetStringCenterAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - adds r0, r4, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl AddTextPrinterParameterized - movs r6, 0 - adds r7, r4, 0 - movs r0, 0xFF - mov r10, r0 - mov r9, r6 - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x20] - movs r0, 0xC8 - lsls r0, 21 - mov r8, r0 - ldr r5, =gStringVar1 -_0802E58A: - ldr r1, =gUnknown_082FE278 - lsls r0, r6, 2 - adds r0, r1 - ldr r2, [r0] - mov r1, r8 - lsrs r4, r1, 24 - str r4, [sp] - mov r0, r10 - str r0, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - ldr r0, [sp, 0x20] - ldm r0!, {r1} - str r0, [sp, 0x20] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - adds r0, r5, 0 - bl sub_802E620 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0 - bl GetStringWidth - ldr r1, [sp, 0x1C] - lsls r3, r1, 3 - subs r3, r0 - lsls r3, 24 - lsrs r3, 24 - str r4, [sp] - mov r0, r10 - str r0, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - adds r0, r7, 0 - movs r1, 0x1 - adds r2, r5, 0 - bl AddTextPrinterParameterized - movs r0, 0x80 - lsls r0, 21 - add r8, r0 - adds r6, 0x1 - ldr r1, [sp, 0x18] - lsls r0, r1, 24 - cmp r6, 0x2 - bls _0802E58A - lsrs r0, 24 - bl PutWindowTilemap - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E500 - - thumb_func_start sub_802E620 -sub_802E620: @ 802E620 - push {lr} - adds r1, r0, 0 - b _0802E628 -_0802E626: - adds r1, 0x1 -_0802E628: - ldrb r0, [r1] - cmp r0, 0xFF - beq _0802E636 - cmp r0, 0 - bne _0802E626 - movs r0, 0xFF - strb r0, [r1] -_0802E636: - pop {r0} - bx r0 - thumb_func_end sub_802E620 - - thumb_func_start sub_802E63C -sub_802E63C: @ 802E63C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r0, =sub_802E6D0 - bl CreateTask - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - movs r1, 0x1 - strh r1, [r0, 0x8] - strh r5, [r0, 0xA] - ldr r0, =gUnknown_082FE748 - lsls r5, 4 - adds r5, r0 - ldr r1, [r5] - adds r0, r4, 0 - bl _call_via_r1 - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802E63C - - thumb_func_start sub_802E688 -sub_802E688: @ 802E688 - push {lr} - ldr r0, =sub_802E6D0 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _0802E6B4 - ldr r0, =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - movs r0, 0x2 - strh r0, [r1, 0x8] - movs r0, 0x1 - b _0802E6B6 - .pool -_0802E6B4: - movs r0, 0 -_0802E6B6: - pop {r1} - bx r1 - thumb_func_end sub_802E688 - - thumb_func_start sub_802E6BC -sub_802E6BC: @ 802E6BC - push {lr} - ldr r0, =sub_802E6D0 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802E6BC - - thumb_func_start sub_802E6D0 -sub_802E6D0: @ 802E6D0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - beq _0802E71C - cmp r0, 0x3 - bgt _0802E6F8 - cmp r0, 0x2 - beq _0802E6FE - b _0802E752 - .pool -_0802E6F8: - cmp r0, 0x4 - beq _0802E738 - b _0802E752 -_0802E6FE: - ldr r1, =gUnknown_082FE748 - movs r2, 0x2 - ldrsh r0, [r4, r2] - lsls r0, 4 - adds r1, 0x8 - adds r0, r1 - ldr r1, [r0] - adds r0, r5, 0 - bl _call_via_r1 - movs r0, 0x3 - strh r0, [r4] - b _0802E752 - .pool -_0802E71C: - ldr r0, =gUnknown_082FE748 - movs r2, 0x2 - ldrsh r1, [r4, r2] - lsls r1, 4 - adds r0, 0xC - adds r1, r0 - ldr r1, [r1] - adds r0, r5, 0 - bl _call_via_r1 - b _0802E752 - .pool -_0802E738: - ldr r0, =gUnknown_082FE748 - movs r2, 0x2 - ldrsh r1, [r4, r2] - lsls r1, 4 - adds r0, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r5, 0 - bl _call_via_r1 - adds r0, r5, 0 - bl DestroyTask -_0802E752: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E6D0 - - thumb_func_start sub_802E75C -sub_802E75C: @ 802E75C - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r1, 0x6 - ldrsh r0, [r4, r1] - lsls r0, 3 - ldr r1, =gUnknown_082FE6C8 - adds r0, r1 - bl LoadCompressedSpriteSheet - movs r2, 0x8 - ldrsh r0, [r4, r2] - lsls r0, 3 - ldr r1, =gUnknown_082FE6D8 - adds r0, r1 - bl LoadSpritePalette - movs r5, 0 - movs r3, 0x10 - ldrsh r0, [r4, r3] - cmp r5, r0 - bge _0802E7C4 -_0802E790: - movs r0, 0x4 - ldrsh r1, [r4, r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - ldr r1, =gUnknown_082FE730 - adds r0, r1 - movs r2, 0x12 - ldrsh r1, [r4, r2] - movs r3, 0x14 - ldrsh r2, [r4, r3] - ldrb r3, [r4, 0xE] - bl CreateSprite - lsls r1, r5, 1 - adds r1, r4 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x1A] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r5, r0 - blt _0802E790 -_0802E7C4: - movs r5, 0 - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r5, r0 - bge _0802E820 - movs r7, 0x3 - movs r3, 0xD - negs r3, r3 - mov r12, r3 - ldr r6, =gSprites -_0802E7D8: - lsls r0, r5, 1 - adds r0, r4 - movs r1, 0x1A - ldrsh r0, [r0, r1] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r6 - ldrb r1, [r4, 0xC] - ands r1, r7 - lsls r1, 2 - ldrb r3, [r2, 0x5] - mov r0, r12 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x5] - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r4, 0xA] - strh r0, [r2, 0x30] - mov r3, r8 - strh r3, [r2, 0x34] - strh r5, [r2, 0x36] - ldrh r0, [r4, 0x1A] - strh r0, [r2, 0x38] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r5, r0 - blt _0802E7D8 -_0802E820: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E75C - - thumb_func_start sub_802E83C -sub_802E83C: @ 802E83C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r1, =gTasks + 0x8 - adds r4, r1 - movs r5, 0 - strh r5, [r4, 0x4] - strh r5, [r4, 0x6] - strh r5, [r4, 0x8] - movs r1, 0x3C - strh r1, [r4, 0xA] - strh r5, [r4, 0xC] - strh r5, [r4, 0xE] - movs r1, 0x3 - strh r1, [r4, 0x10] - movs r1, 0x78 - strh r1, [r4, 0x12] - movs r1, 0x58 - strh r1, [r4, 0x14] - adds r1, r4, 0 - bl sub_802E75C - movs r0, 0x1C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r5, =gSprites - adds r0, r5 - movs r1, 0x4 - bl StartSpriteAnim - movs r0, 0x1C - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - ldr r1, =0x0000ffe0 - strh r1, [r0, 0x24] - movs r0, 0x1E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x5 - bl StartSpriteAnim - movs r0, 0x1E - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x20 - strh r1, [r0, 0x24] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E83C - - thumb_func_start sub_802E8C8 -sub_802E8C8: @ 802E8C8 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - movs r5, 0 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - b _0802E8FC - .pool -_0802E8E0: - lsls r0, r5, 1 - adds r0, r4 - movs r2, 0x1A - ldrsh r1, [r0, r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0802E8FC: - movs r1, 0x10 - ldrsh r0, [r4, r1] - cmp r5, r0 - blt _0802E8E0 - ldr r1, =gUnknown_082FE6C8 - movs r2, 0x6 - ldrsh r0, [r4, r2] - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x6] - bl FreeSpriteTilesByTag - ldr r1, =gUnknown_082FE6D8 - movs r2, 0x8 - ldrsh r0, [r4, r2] - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl FreeSpritePaletteByTag - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802E8C8 - - thumb_func_start sub_802E938 -sub_802E938: @ 802E938 - push {r4-r6,lr} - adds r6, r0, 0 - movs r0, 0x34 - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - movs r1, 0x16 - ldrsh r0, [r5, r1] - movs r2, 0xA - ldrsh r1, [r5, r2] - bl __modsi3 - cmp r0, 0 - bne _0802EA4A - ldrh r2, [r5, 0x16] - movs r3, 0x16 - ldrsh r1, [r5, r3] - movs r3, 0x14 - ldrsh r0, [r5, r3] - cmp r1, r0 - beq _0802EA4A - strh r2, [r5, 0x14] - movs r1, 0x32 - ldrsh r0, [r6, r1] - cmp r0, 0x4 - bhi _0802EA44 - lsls r0, 2 - ldr r1, =_0802E984 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802E984: - .4byte _0802E998 - .4byte _0802E9A6 - .4byte _0802E9A6 - .4byte _0802E9BA - .4byte _0802EA04 -_0802E998: - adds r2, r6, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0802E9A6: - movs r0, 0x38 - bl PlaySE - ldrh r1, [r6, 0x32] - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl StartSpriteAnim - b _0802EA44 -_0802E9BA: - movs r0, 0x15 - bl PlaySE - ldrh r1, [r6, 0x32] - lsls r1, 24 - lsrs r1, 24 - adds r0, r6, 0 - bl StartSpriteAnim - ldr r4, =gSprites - movs r2, 0x1C - ldrsh r0, [r5, r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - movs r3, 0x1E - ldrsh r1, [r5, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - b _0802EA44 - .pool -_0802EA04: - adds r1, r6, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldr r3, =gSprites - movs r0, 0x1C - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - movs r0, 0x1E - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r3 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - movs r0, 0x4 - strh r0, [r5] - b _0802EA4A - .pool -_0802EA44: - ldrh r0, [r6, 0x32] - adds r0, 0x1 - strh r0, [r6, 0x32] -_0802EA4A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_802E938 - - thumb_func_start sub_802EA50 -sub_802EA50: @ 802EA50 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r5, =gTasks + 0x8 - adds r6, r4, r5 - movs r0, 0x38 - bl PlaySE - ldr r2, =gSprites - movs r0, 0x1A - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r2, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_802E938 - str r1, [r0] - movs r0, 0x1A - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - subs r5, 0x8 - adds r4, r5 - movs r0, 0x3 - strh r0, [r4, 0x8] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EA50 - - thumb_func_start sub_802EAB0 -sub_802EAB0: @ 802EAB0 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks + 0x8 - adds r4, r1, r0 - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _0802EB14 - ldr r1, =gRecvCmds - ldrh r0, [r1, 0x2] - ldr r5, =0x00007fff - cmp r0, r5 - bne _0802EAD8 - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x16] -_0802EAD8: - bl GetMultiplayerId - lsls r0, 24 - cmp r0, 0 - bne _0802EB1A - ldrh r0, [r4, 0x18] - adds r0, 0x1 - strh r0, [r4, 0x18] - mov r0, sp - movs r1, 0 - movs r2, 0xC - bl memset - mov r0, sp - strh r5, [r0] - mov r1, sp - ldrh r0, [r4, 0x18] - strh r0, [r1, 0x2] - mov r0, sp - bl sub_800FE50 - b _0802EB1A - .pool -_0802EB14: - ldrh r0, [r4, 0x16] - adds r0, 0x1 - strh r0, [r4, 0x16] -_0802EB1A: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_802EAB0 - - thumb_func_start sub_802EB24 -sub_802EB24: @ 802EB24 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x4 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - ldr r0, [sp, 0x18] - lsls r4, 16 - lsrs r4, 16 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 16 - lsrs r6, 16 - lsls r3, 16 - lsrs r3, 16 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =sub_802EB98 - movs r1, 0x50 - str r3, [sp] - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xC] - strh r5, [r1, 0xE] - strh r6, [r1, 0x10] - ldr r3, [sp] - strh r3, [r1, 0x12] - mov r0, r8 - strh r0, [r1, 0x14] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EB24 - - thumb_func_start sub_802EB84 -sub_802EB84: @ 802EB84 - push {lr} - ldr r0, =sub_802EB98 - bl FuncIsActiveTask - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802EB84 - - thumb_func_start sub_802EB98 -sub_802EB98: @ 802EB98 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r6, r0, 24 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r5, r0, r1 - movs r1, 0 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0802EC08 - cmp r0, 0x1 - bgt _0802EBC0 - cmp r0, 0 - beq _0802EBC6 - b _0802EC8A - .pool -_0802EBC0: - cmp r0, 0x2 - beq _0802EC4C - b _0802EC8A -_0802EBC6: - ldrh r0, [r5, 0x4] - ldrh r1, [r5, 0x6] - bl sub_802EF50 - ldrh r0, [r5, 0x4] - ldrh r1, [r5, 0x6] - movs r3, 0x8 - ldrsh r2, [r5, r3] - movs r4, 0xA - ldrsh r3, [r5, r4] - ldrb r4, [r5, 0xC] - str r4, [sp] - bl sub_802EFA8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0xE] - ldrh r0, [r5, 0x4] - ldrh r1, [r5, 0x6] - movs r3, 0x8 - ldrsh r2, [r5, r3] - movs r4, 0xA - ldrsh r3, [r5, r4] - ldrb r4, [r5, 0xC] - str r4, [sp] - adds r4, r5, 0 - adds r4, 0x10 - str r4, [sp, 0x4] - adds r4, 0x2 - str r4, [sp, 0x8] - bl sub_802EFFC - b _0802EC3E -_0802EC08: - ldrb r0, [r5, 0xE] - bl sub_802EC98 - cmp r0, 0 - bne _0802EC8A - ldrb r0, [r5, 0xE] - ldrb r1, [r5, 0x10] - ldrb r2, [r5, 0x12] - bl sub_802EDCC - movs r0, 0xE - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl FreeSpriteOamMatrix - movs r3, 0xE - ldrsh r1, [r5, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite -_0802EC3E: - ldrh r0, [r5] - adds r0, 0x1 - strh r0, [r5] - b _0802EC8A - .pool -_0802EC4C: - ldrb r0, [r5, 0x10] - bl sub_802EE30 - cmp r0, 0 - bne _0802EC8A - movs r4, 0x10 - ldrsh r1, [r5, r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - bl DestroySprite - movs r0, 0x12 - ldrsh r1, [r5, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - bl DestroySprite - ldrh r0, [r5, 0x4] - bl FreeSpriteTilesByTag - ldrh r0, [r5, 0x6] - bl FreeSpritePaletteByTag - adds r0, r6, 0 - bl DestroyTask -_0802EC8A: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EB98 - - thumb_func_start sub_802EC98 -sub_802EC98: @ 802EC98 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gSprites - adds r4, r1, r0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x7 - bls _0802ECB2 - b _0802EDC4 -_0802ECB2: - lsls r0, 2 - ldr r1, =_0802ECC4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802ECC4: - .4byte _0802ECE4 - .4byte _0802ECF6 - .4byte _0802ED1C - .4byte _0802ED2C - .4byte _0802ED4E - .4byte _0802ED86 - .4byte _0802EDAC - .4byte _0802ED82 -_0802ECE4: - movs r1, 0x80 - lsls r1, 4 - adds r0, r4, 0 - movs r2, 0x1A - bl sub_8007E18 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0802ECF6: - movs r2, 0x32 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0802ED04 - movs r0, 0x39 - bl PlaySE -_0802ED04: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0802EDC4 - movs r0, 0 - strh r0, [r4, 0x32] - adds r0, r4, 0 - movs r1, 0x1 - b _0802EDA2 -_0802ED1C: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0802EDC4 - b _0802EDA6 -_0802ED2C: - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0802EDC4 - movs r0, 0 - strh r0, [r4, 0x32] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - adds r0, r4, 0 - movs r1, 0x2 - bl StartSpriteAffineAnim - b _0802EDC4 -_0802ED4E: - ldrh r0, [r4, 0x22] - subs r0, 0x4 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0802EDC4 - ldrh r1, [r4, 0x36] - movs r2, 0x36 - ldrsh r0, [r4, r2] - cmp r0, 0x1 - bgt _0802ED7E - adds r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - movs r0, 0 - strh r0, [r4, 0x32] - b _0802EDA6 -_0802ED7E: - movs r0, 0x7 - strh r0, [r4, 0x2E] -_0802ED82: - movs r0, 0 - b _0802EDC6 -_0802ED86: - ldrh r0, [r4, 0x22] - adds r0, 0x4 - strh r0, [r4, 0x22] - ldrh r0, [r4, 0x32] - adds r0, 0x1 - strh r0, [r4, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0802EDC4 - movs r0, 0 - strh r0, [r4, 0x32] - adds r0, r4, 0 - movs r1, 0x3 -_0802EDA2: - bl StartSpriteAffineAnim -_0802EDA6: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - b _0802EDC2 -_0802EDAC: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0802EDC4 - ldrh r0, [r4, 0x36] - adds r0, 0x1 - strh r0, [r4, 0x36] - movs r0, 0x1 -_0802EDC2: - strh r0, [r4, 0x2E] -_0802EDC4: - movs r0, 0x1 -_0802EDC6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802EC98 - - thumb_func_start sub_802EDCC -sub_802EDCC: @ 802EDCC - push {r4-r6,lr} - mov r6, r8 - push {r6} - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gSprites - mov r8, r0 - lsls r4, r1, 4 - adds r4, r1 - lsls r4, 2 - adds r5, r4, r0 - ldr r0, =0x0000ffd8 - strh r0, [r5, 0x26] - lsls r3, r2, 4 - adds r3, r2 - lsls r3, 2 - mov r1, r8 - adds r2, r3, r1 - strh r0, [r2, 0x26] - adds r5, 0x3E - ldrb r6, [r5] - movs r1, 0x5 - negs r1, r1 - adds r0, r1, 0 - ands r0, r6 - strb r0, [r5] - adds r2, 0x3E - ldrb r0, [r2] - ands r1, r0 - strb r1, [r2] - movs r0, 0x1C - add r8, r0 - add r4, r8 - ldr r0, =sub_802EE5C - str r0, [r4] - add r3, r8 - str r0, [r3] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EDCC - - thumb_func_start sub_802EE30 -sub_802EE30: @ 802EE30 - push {lr} - lsls r0, 24 - lsrs r0, 24 - movs r3, 0 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r2, 0x1C - adds r1, r2 - ldr r1, [r1] - ldr r0, =sub_802EE5C - cmp r1, r0 - bne _0802EE4E - movs r3, 0x1 -_0802EE4E: - adds r0, r3, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_802EE30 - - thumb_func_start sub_802EE5C -sub_802EE5C: @ 802EE5C - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r4, 0x2E - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x4 - bhi _0802EF46 - lsls r0, 2 - ldr r1, =_0802EE7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802EE7C: - .4byte _0802EE90 - .4byte _0802EEA0 - .4byte _0802EEC8 - .4byte _0802EEFC - .4byte _0802EF34 -_0802EE90: - movs r0, 0x40 - strh r0, [r4, 0x8] - ldrh r0, [r5, 0x26] - lsls r0, 4 - strh r0, [r4, 0xA] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_0802EEA0: - ldrh r1, [r4, 0x8] - ldrh r2, [r4, 0xA] - adds r0, r1, r2 - strh r0, [r4, 0xA] - adds r1, 0x1 - strh r1, [r4, 0x8] - lsls r0, 16 - asrs r0, 20 - strh r0, [r5, 0x26] - cmp r0, 0 - blt _0802EF46 - movs r0, 0x39 - bl PlaySE - movs r0, 0 - strh r0, [r5, 0x26] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] - b _0802EF46 -_0802EEC8: - ldrh r0, [r4, 0x2] - adds r0, 0xC - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _0802EEE6 - movs r0, 0x39 - bl PlaySE - movs r0, 0 - strh r0, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_0802EEE6: - ldr r0, =gSineTable - movs r2, 0x2 - ldrsh r1, [r4, r2] - lsls r1, 1 - adds r1, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - asrs r0, 4 - b _0802EF2A - .pool -_0802EEFC: - ldrh r0, [r4, 0x2] - adds r0, 0x10 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7F - ble _0802EF1A - movs r0, 0x39 - bl PlaySE - movs r0, 0 - strh r0, [r4, 0x2] - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_0802EF1A: - ldr r1, =gSineTable - movs r2, 0x2 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - ldrh r0, [r0] - lsls r0, 16 - asrs r0, 21 -_0802EF2A: - negs r0, r0 - strh r0, [r5, 0x26] - b _0802EF46 - .pool -_0802EF34: - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x28 - ble _0802EF46 - ldr r0, =SpriteCallbackDummy - str r0, [r5, 0x1C] -_0802EF46: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EE5C - - thumb_func_start sub_802EF50 -sub_802EF50: @ 802EF50 - push {r4,lr} - sub sp, 0x10 - lsls r1, 16 - lsrs r1, 16 - ldr r2, =gUnknown_082FEBCC - ldr r3, [r2, 0x4] - ldr r2, [r2] - str r2, [sp] - str r3, [sp, 0x4] - ldr r2, =gUnknown_082FEBD4 - ldr r3, [r2, 0x4] - ldr r2, [r2] - str r2, [sp, 0x8] - str r3, [sp, 0xC] - lsls r0, 16 - ldr r3, =0x0000ffff - ldr r2, [sp, 0x4] - ands r2, r3 - orrs r2, r0 - str r2, [sp, 0x4] - ldr r2, =0xffff0000 - add r4, sp, 0x8 - ldr r0, [r4, 0x4] - ands r0, r2 - orrs r0, r1 - str r0, [r4, 0x4] - mov r0, sp - bl LoadCompressedSpriteSheet - adds r0, r4, 0 - bl LoadSpritePalette - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EF50 - - thumb_func_start sub_802EFA8 -sub_802EFA8: @ 802EFA8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - mov r12, r3 - ldr r3, [sp, 0x30] - lsls r1, 16 - lsrs r1, 16 - lsls r3, 24 - lsrs r3, 24 - mov r8, r3 - mov r5, sp - ldr r4, =gUnknown_082FEC90 - ldm r4!, {r3,r6,r7} - stm r5!, {r3,r6,r7} - ldm r4!, {r3,r6,r7} - stm r5!, {r3,r6,r7} - mov r4, sp - strh r0, [r4] - mov r0, sp - strh r1, [r0, 0x2] - lsls r2, 16 - asrs r2, 16 - mov r0, r12 - lsls r6, r0, 16 - asrs r6, 16 - mov r0, sp - adds r1, r2, 0 - adds r2, r6, 0 - mov r3, r8 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_802EFA8 - - thumb_func_start sub_802EFFC -sub_802EFFC: @ 802EFFC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - mov r12, r3 - ldr r6, [sp, 0x38] - ldr r3, [sp, 0x3C] - mov r9, r3 - ldr r4, [sp, 0x40] - mov r8, r4 - lsls r1, 16 - lsrs r1, 16 - lsls r6, 24 - lsrs r6, 24 - mov r10, r6 - mov r4, sp - ldr r3, =gUnknown_082FECA8 - ldm r3!, {r5-r7} - stm r4!, {r5-r7} - ldm r3!, {r5-r7} - stm r4!, {r5-r7} - mov r3, sp - strh r0, [r3] - mov r0, sp - strh r1, [r0, 0x2] - lsls r2, 16 - asrs r4, r2, 16 - ldr r0, =0xffe00000 - adds r2, r0 - asrs r2, 16 - mov r1, r12 - lsls r5, r1, 16 - asrs r5, 16 - mov r0, sp - adds r1, r2, 0 - adds r2, r5, 0 - mov r3, r10 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - mov r3, r9 - strh r0, [r3] - adds r4, 0x20 - lsls r4, 16 - asrs r4, 16 - mov r0, sp - adds r1, r4, 0 - adds r2, r5, 0 - mov r3, r10 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - mov r4, r8 - strh r0, [r4] - ldr r2, =gSprites - mov r5, r9 - movs r6, 0 - ldrsh r1, [r5, r6] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - movs r3, 0x4 - orrs r1, r3 - strb r1, [r0] - movs r7, 0 - ldrsh r1, [r4, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r3 - strb r1, [r0] - movs r0, 0 - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x1 - bl StartSpriteAnim - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_802EFFC - - .align 2, 0 @ don't pad with nop diff --git a/asm/pokenav_unk_10.s b/asm/pokenav_unk_10.s deleted file mode 100644 index bf621e6a6..000000000 --- a/asm/pokenav_unk_10.s +++ /dev/null @@ -1,1309 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - thumb_func_start sub_81D0450 -sub_81D0450: @ 81D0450 - push {r4,lr} - movs r0, 0xD - movs r1, 0x9C - bl AllocSubstruct - adds r4, r0, 0 - cmp r4, 0 - beq _081D0498 - movs r0, 0x12 - bl GetSubstructPtr - str r0, [r4, 0x8] - cmp r0, 0 - beq _081D0498 - adds r0, r4, 0 - bl sub_81D0814 - adds r1, r4, 0 - adds r1, 0x98 - ldr r0, =sub_81D04C4 - str r0, [r1] - ldr r1, =gKeyRepeatContinueDelay - movs r0, 0x3 - strh r0, [r1] - ldr r1, =gKeyRepeatStartDelay - movs r0, 0xA - strh r0, [r1] - movs r0, 0x1 - b _081D049A - .pool -_081D0498: - movs r0, 0 -_081D049A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D0450 - - thumb_func_start sub_81D04A0 -sub_81D04A0: @ 81D04A0 - push {lr} - movs r0, 0xD - bl GetSubstructPtr - adds r1, r0, 0 - adds r1, 0x98 - ldr r1, [r1] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_81D04A0 - - thumb_func_start sub_81D04B8 -sub_81D04B8: @ 81D04B8 - push {lr} - movs r0, 0xD - bl FreePokenavSubstruct - pop {r0} - bx r0 - thumb_func_end sub_81D04B8 - - thumb_func_start sub_81D04C4 -sub_81D04C4: @ 81D04C4 - push {r4,lr} - adds r4, r0, 0 - ldr r2, =gMain - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081D04E4 - ldr r3, [r4, 0x8] - ldrh r0, [r3, 0x2] - cmp r0, 0 - beq _081D04E4 - subs r0, 0x1 - b _081D04FC - .pool -_081D04E4: - ldrh r1, [r2, 0x30] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081D050C - ldr r3, [r4, 0x8] - ldrh r1, [r3, 0x2] - ldrh r0, [r3] - subs r0, 0x1 - cmp r1, r0 - bge _081D050C - adds r0, r1, 0x1 -_081D04FC: - movs r1, 0 - strh r0, [r3, 0x2] - strh r1, [r4, 0xC] - adds r0, r4, 0 - bl sub_81D0814 - movs r0, 0x1 - b _081D053E -_081D050C: - ldrh r2, [r2, 0x2E] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _081D0528 - adds r1, r4, 0 - adds r1, 0x98 - ldr r0, =sub_81D0548 - str r0, [r1] - movs r0, 0x2 - b _081D053E - .pool -_081D0528: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - bne _081D0534 - movs r0, 0 - b _081D053E -_081D0534: - adds r1, r4, 0 - adds r1, 0x98 - ldr r0, =sub_81D05D4 - str r0, [r1] - movs r0, 0x5 -_081D053E: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D04C4 - - thumb_func_start sub_81D0548 -sub_81D0548: @ 81D0548 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081D0562 - adds r0, r4, 0 - bl sub_81D05DC - cmp r0, 0 - bne _081D05A4 -_081D0562: - ldr r0, =gMain - ldrh r1, [r0, 0x30] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081D0578 - adds r0, r4, 0 - bl sub_81D061C - cmp r0, 0 - bne _081D05A4 -_081D0578: - ldr r0, =gMain - ldrh r1, [r0, 0x30] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081D058E - adds r0, r4, 0 - bl sub_81D0664 - cmp r0, 0 - bne _081D05A4 -_081D058E: - ldr r0, =gMain - ldrh r1, [r0, 0x30] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _081D05AC - adds r0, r4, 0 - bl sub_81D0688 - cmp r0, 0 - beq _081D05AC -_081D05A4: - movs r0, 0x3 - b _081D05CA - .pool -_081D05AC: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081D05C0 - movs r0, 0 - b _081D05CA - .pool -_081D05C0: - adds r1, r4, 0 - adds r1, 0x98 - ldr r0, =sub_81D04C4 - str r0, [r1] - movs r0, 0x4 -_081D05CA: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D0548 - - thumb_func_start sub_81D05D4 -sub_81D05D4: @ 81D05D4 - ldr r0, =0x000186ae - bx lr - .pool - thumb_func_end sub_81D05D4 - - thumb_func_start sub_81D05DC -sub_81D05DC: @ 81D05DC - push {r4,lr} - adds r1, r0, 0 - ldrh r0, [r1, 0xC] - adds r2, r0, 0 - cmp r2, 0x18 - bhi _081D05F0 - cmp r2, 0x8 - bls _081D0612 - subs r0, 0x9 - b _081D060C -_081D05F0: - ldrh r3, [r1, 0x10] - adds r2, r3, 0 - cmp r2, 0 - beq _081D0612 - ldrh r0, [r1, 0xC] - subs r0, 0x1B - ldrh r4, [r1, 0xE] - adds r0, r4 - strh r0, [r1, 0xC] - lsls r0, 16 - lsrs r0, 16 - cmp r0, r2 - bcc _081D060E - subs r0, r3, 0x1 -_081D060C: - strh r0, [r1, 0xC] -_081D060E: - movs r0, 0x1 - b _081D0614 -_081D0612: - movs r0, 0 -_081D0614: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D05DC - - thumb_func_start sub_81D061C -sub_81D061C: @ 81D061C - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0xC] - adds r1, r0, 0 - cmp r1, 0x18 - bhi _081D065C - ldrh r3, [r2, 0xE] - cmp r1, r3 - bcs _081D0640 - adds r0, 0x9 - strh r0, [r2, 0xC] - ldrh r1, [r2, 0x10] - lsls r0, 16 - lsrs r0, 16 - cmp r0, r1 - bcc _081D0658 - subs r0, r1, 0x1 - b _081D0656 -_081D0640: - ldrh r0, [r2, 0x12] - cmp r0, 0 - beq _081D065C - ldrh r1, [r2, 0xC] - ldrh r0, [r2, 0xE] - subs r0, r1, r0 - ldrh r1, [r2, 0x12] - cmp r0, r1 - blt _081D0654 - subs r0, r1, 0x1 -_081D0654: - adds r0, 0x1B -_081D0656: - strh r0, [r2, 0xC] -_081D0658: - movs r0, 0x1 - b _081D065E -_081D065C: - movs r0, 0 -_081D065E: - pop {r1} - bx r1 - thumb_func_end sub_81D061C - - thumb_func_start sub_81D0664 -sub_81D0664: @ 81D0664 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r4, [r5, 0xC] - adds r0, r4, 0 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _081D067C - movs r0, 0 - b _081D0682 -_081D067C: - subs r0, r4, 0x1 - strh r0, [r5, 0xC] - movs r0, 0x1 -_081D0682: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0664 - - thumb_func_start sub_81D0688 -sub_81D0688: @ 81D0688 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r4, [r5, 0xC] - adds r0, r4, 0 - movs r1, 0x9 - bl __umodsi3 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x7 - bgt _081D06BC - cmp r4, 0x1A - bhi _081D06AC - ldrh r0, [r5, 0x10] - subs r0, 0x1 - cmp r4, r0 - bge _081D06BC - b _081D06B4 -_081D06AC: - ldrh r0, [r5, 0x12] - subs r0, 0x1 - cmp r1, r0 - bge _081D06BC -_081D06B4: - adds r0, r4, 0x1 - strh r0, [r5, 0xC] - movs r0, 0x1 - b _081D06BE -_081D06BC: - movs r0, 0 -_081D06BE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0688 - - thumb_func_start sub_81D06C4 -sub_81D06C4: @ 81D06C4 - push {lr} - movs r0, 0xD - bl GetSubstructPtr - ldr r0, [r0, 0x8] - ldrh r0, [r0, 0x2] - pop {r1} - bx r1 - thumb_func_end sub_81D06C4 - - thumb_func_start sub_81D06D4 -sub_81D06D4: @ 81D06D4 - push {lr} - movs r0, 0xD - bl GetSubstructPtr - ldr r0, [r0, 0x8] - ldrh r0, [r0] - pop {r1} - bx r1 - thumb_func_end sub_81D06D4 - - thumb_func_start sub_81D06E4 -sub_81D06E4: @ 81D06E4 - push {r4-r7,lr} - adds r5, r0, 0 - adds r7, r1, 0 - adds r6, r2, 0 - movs r0, 0xD - bl GetSubstructPtr - ldr r1, [r0, 0x8] - ldrh r0, [r1, 0x2] - lsls r0, 2 - adds r0, 0x4 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xE - bne _081D0730 - ldrb r1, [r1, 0x1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x2 - adds r2, r5, 0 - bl GetMonData - adds r0, r4, 0 - bl GetLevelFromMonExp - strb r0, [r7] - adds r0, r4, 0 - bl GetMonGender - strb r0, [r6] - b _081D0752 - .pool -_081D0730: - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - bl GetBoxedMonPtr - adds r4, r0, 0 - bl GetBoxMonGender - strb r0, [r6] - adds r0, r4, 0 - bl GetLevelFromBoxMonExp - strb r0, [r7] - adds r0, r4, 0 - movs r1, 0x2 - adds r2, r5, 0 - bl GetBoxMonData -_081D0752: - adds r0, r5, 0 - bl StringGetEnd10 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D06E4 - - thumb_func_start sub_81D0760 -sub_81D0760: @ 81D0760 - push {r4-r7,lr} - adds r5, r0, 0 - adds r6, r1, 0 - adds r7, r2, 0 - movs r0, 0xD - bl GetSubstructPtr - ldr r1, [r0, 0x8] - ldrh r0, [r1, 0x2] - lsls r0, 2 - adds r0, 0x4 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xE - bne _081D07AC - ldrb r1, [r1, 0x1] - movs r0, 0x64 - adds r4, r1, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0 - bl GetMonData - str r0, [r6] - adds r0, r4, 0 - movs r1, 0x1 - bl GetMonData - b _081D07D0 - .pool -_081D07AC: - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - bl GetBoxedMonPtr - adds r4, r0, 0 - movs r1, 0xB - bl GetBoxMonData - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0 - bl GetBoxMonData - str r0, [r6] - adds r0, r4, 0 - movs r1, 0x1 - bl GetBoxMonData -_081D07D0: - str r0, [r7] - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D0760 - - thumb_func_start sub_81D07D8 -sub_81D07D8: @ 81D07D8 - push {lr} - movs r0, 0xD - bl GetSubstructPtr - ldr r1, [r0, 0x8] - ldrh r0, [r1, 0x2] - lsls r0, 2 - adds r0, 0x4 - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0xE - beq _081D07FA - ldrb r1, [r1, 0x1] - movs r2, 0x52 - bl GetBoxMonDataAt - b _081D080A -_081D07FA: - ldrb r1, [r1, 0x1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x52 - bl GetMonData -_081D080A: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81D07D8 - - thumb_func_start sub_81D0814 -sub_81D0814: @ 81D0814 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r5, r0, 0 - ldr r0, [r5, 0x8] - ldrh r1, [r0, 0x2] - lsls r1, 2 - adds r1, 0x4 - adds r1, r0, r1 - ldrb r0, [r1] - cmp r0, 0xE - bne _081D0848 - ldrb r1, [r1, 0x1] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x53 - bl GetMonData - b _081D0852 - .pool -_081D0848: - ldrb r0, [r1] - ldrb r1, [r1, 0x1] - movs r2, 0x53 - bl GetBoxMonDataAt -_081D0852: - mov r12, r0 - movs r0, 0 - strh r0, [r5, 0x10] - strh r0, [r5, 0x12] - movs r6, 0 - ldr r0, =gUnknown_086237F8 - mov r9, r0 - mov r10, r9 -_081D0862: - lsls r2, r6, 2 - mov r3, r9 - adds r1, r2, r3 - movs r0, 0x1 - ldrb r3, [r1] - lsls r0, r3 - subs r4, r0, 0x1 - mov r0, r12 - ands r4, r0 - ldrb r0, [r1, 0x3] - adds r7, r2, 0 - cmp r0, 0 - bne _081D08AC - movs r3, 0 - adds r6, 0x1 - mov r8, r6 - cmp r3, r4 - bge _081D08D6 - adds r6, r5, 0 - adds r6, 0x14 - mov r1, r10 - adds r0, r7, r1 - ldrb r2, [r0, 0x2] -_081D0890: - ldrh r0, [r5, 0x10] - adds r1, r0, 0x1 - strh r1, [r5, 0x10] - lsls r0, 16 - lsrs r0, 14 - adds r0, r6, r0 - adds r1, r2, r3 - str r1, [r0] - adds r3, 0x1 - cmp r3, r4 - blt _081D0890 - b _081D08D6 - .pool -_081D08AC: - movs r3, 0 - adds r6, 0x1 - mov r8, r6 - cmp r3, r4 - bge _081D08D6 - adds r6, r5, 0 - adds r6, 0x78 - mov r1, r10 - adds r0, r7, r1 - ldrb r2, [r0, 0x2] -_081D08C0: - ldrh r0, [r5, 0x12] - adds r1, r0, 0x1 - strh r1, [r5, 0x12] - lsls r0, 16 - lsrs r0, 14 - adds r0, r6, r0 - adds r1, r2, r3 - str r1, [r0] - adds r3, 0x1 - cmp r3, r4 - blt _081D08C0 -_081D08D6: - mov r3, r9 - adds r0, r7, r3 - mov r1, r12 - ldrb r0, [r0] - lsrs r1, r0 - mov r12, r1 - mov r6, r8 - cmp r6, 0x10 - bls _081D0862 - ldrh r0, [r5, 0x10] - cmp r0, 0 - beq _081D0900 - subs r0, 0x1 - movs r1, 0x9 - bl __divsi3 - lsls r1, r0, 3 - adds r1, r0 - movs r0, 0 - strh r1, [r5, 0xE] - b _081D0904 -_081D0900: - strh r0, [r5, 0xE] - movs r0, 0x1B -_081D0904: - strh r0, [r5, 0xC] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81D0814 - - thumb_func_start sub_81D0914 -sub_81D0914: @ 81D0914 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xD - bl GetSubstructPtr - ldrh r1, [r0, 0x10] - str r1, [r4] - adds r0, 0x14 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D0914 - - thumb_func_start sub_81D092C -sub_81D092C: @ 81D092C - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xD - bl GetSubstructPtr - ldrh r1, [r0, 0x12] - str r1, [r4] - adds r0, 0x78 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D092C - - thumb_func_start sub_81D0944 -sub_81D0944: @ 81D0944 - push {lr} - movs r0, 0xD - bl GetSubstructPtr - ldrh r0, [r0, 0xC] - pop {r1} - bx r1 - thumb_func_end sub_81D0944 - - thumb_func_start sub_81D0954 -sub_81D0954: @ 81D0954 - push {lr} - movs r0, 0xD - bl GetSubstructPtr - adds r1, r0, 0 - ldrh r0, [r1, 0xC] - cmp r0, 0x18 - ble _081D096C - subs r0, 0x1B - lsls r0, 2 - adds r1, 0x78 - b _081D0970 -_081D096C: - lsls r0, 2 - adds r1, 0x14 -_081D0970: - adds r1, r0 - ldr r0, [r1] - pop {r1} - bx r1 - thumb_func_end sub_81D0954 - - thumb_func_start sub_81D0978 -sub_81D0978: @ 81D0978 - push {r4,lr} - ldr r1, =0x0000101c - movs r0, 0xE - bl AllocSubstruct - adds r4, r0, 0 - cmp r4, 0 - beq _081D09A8 - ldr r0, =sub_81D0A6C - movs r1, 0x1 - bl CreateLoopedTask - str r0, [r4, 0x4] - ldr r0, =sub_81D0A58 - str r0, [r4] - movs r0, 0x1 - b _081D09AA - .pool -_081D09A8: - movs r0, 0 -_081D09AA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81D0978 - - thumb_func_start sub_81D09B0 -sub_81D09B0: @ 81D09B0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xE - bl GetSubstructPtr - adds r5, r0, 0 - ldr r0, =gUnknown_08624BA0 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0x1 - bl CreateLoopedTask - str r0, [r5, 0x4] - ldr r0, =sub_81D0A58 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81D09B0 - - thumb_func_start sub_81D09E0 -sub_81D09E0: @ 81D09E0 - push {lr} - movs r0, 0xE - bl GetSubstructPtr - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - thumb_func_end sub_81D09E0 - - thumb_func_start sub_81D09F4 -sub_81D09F4: @ 81D09F4 - push {r4,lr} - movs r0, 0xE - bl GetSubstructPtr - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl RemoveWindow - ldrb r0, [r4, 0x8] - bl RemoveWindow - ldrb r0, [r4, 0xC] - bl RemoveWindow - ldrb r0, [r4, 0xE] - bl RemoveWindow - adds r0, r4, 0 - bl sub_81D1178 - movs r0, 0x9 - bl FreeSpriteTilesByTag - movs r0, 0xF - bl FreeSpritePaletteByTag - movs r0, 0x10 - bl FreeSpritePaletteByTag - movs r0, 0x11 - bl FreeSpritePaletteByTag - movs r0, 0x12 - bl FreeSpritePaletteByTag - movs r0, 0x13 - bl FreeSpritePaletteByTag - ldr r0, [r4, 0x14] - bl FreeSpriteOamMatrix - ldr r0, [r4, 0x14] - bl DestroySprite - movs r0, 0xE - bl FreePokenavSubstruct - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81D09F4 - - thumb_func_start sub_81D0A58 -sub_81D0A58: @ 81D0A58 - push {lr} - movs r0, 0xE - bl GetSubstructPtr - ldr r0, [r0, 0x4] - bl IsLoopedTaskActive - pop {r1} - bx r1 - thumb_func_end sub_81D0A58 - - thumb_func_start sub_81D0A6C -sub_81D0A6C: @ 81D0A6C - push {r4,r5,lr} - sub sp, 0x8 - adds r4, r0, 0 - movs r0, 0xE - bl GetSubstructPtr - adds r5, r0, 0 - cmp r4, 0x9 - bls _081D0A80 - b _081D0C48 -_081D0A80: - lsls r0, r4, 2 - ldr r1, =_081D0A90 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D0A90: - .4byte _081D0AB8 - .4byte _081D0B04 - .4byte _081D0B74 - .4byte _081D0B88 - .4byte _081D0B9C - .4byte _081D0BB0 - .4byte _081D0BC4 - .4byte _081D0BD8 - .4byte _081D0BE8 - .4byte _081D0C3C -_081D0AB8: - ldr r0, =gUnknown_08624B98 - movs r1, 0x2 - bl InitBgTemplates - ldr r1, =gUnknown_08DDE030 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - adds r1, r5, 0 - adds r1, 0x1C - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, =gUnknown_08DDE12C - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r0, =gUnknown_08DDE010 - movs r1, 0x10 - movs r2, 0x20 - bl CopyPaletteIntoBufferUnfaded - b _081D0BBA - .pool -_081D0B04: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - beq _081D0B12 - b _081D0C44 -_081D0B12: - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_8199DF0 - ldr r1, =gUnknown_086240B8 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0x1 - bl decompress_and_copy_tile_data_to_vram - ldr r0, =0x0000081c - adds r1, r5, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - movs r0, 0x20 - str r0, [sp] - movs r0, 0x14 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - ldr r0, =gUnknown_08623FF8 - movs r1, 0x20 - movs r2, 0xA0 - bl CopyPaletteIntoBufferUnfaded - ldr r0, =gUnknown_08624098 - movs r1, 0xA0 - movs r2, 0x20 - bl CopyPaletteIntoBufferUnfaded - movs r0, 0x1 - b _081D0BBC - .pool -_081D0B74: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D0E60 - movs r0, 0 - b _081D0C4A -_081D0B88: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D0FCC - movs r0, 0 - b _081D0C4A -_081D0B9C: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D10A4 - movs r0, 0 - b _081D0C4A -_081D0BB0: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 -_081D0BBA: - movs r0, 0x2 -_081D0BBC: - bl CopyBgTilemapBufferToVram - movs r0, 0 - b _081D0C4A -_081D0BC4: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D1148 - movs r0, 0x1 - b _081D0C4A -_081D0BD8: - adds r0, r5, 0 - bl sub_81D12D8 - movs r0, 0xA - bl sub_81C7BA4 - movs r0, 0 - b _081D0C4A -_081D0BE8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081D0C44 - adds r0, r5, 0 - bl sub_81D13FC - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl HideBg - movs r0, 0x1 - bl sub_81C7AC0 - movs r0, 0 - b _081D0C4A -_081D0C3C: - bl IsPaletteFadeActive - cmp r0, 0 - beq _081D0C48 -_081D0C44: - movs r0, 0x2 - b _081D0C4A -_081D0C48: - movs r0, 0x4 -_081D0C4A: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0A6C - - thumb_func_start sub_81D0C54 -sub_81D0C54: @ 81D0C54 - push {lr} - cmp r0, 0 - beq _081D0C60 - cmp r0, 0x1 - beq _081D0C70 - b _081D0C7C -_081D0C60: - movs r0, 0x5 - bl PlaySE - movs r0, 0 - bl sub_81C7AC0 - movs r0, 0 - b _081D0C7E -_081D0C70: - bl IsPaletteFadeActive - cmp r0, 0 - beq _081D0C7C - movs r0, 0x2 - b _081D0C7E -_081D0C7C: - movs r0, 0x4 -_081D0C7E: - pop {r1} - bx r1 - thumb_func_end sub_81D0C54 - - thumb_func_start sub_81D0C84 -sub_81D0C84: @ 81D0C84 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0xE - bl GetSubstructPtr - adds r4, r0, 0 - cmp r5, 0x6 - bhi _081D0D24 - lsls r0, r5, 2 - ldr r1, =_081D0CA4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081D0CA4: - .4byte _081D0CC0 - .4byte _081D0CD0 - .4byte _081D0CE4 - .4byte _081D0CEE - .4byte _081D0CF8 - .4byte _081D0D02 - .4byte _081D0D16 -_081D0CC0: - movs r0, 0x5 - bl PlaySE - adds r0, r4, 0 - bl sub_81D11D8 - movs r0, 0 - b _081D0D26 -_081D0CD0: - adds r0, r4, 0 - bl sub_81D1234 - cmp r0, 0 - bne _081D0D20 - adds r0, r4, 0 - bl sub_81D0FF0 - movs r0, 0x1 - b _081D0D26 -_081D0CE4: - adds r0, r4, 0 - bl sub_81D12D8 - movs r0, 0x1 - b _081D0D26 -_081D0CEE: - adds r0, r4, 0 - bl sub_81D10D0 - movs r0, 0x1 - b _081D0D26 -_081D0CF8: - adds r0, r4, 0 - bl sub_81D0E84 - movs r0, 0x1 - b _081D0D26 -_081D0D02: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - bne _081D0D20 - adds r0, r4, 0 - bl sub_81D11FC - movs r0, 0 - b _081D0D26 -_081D0D16: - adds r0, r4, 0 - bl sub_81D1234 - cmp r0, 0 - beq _081D0D24 -_081D0D20: - movs r0, 0x2 - b _081D0D26 -_081D0D24: - movs r0, 0x4 -_081D0D26: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0C84 - - thumb_func_start sub_81D0D2C -sub_81D0D2C: @ 81D0D2C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xE - bl GetSubstructPtr - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D0D5C - cmp r4, 0x1 - bgt _081D0D46 - cmp r4, 0 - beq _081D0D4C - b _081D0D84 -_081D0D46: - cmp r4, 0x2 - beq _081D0D76 - b _081D0D84 -_081D0D4C: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81D1448 - movs r0, 0 - b _081D0D86 -_081D0D5C: - adds r0, r5, 0 - bl sub_81D1524 - cmp r0, 0 - bne _081D0D80 - adds r0, r5, 0 - bl sub_81D0EFC - movs r0, 0xB - bl sub_81C7BA4 - movs r0, 0 - b _081D0D86 -_081D0D76: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D0D84 -_081D0D80: - movs r0, 0x2 - b _081D0D86 -_081D0D84: - movs r0, 0x4 -_081D0D86: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0D2C - - thumb_func_start sub_81D0D8C -sub_81D0D8C: @ 81D0D8C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xE - bl GetSubstructPtr - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D0DC0 - cmp r4, 0x1 - bgt _081D0DA6 - cmp r4, 0 - beq _081D0DB0 - b _081D0DF6 -_081D0DA6: - cmp r4, 0x2 - beq _081D0DD4 - cmp r4, 0x3 - beq _081D0DE8 - b _081D0DF6 -_081D0DB0: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81D1500 - movs r0, 0 - b _081D0DF8 -_081D0DC0: - adds r0, r5, 0 - bl sub_81D1524 - cmp r0, 0 - bne _081D0DF2 - adds r0, r5, 0 - bl sub_81D1448 - movs r0, 0 - b _081D0DF8 -_081D0DD4: - adds r0, r5, 0 - bl sub_81D1524 - cmp r0, 0 - bne _081D0DF2 - adds r0, r5, 0 - bl sub_81D0EFC - movs r0, 0 - b _081D0DF8 -_081D0DE8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D0DF6 -_081D0DF2: - movs r0, 0x2 - b _081D0DF8 -_081D0DF6: - movs r0, 0x4 -_081D0DF8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0D8C - - thumb_func_start sub_81D0E00 -sub_81D0E00: @ 81D0E00 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xE - bl GetSubstructPtr - adds r5, r0, 0 - cmp r4, 0x1 - beq _081D0E30 - cmp r4, 0x1 - bgt _081D0E1A - cmp r4, 0 - beq _081D0E20 - b _081D0E58 -_081D0E1A: - cmp r4, 0x2 - beq _081D0E4A - b _081D0E58 -_081D0E20: - movs r0, 0x5 - bl PlaySE - adds r0, r5, 0 - bl sub_81D1500 - movs r0, 0 - b _081D0E5A -_081D0E30: - adds r0, r5, 0 - bl sub_81D1524 - cmp r0, 0 - bne _081D0E54 - adds r0, r5, 0 - bl sub_81D0E84 - movs r0, 0xA - bl sub_81C7BA4 - movs r0, 0 - b _081D0E5A -_081D0E4A: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _081D0E58 -_081D0E54: - movs r0, 0x2 - b _081D0E5A -_081D0E58: - movs r0, 0x4 -_081D0E5A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81D0E00 - - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokenav_unk_2.s b/asm/pokenav_unk_2.s index 89a8bde9e..da83ccf55 100644 --- a/asm/pokenav_unk_2.s +++ b/asm/pokenav_unk_2.s @@ -943,7 +943,7 @@ sub_81CA0C8: @ 81CA0C8 lsls r2, r0, 3 subs r2, r0 lsls r2, 2 - ldr r1, =gUnknown_08620244 + ldr r1, =gUnknown_08620240+4 adds r0, r2, r1 subs r1, 0x4 adds r2, r1 diff --git a/asm/pokenav_unk_6.s b/asm/pokenav_unk_6.s deleted file mode 100644 index f5e017816..000000000 --- a/asm/pokenav_unk_6.s +++ /dev/null @@ -1,1752 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - -@ File centered around AllocSubstruct(0xB) - - thumb_func_start sub_81CCFD8 -sub_81CCFD8: @ 81CCFD8 - push {r4,lr} - ldr r1, =0x0000678c - movs r0, 0xB - bl AllocSubstruct - adds r4, r0, 0 - cmp r4, 0 - beq _081CD01C - ldr r1, =0x00006428 - adds r0, r4, r1 - bl sub_81D1ED4 - bl sub_81CD970 - ldr r1, =gKeyRepeatStartDelay - movs r0, 0x14 - strh r0, [r1] - ldr r0, =0x00006304 - adds r1, r4, r0 - ldr r0, =sub_81CD08C - str r0, [r1] - movs r0, 0x1 - b _081CD01E - .pool -_081CD01C: - movs r0, 0 -_081CD01E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CCFD8 - - thumb_func_start sub_81CD024 -sub_81CD024: @ 81CD024 - push {r4,lr} - ldr r1, =0x0000678c - movs r0, 0xB - bl AllocSubstruct - adds r4, r0, 0 - cmp r4, 0 - beq _081CD068 - ldr r1, =0x00006428 - adds r0, r4, r1 - bl sub_81D1ED4 - bl sub_81CD9F8 - ldr r1, =gKeyRepeatStartDelay - movs r0, 0x14 - strh r0, [r1] - ldr r0, =0x00006304 - adds r1, r4, r0 - ldr r0, =sub_81CD08C - str r0, [r1] - movs r0, 0x1 - b _081CD06A - .pool -_081CD068: - movs r0, 0 -_081CD06A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CD024 - - thumb_func_start sub_81CD070 -sub_81CD070: @ 81CD070 - push {lr} - movs r0, 0xB - bl GetSubstructPtr - ldr r2, =0x00006304 - adds r1, r0, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD070 - - thumb_func_start sub_81CD08C -sub_81CD08C: @ 81CD08C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x12 - bl GetSubstructPtr - adds r5, r0, 0 - adds r0, r4, 0 - bl sub_81CD1E4 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - bne _081CD100 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _081CD0D0 - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081CD100 - movs r1, 0xC6 - lsls r1, 7 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081CD0F0 - ldrh r1, [r5, 0x2] - ldrh r0, [r5] - subs r0, 0x1 - cmp r1, r0 - bne _081CD100 -_081CD0D0: - movs r0, 0x5 - bl PlaySE - ldr r0, =0x00006304 - adds r1, r4, r0 - ldr r0, =sub_81CD19C - str r0, [r1] - movs r2, 0x2 - b _081CD100 - .pool -_081CD0F0: - movs r0, 0x5 - bl PlaySE - movs r2, 0x5 - ldr r0, =0x00006304 - adds r1, r4, r0 - ldr r0, =sub_81CD110 - str r0, [r1] -_081CD100: - adds r0, r2, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD08C - - thumb_func_start sub_81CD110 -sub_81CD110: @ 81CD110 - push {r4-r6,lr} - sub sp, 0x4 - adds r6, r0, 0 - movs r4, 0 - bl sub_811FBA4 - lsls r0, 24 - cmp r0, 0 - bne _081CD18A - bl sub_81CEF14 - ldr r1, =0x00006786 - adds r5, r6, r1 - movs r1, 0 - ldrsb r1, [r5, r1] - ldr r2, =0x00006783 - adds r4, r6, r2 - adds r1, r4, r1 - strb r0, [r1] - movs r0, 0x12 - bl GetSubstructPtr - ldrh r1, [r0, 0x2] - lsls r1, 2 - adds r0, r1 - ldrb r2, [r0, 0x4] - ldrb r3, [r0, 0x5] - movs r0, 0 - ldrsb r0, [r5, r0] - adds r4, r0 - ldrb r1, [r4] - mov r0, sp - strb r1, [r0] - cmp r2, 0xE - bne _081CD174 - movs r0, 0x64 - muls r0, r3 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x8 - mov r2, sp - bl SetMonData - b _081CD180 - .pool -_081CD174: - adds r0, r2, 0 - adds r1, r3, 0 - movs r2, 0x8 - mov r3, sp - bl SetBoxMonDataAt -_081CD180: - ldr r0, =0x00006304 - adds r1, r6, r0 - ldr r0, =sub_81CD08C - str r0, [r1] - movs r4, 0x6 -_081CD18A: - adds r0, r4, 0 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD110 - - thumb_func_start sub_81CD19C -sub_81CD19C: @ 81CD19C - push {lr} - movs r1, 0xC6 - lsls r1, 7 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081CD1B4 - ldr r0, =0x000186aa - b _081CD1B6 - .pool -_081CD1B4: - ldr r0, =0x000186a2 -_081CD1B6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD19C - - thumb_func_start sub_81CD1C0 -sub_81CD1C0: @ 81CD1C0 - push {lr} - movs r0, 0xB - bl GetSubstructPtr - movs r1, 0xC6 - lsls r1, 7 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081CD1DA - movs r0, 0x12 - bl FreePokenavSubstruct -_081CD1DA: - movs r0, 0xB - bl FreePokenavSubstruct - pop {r0} - bx r0 - thumb_func_end sub_81CD1C0 - - thumb_func_start sub_81CD1E4 -sub_81CD1E4: @ 81CD1E4 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x12 - bl GetSubstructPtr - adds r2, r0, 0 - movs r3, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081CD220 - movs r1, 0xC6 - lsls r1, 7 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081CD210 - ldrh r0, [r2, 0x2] - cmp r0, 0 - beq _081CD24E -_081CD210: - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - b _081CD246 - .pool -_081CD220: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081CD24E - movs r1, 0xC6 - lsls r1, 7 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081CD23E - ldrh r1, [r2, 0x2] - ldrh r0, [r2] - subs r0, 0x1 - cmp r1, r0 - bge _081CD24E -_081CD23E: - movs r0, 0x5 - bl PlaySE - movs r0, 0 -_081CD246: - bl sub_81CD258 - lsls r0, 24 - lsrs r3, r0, 24 -_081CD24E: - adds r0, r3, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CD1E4 - - thumb_func_start sub_81CD258 -sub_81CD258: @ 81CD258 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0xB - bl GetSubstructPtr - adds r4, r0, 0 - movs r0, 0x12 - bl GetSubstructPtr - adds r5, r0, 0 - mov r0, r8 - cmp r0, 0 - beq _081CD284 - ldr r1, =0x00006788 - adds r0, r4, r1 - b _081CD288 - .pool -_081CD284: - ldr r2, =0x00006787 - adds r0, r4, r2 -_081CD288: - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - lsls r0, 16 - lsrs r0, 16 - adds r7, r0, 0 - ldr r1, =0x00006428 - adds r0, r4, r1 - ldr r2, =0x00006786 - adds r1, r4, r2 - movs r2, 0 - ldrsb r2, [r1, r2] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 2 - ldr r3, =0x0000643c - adds r1, r3 - adds r1, r4, r1 - lsls r2, r7, 2 - adds r2, r7 - lsls r2, 2 - adds r2, r3 - adds r2, r4, r2 - bl sub_81D1F84 - ldrh r6, [r5, 0x2] - bl sub_81CDD5C - cmp r0, 0 - beq _081CD2D8 - ldrh r1, [r5] - b _081CD2DC - .pool -_081CD2D8: - ldrh r1, [r5] - subs r1, 0x1 -_081CD2DC: - eors r1, r6 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - adds r6, r0, 0 - mov r0, r8 - cmp r0, 0 - beq _081CD332 - ldr r1, =0x00006787 - adds r2, r4, r1 - ldrb r0, [r2] - adds r1, 0x1 - adds r3, r4, r1 - strb r0, [r3] - ldr r0, =0x00006786 - adds r1, r4, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r7, [r1] - ldrb r1, [r3] - ldr r2, =0x00006789 - adds r0, r4, r2 - strb r1, [r0] - ldrh r0, [r5, 0x2] - cmp r0, 0 - bne _081CD312 - ldrh r0, [r5] -_081CD312: - subs r1, r0, 0x1 - strh r1, [r5, 0x2] - lsls r0, r1, 16 - cmp r0, 0 - beq _081CD32C - subs r1, 0x1 - b _081CD384 - .pool -_081CD32C: - ldrh r0, [r5] - subs r1, r0, 0x1 - b _081CD384 -_081CD332: - ldr r0, =0x00006788 - adds r2, r4, r0 - ldrb r0, [r2] - ldr r1, =0x00006787 - adds r3, r4, r1 - strb r0, [r3] - ldr r0, =0x00006786 - adds r1, r4, r0 - ldrb r0, [r1] - strb r0, [r2] - strb r7, [r1] - ldrb r1, [r3] - ldr r2, =0x00006789 - adds r0, r4, r2 - strb r1, [r0] - ldrh r1, [r5, 0x2] - ldrh r0, [r5] - subs r0, 0x1 - cmp r1, r0 - bge _081CD370 - adds r0, r1, 0x1 - b _081CD372 - .pool -_081CD370: - movs r0, 0 -_081CD372: - strh r0, [r5, 0x2] - ldrh r1, [r5, 0x2] - ldrh r0, [r5] - subs r0, 0x1 - cmp r1, r0 - bge _081CD382 - adds r1, 0x1 - b _081CD384 -_081CD382: - movs r1, 0 -_081CD384: - ldr r2, =0x00006302 - adds r0, r4, r2 - strh r1, [r0] - ldrh r4, [r5, 0x2] - bl sub_81CDD5C - cmp r0, 0 - beq _081CD39C - ldrh r1, [r5] - b _081CD3A0 - .pool -_081CD39C: - ldrh r1, [r5] - subs r1, 0x1 -_081CD3A0: - eors r1, r4 - negs r0, r1 - orrs r0, r1 - lsrs r0, 31 - cmp r6, 0 - bne _081CD3B0 - movs r0, 0x3 - b _081CD3BA -_081CD3B0: - cmp r0, 0 - beq _081CD3B8 - movs r0, 0x1 - b _081CD3BA -_081CD3B8: - movs r0, 0x4 -_081CD3BA: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81CD258 - - thumb_func_start sub_81CD3C4 -sub_81CD3C4: @ 81CD3C4 - push {r4,lr} - movs r0, 0xB - bl GetSubstructPtr - adds r4, r0, 0 - movs r0, 0x12 - bl GetSubstructPtr - adds r2, r0, 0 - ldr r1, =0x0000678a - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0x9 - bls _081CD3E2 - b _081CD530 -_081CD3E2: - lsls r0, 2 - ldr r1, =_081CD3F4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CD3F4: - .4byte _081CD41C - .4byte _081CD428 - .4byte _081CD434 - .4byte _081CD440 - .4byte _081CD490 - .4byte _081CD4A8 - .4byte _081CD4C0 - .4byte _081CD4D8 - .4byte _081CD4F0 - .4byte _081CD508 -_081CD41C: - movs r1, 0x2 - ldrsh r0, [r2, r1] - movs r1, 0 - bl sub_81CD824 - b _081CD530 -_081CD428: - movs r1, 0x2 - ldrsh r0, [r2, r1] - movs r1, 0 - bl sub_81CDA1C - b _081CD530 -_081CD434: - movs r1, 0x2 - ldrsh r0, [r2, r1] - movs r1, 0 - bl sub_81CDB98 - b _081CD530 -_081CD440: - ldrh r0, [r2] - cmp r0, 0x1 - bne _081CD468 - ldr r2, =0x00006786 - adds r0, r4, r2 - movs r1, 0 - strb r1, [r0] - adds r2, 0x1 - adds r0, r4, r2 - strb r1, [r0] - adds r2, 0x1 - adds r0, r4, r2 - strb r1, [r0] - adds r2, 0x2 - adds r0, r4, r2 - strb r1, [r0] - movs r0, 0x1 - b _081CD53C - .pool -_081CD468: - ldr r0, =0x00006786 - adds r1, r4, r0 - movs r0, 0 - strb r0, [r1] - ldr r2, =0x00006787 - adds r1, r4, r2 - movs r0, 0x1 - strb r0, [r1] - ldr r0, =0x00006788 - adds r1, r4, r0 - movs r0, 0x2 - strb r0, [r1] - b _081CD530 - .pool -_081CD490: - ldrh r0, [r2, 0x2] - adds r0, 0x1 - ldrh r2, [r2] - cmp r0, r2 - blt _081CD49C - movs r0, 0 -_081CD49C: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - bl sub_81CD824 - b _081CD530 -_081CD4A8: - ldrh r0, [r2, 0x2] - adds r0, 0x1 - ldrh r2, [r2] - cmp r0, r2 - blt _081CD4B4 - movs r0, 0 -_081CD4B4: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - bl sub_81CDA1C - b _081CD530 -_081CD4C0: - ldrh r0, [r2, 0x2] - adds r0, 0x1 - ldrh r2, [r2] - cmp r0, r2 - blt _081CD4CC - movs r0, 0 -_081CD4CC: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - bl sub_81CDB98 - b _081CD530 -_081CD4D8: - ldrh r0, [r2, 0x2] - subs r0, 0x1 - cmp r0, 0 - bge _081CD4E4 - ldrh r0, [r2] - subs r0, 0x1 -_081CD4E4: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x2 - bl sub_81CD824 - b _081CD530 -_081CD4F0: - ldrh r0, [r2, 0x2] - subs r0, 0x1 - cmp r0, 0 - bge _081CD4FC - ldrh r0, [r2] - subs r0, 0x1 -_081CD4FC: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x2 - bl sub_81CDA1C - b _081CD530 -_081CD508: - ldrh r0, [r2, 0x2] - subs r0, 0x1 - cmp r0, 0 - bge _081CD514 - ldrh r0, [r2] - subs r0, 0x1 -_081CD514: - lsls r0, 16 - asrs r0, 16 - movs r1, 0x2 - bl sub_81CDB98 - ldr r2, =0x0000678a - adds r1, r4, r2 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _081CD53C - .pool -_081CD530: - ldr r0, =0x0000678a - adds r1, r4, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r0, 0 -_081CD53C: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD3C4 - - thumb_func_start sub_81CD548 -sub_81CD548: @ 81CD548 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r0, 0xB - bl GetSubstructPtr - adds r1, r0, 0 - cmp r4, 0x1 - beq _081CD588 - cmp r4, 0x1 - bgt _081CD566 - cmp r4, 0 - beq _081CD56C - b _081CD5C4 -_081CD566: - cmp r5, 0x2 - beq _081CD5A4 - b _081CD5C4 -_081CD56C: - ldr r2, =0x00006302 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - ldr r2, =0x00006789 - adds r1, r2 - ldrb r1, [r1] - bl sub_81CD824 - b _081CD5C4 - .pool -_081CD588: - ldr r2, =0x00006302 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - ldr r2, =0x00006789 - adds r1, r2 - ldrb r1, [r1] - bl sub_81CDA1C - b _081CD5C4 - .pool -_081CD5A4: - ldr r2, =0x00006302 - adds r0, r1, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - ldr r2, =0x00006789 - adds r1, r2 - ldrb r1, [r1] - bl sub_81CDB98 - movs r0, 0x1 - b _081CD5C6 - .pool -_081CD5C4: - movs r0, 0 -_081CD5C6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CD548 - - thumb_func_start sub_81CD5CC -sub_81CD5CC: @ 81CD5CC - push {r4,lr} - adds r4, r0, 0 - lsls r2, 16 - lsrs r2, 16 - b _081CD5E4 -_081CD5D6: - strb r3, [r4] - adds r1, 0x1 - adds r4, 0x1 - lsls r0, r2, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r2, r0, 16 -_081CD5E4: - ldrb r3, [r1] - adds r0, r3, 0 - cmp r0, 0xFF - bne _081CD5D6 - adds r1, r2, 0 - lsls r0, r1, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r2, r0, 16 - lsls r1, 16 - cmp r1, 0 - ble _081CD612 - movs r3, 0 -_081CD5FE: - strb r3, [r4] - adds r4, 0x1 - adds r1, r2, 0 - lsls r0, r1, 16 - ldr r2, =0xffff0000 - adds r0, r2 - lsrs r2, r0, 16 - lsls r1, 16 - cmp r1, 0 - bgt _081CD5FE -_081CD612: - movs r0, 0xFF - strb r0, [r4] - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD5CC - - thumb_func_start sub_81CD624 -sub_81CD624: @ 81CD624 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r2, 24 - lsrs r2, 24 - mov r10, r2 - movs r0, 0x12 - bl GetSubstructPtr - lsls r4, 2 - adds r0, r4 - ldrb r4, [r0, 0x4] - mov r8, r4 - ldrb r6, [r0, 0x5] - mov r9, r6 - movs r0, 0xFC - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x4 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x8 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0 - strb r0, [r5] - adds r5, 0x1 - movs r0, 0x9 - strb r0, [r5] - adds r5, 0x1 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x2D - movs r3, 0 - bl GetBoxOrPartyMonData - cmp r0, 0 - beq _081CD690 - ldr r1, =gText_EggNickname - adds r0, r5, 0 - movs r2, 0 - movs r3, 0xC - bl StringCopyPadded - b _081CD80E - .pool -_081CD690: - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x2 - adds r3, r5, 0 - bl GetBoxOrPartyMonData - adds r0, r5, 0 - bl StringGetEnd10 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0xB - movs r3, 0 - bl GetBoxOrPartyMonData - lsls r0, 16 - lsrs r7, r0, 16 - cmp r4, 0xE - bne _081CD6E0 - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - ldr r0, =gPlayerParty - adds r4, r0 - adds r0, r4, 0 - movs r1, 0x38 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r4, 0 - bl GetMonGender - lsls r0, 24 - lsrs r6, r0, 24 - b _081CD6FE - .pool -_081CD6E0: - mov r0, r8 - mov r1, r9 - bl GetBoxedMonPtr - adds r4, r0, 0 - bl GetBoxMonGender - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r4, 0 - bl GetLevelFromBoxMonExp - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 -_081CD6FE: - cmp r7, 0x1D - beq _081CD706 - cmp r7, 0x20 - bne _081CD71C -_081CD706: - movs r0, 0xB - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r5, 0 - bl StringCompare - cmp r0, 0 - bne _081CD71C - movs r6, 0xFF -_081CD71C: - adds r3, r5, 0 - b _081CD726 - .pool -_081CD724: - adds r3, 0x1 -_081CD726: - ldrb r0, [r3] - cmp r0, 0xFF - bne _081CD724 - movs r1, 0xFC - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x12 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x3C - strb r0, [r3] - adds r3, 0x1 - cmp r6, 0 - beq _081CD74A - cmp r6, 0xFE - beq _081CD76E - movs r0, 0x77 - b _081CD790 -_081CD74A: - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x1 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x4 - strb r0, [r3] - adds r3, 0x1 - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x3 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x5 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xB5 - b _081CD790 -_081CD76E: - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x1 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x6 - strb r0, [r3] - adds r3, 0x1 - strb r1, [r3] - adds r3, 0x1 - movs r0, 0x3 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x7 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xB6 -_081CD790: - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xFC - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x4 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x8 - strb r0, [r3] - adds r3, 0x1 - movs r5, 0 - strb r5, [r3] - adds r3, 0x1 - movs r0, 0x9 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xBA - strb r0, [r3] - adds r3, 0x1 - movs r0, 0xF9 - strb r0, [r3] - adds r3, 0x1 - movs r0, 0x5 - strb r0, [r3] - adds r3, 0x1 - adds r4, r3, 0 - adds r0, r4, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r3, r0, 0 - subs r4, r3, r4 - lsls r4, 16 - lsrs r4, 16 - strb r5, [r3] - adds r3, 0x1 - mov r0, r10 - cmp r0, 0 - bne _081CD808 - movs r0, 0x3 - subs r0, r4 - lsls r0, 16 - ldr r1, =0xffff0000 - adds r0, r1 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _081CD808 - movs r2, 0 - adds r1, r0, 0 -_081CD7FA: - strb r2, [r3] - adds r3, 0x1 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, r1 - bne _081CD7FA -_081CD808: - movs r0, 0xFF - strb r0, [r3] - adds r0, r3, 0 -_081CD80E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CD624 - - thumb_func_start sub_81CD824 -sub_81CD824: @ 81CD824 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - lsls r1, 24 - lsrs r6, r1, 24 - movs r0, 0xB - bl GetSubstructPtr - adds r5, r0, 0 - movs r0, 0x12 - bl GetSubstructPtr - adds r7, r0, 0 - mov r1, r8 - lsls r0, r1, 16 - asrs r4, r0, 16 - bl sub_81CDD5C - cmp r0, 0 - beq _081CD85A - ldrh r2, [r7] - cmp r4, r2 - bne _081CD862 - b _081CD900 -_081CD85A: - ldrh r0, [r7] - subs r0, 0x1 - cmp r4, r0 - beq _081CD900 -_081CD862: - lsls r0, r6, 6 - ldr r1, =0x00006368 - adds r0, r1 - adds r0, r5, r0 - mov r2, r8 - lsls r4, r2, 16 - lsrs r1, r4, 16 - movs r2, 0 - bl sub_81CD624 - asrs r4, 14 - adds r4, r7, r4 - ldrb r3, [r4, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r4, r0, 3 - ldr r1, =0x00006320 - adds r0, r5, r1 - adds r0, r4 - movs r2, 0 - movs r1, 0xFC - strb r1, [r0] - ldr r1, =0x00006321 - adds r0, r5, r1 - adds r0, r4 - movs r1, 0x4 - strb r1, [r0] - ldr r1, =0x00006322 - adds r0, r5, r1 - adds r0, r4 - movs r1, 0x8 - strb r1, [r0] - ldr r1, =0x00006323 - adds r0, r5, r1 - adds r0, r4 - strb r2, [r0] - ldr r2, =0x00006324 - adds r0, r5, r2 - adds r0, r4 - movs r1, 0x9 - strb r1, [r0] - cmp r3, 0xE - bne _081CD8E4 - adds r0, r4, r5 - ldr r1, =0x00006325 - adds r0, r1 - ldr r1, =gText_InParty - b _081CD8F4 - .pool -_081CD8E4: - adds r4, r5 - ldr r2, =0x00006325 - adds r4, r2 - adds r0, r3, 0 - bl GetBoxNamePtr - adds r1, r0, 0 - adds r0, r4, 0 -_081CD8F4: - movs r2, 0x8 - bl sub_81CD5CC - b _081CD95C - .pool -_081CD900: - movs r1, 0 - lsls r4, r6, 6 - lsls r0, r6, 1 - mov r8, r0 - adds r3, r4, 0 - ldr r0, =0x00006368 - adds r2, r5, r0 - movs r7, 0 -_081CD910: - adds r0, r1, r3 - adds r0, r2, r0 - strb r7, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0xB - bls _081CD910 - adds r1, r4 - ldr r2, =0x00006368 - adds r0, r5, r2 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - movs r1, 0 - mov r2, r8 - adds r0, r2, r6 - lsls r3, r0, 3 - ldr r0, =0x00006320 - adds r2, r5, r0 - movs r4, 0 -_081CD93A: - adds r0, r1, r3 - adds r0, r2, r0 - strb r4, [r0] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r1, r0, 16 - cmp r1, 0x7 - bls _081CD93A - mov r2, r8 - adds r0, r2, r6 - lsls r0, 3 - adds r0, r1, r0 - ldr r2, =0x00006320 - adds r1, r5, r2 - adds r1, r0 - movs r0, 0xFF - strb r0, [r1] -_081CD95C: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CD824 - - thumb_func_start sub_81CD970 -sub_81CD970: @ 81CD970 - push {r4-r7,lr} - movs r0, 0xB - bl GetSubstructPtr - adds r7, r0, 0 - ldr r1, =0x000006ac - movs r0, 0x12 - bl AllocSubstruct - adds r6, r0, 0 - movs r0, 0xC6 - lsls r0, 7 - adds r1, r7, r0 - movs r0, 0 - strb r0, [r1] - movs r4, 0 - movs r5, 0 - b _081CD9C4 - .pool -_081CD998: - movs r0, 0x64 - muls r0, r4 - ldr r1, =gPlayerParty - adds r0, r1 - movs r1, 0x2D - bl GetMonData - adds r2, r0, 0 - cmp r2, 0 - bne _081CD9BE - lsls r1, r5, 2 - adds r1, r6, r1 - movs r0, 0xE - strb r0, [r1, 0x4] - strb r4, [r1, 0x5] - strh r2, [r1, 0x6] - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_081CD9BE: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_081CD9C4: - bl CalculatePlayerPartyCount - lsls r0, 24 - lsrs r0, 24 - cmp r4, r0 - bcc _081CD998 - lsls r0, r5, 2 - adds r0, r6, r0 - movs r1, 0 - strb r1, [r0, 0x4] - strb r1, [r0, 0x5] - movs r2, 0 - strh r1, [r0, 0x6] - strh r1, [r6, 0x2] - adds r0, r5, 0x1 - strh r0, [r6] - ldr r1, =0x0000678a - adds r0, r7, r1 - strb r2, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CD970 - - thumb_func_start sub_81CD9F8 -sub_81CD9F8: @ 81CD9F8 - push {lr} - movs r0, 0xB - bl GetSubstructPtr - movs r1, 0xC6 - lsls r1, 7 - adds r2, r0, r1 - movs r3, 0 - movs r1, 0x1 - strb r1, [r2] - ldr r1, =0x0000678a - adds r0, r1 - strb r3, [r0] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CD9F8 - - thumb_func_start sub_81CDA1C -sub_81CDA1C: @ 81CDA1C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0xB - bl GetSubstructPtr - mov r8, r0 - movs r0, 0x12 - bl GetSubstructPtr - adds r4, r0, 0 - lsls r0, r6, 16 - asrs r5, r0, 16 - bl sub_81CDD5C - cmp r0, 0 - beq _081CDA52 - ldrh r0, [r4] - cmp r5, r0 - bne _081CDA5A - b _081CDB48 -_081CDA52: - ldrh r0, [r4] - subs r0, 0x1 - cmp r5, r0 - beq _081CDB48 -_081CDA5A: - lsls r0, r6, 16 - asrs r0, 14 - adds r0, r4, r0 - ldrb r6, [r0, 0x4] - ldrb r7, [r0, 0x5] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x16 - movs r3, 0 - bl GetBoxOrPartyMonData - mov r1, r9 - lsls r5, r1, 2 - adds r4, r5, r1 - ldr r1, =0x00006428 - add r1, r8 - adds r1, r4 - strb r0, [r1] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x2F - movs r3, 0 - bl GetBoxOrPartyMonData - ldr r1, =0x00006429 - add r1, r8 - adds r1, r4 - strb r0, [r1] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x21 - movs r3, 0 - bl GetBoxOrPartyMonData - ldr r1, =0x0000642a - add r1, r8 - adds r1, r4 - strb r0, [r1] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x18 - movs r3, 0 - bl GetBoxOrPartyMonData - ldr r1, =0x0000642b - add r1, r8 - adds r1, r4 - strb r0, [r1] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x17 - movs r3, 0 - bl GetBoxOrPartyMonData - ldr r1, =0x0000642c - add r1, r8 - adds r1, r4 - strb r0, [r1] - movs r0, 0xCF - lsls r0, 7 - add r0, r8 - mov r2, r9 - adds r4, r0, r2 - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x30 - movs r3, 0 - bl GetBoxOrPartyMonData - cmp r0, 0xFF - beq _081CDB10 - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x30 - movs r3, 0 - bl GetBoxOrPartyMonData - movs r1, 0x1D - bl __udivsi3 - b _081CDB12 - .pool -_081CDB10: - movs r0, 0x9 -_081CDB12: - strb r0, [r4] - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x8 - movs r3, 0 - bl GetBoxOrPartyMonData - ldr r1, =0x00006783 - add r1, r8 - add r1, r9 - strb r0, [r1] - mov r0, r9 - adds r1, r5, r0 - ldr r2, =0x00006428 - adds r0, r1, r2 - add r0, r8 - lsls r1, 2 - adds r2, 0x14 - adds r1, r2 - add r1, r8 - bl sub_81D2754 - b _081CDB80 - .pool -_081CDB48: - movs r2, 0 - mov r0, r9 - lsls r5, r0, 2 - add r5, r9 - ldr r4, =0x00006428 - add r4, r8 - lsls r3, r5, 2 - mov r9, r2 - ldr r7, =0x0000643c - movs r6, 0x9B -_081CDB5C: - adds r0, r2, r5 - adds r0, r4, r0 - mov r1, r9 - strb r1, [r0] - lsls r0, r2, 2 - adds r0, r3 - add r0, r8 - adds r1, r0, r7 - strh r6, [r1] - ldr r1, =0x0000643e - adds r0, r1 - movs r1, 0x5B - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x4 - bls _081CDB5C -_081CDB80: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CDA1C - - thumb_func_start sub_81CDB98 -sub_81CDB98: @ 81CDB98 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 16 - lsrs r6, r0, 16 - lsls r1, 24 - lsrs r1, 24 - mov r9, r1 - movs r0, 0xB - bl GetSubstructPtr - adds r7, r0, 0 - movs r0, 0x12 - bl GetSubstructPtr - adds r4, r0, 0 - lsls r0, r6, 16 - asrs r5, r0, 16 - bl sub_81CDD5C - cmp r0, 0 - beq _081CDBCC - ldrh r0, [r4] - b _081CDBD0 -_081CDBCC: - ldrh r0, [r4] - subs r0, 0x1 -_081CDBD0: - cmp r5, r0 - beq _081CDC3E - lsls r0, r6, 16 - asrs r0, 14 - adds r0, r4, r0 - ldrb r5, [r0, 0x4] - ldrb r6, [r0, 0x5] - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x41 - movs r3, 0 - bl GetBoxOrPartyMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0 - bl GetBoxOrPartyMonData - mov r8, r0 - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0 - bl GetBoxOrPartyMonData - adds r5, r0, 0 - lsls r0, r4, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - mov r2, r9 - lsls r1, r2, 13 - movs r2, 0xC0 - lsls r2, 2 - adds r1, r2 - adds r1, r7, r1 - movs r2, 0x1 - str r2, [sp] - adds r2, r4, 0 - adds r3, r5, 0 - bl LoadSpecialPokePic - adds r0, r4, 0 - mov r1, r8 - adds r2, r5, 0 - bl GetFrontSpritePalFromSpeciesAndPersonality - mov r2, r9 - lsls r1, r2, 7 - adds r1, r7, r1 - bl LZ77UnCompWram -_081CDC3E: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CDB98 - - thumb_func_start sub_81CDC50 -sub_81CDC50: @ 81CDC50 - push {lr} - movs r0, 0x12 - bl GetSubstructPtr - ldrh r0, [r0] - pop {r1} - bx r1 - thumb_func_end sub_81CDC50 - - thumb_func_start sub_81CDC60 -sub_81CDC60: @ 81CDC60 - push {lr} - movs r0, 0x12 - bl GetSubstructPtr - ldrh r0, [r0, 0x2] - pop {r1} - bx r1 - thumb_func_end sub_81CDC60 - - thumb_func_start sub_81CDC70 -sub_81CDC70: @ 81CDC70 - push {lr} - movs r0, 0xB - bl GetSubstructPtr - ldr r1, =0x00006428 - adds r0, r1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDC70 - - thumb_func_start sub_81CDC84 -sub_81CDC84: @ 81CDC84 - push {lr} - movs r0, 0xB - bl GetSubstructPtr - ldr r1, =0x00006786 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDC84 - - thumb_func_start sub_81CDC9C -sub_81CDC9C: @ 81CDC9C - push {lr} - movs r0, 0xB - bl GetSubstructPtr - ldr r1, =0x00006302 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDC9C - - thumb_func_start sub_81CDCB4 -sub_81CDCB4: @ 81CDCB4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xB - bl GetSubstructPtr - lsls r4, 13 - movs r1, 0xC0 - lsls r1, 2 - adds r4, r1 - adds r0, r4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CDCB4 - - thumb_func_start sub_81CDCD4 -sub_81CDCD4: @ 81CDCD4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xB - bl GetSubstructPtr - lsls r4, 7 - adds r0, r4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CDCD4 - - thumb_func_start sub_81CDCEC -sub_81CDCEC: @ 81CDCEC - push {lr} - movs r0, 0xB - bl GetSubstructPtr - ldr r1, =0x00006789 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDCEC - - thumb_func_start sub_81CDD04 -sub_81CDD04: @ 81CDD04 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xB - bl GetSubstructPtr - lsls r4, 6 - ldr r1, =0x00006368 - adds r4, r1 - adds r0, r4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDD04 - - thumb_func_start sub_81CDD24 -sub_81CDD24: @ 81CDD24 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0xB - bl GetSubstructPtr - lsls r1, r4, 1 - adds r1, r4 - lsls r1, 3 - ldr r2, =0x00006320 - adds r1, r2 - adds r0, r1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDD24 - - thumb_func_start sub_81CDD48 -sub_81CDD48: @ 81CDD48 - push {lr} - movs r0, 0x12 - bl GetSubstructPtr - ldrh r1, [r0, 0x2] - lsls r1, 2 - adds r0, r1 - ldrh r0, [r0, 0x6] - pop {r1} - bx r1 - thumb_func_end sub_81CDD48 - - thumb_func_start sub_81CDD5C -sub_81CDD5C: @ 81CDD5C - push {lr} - movs r0, 0xB - bl GetSubstructPtr - movs r1, 0xC6 - lsls r1, 7 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081CDD74 - movs r0, 0 - b _081CDD76 -_081CDD74: - movs r0, 0x1 -_081CDD76: - pop {r1} - bx r1 - thumb_func_end sub_81CDD5C - - thumb_func_start sub_81CDD7C -sub_81CDD7C: @ 81CDD7C - push {lr} - movs r0, 0xB - bl GetSubstructPtr - adds r2, r0, 0 - movs r1, 0xC6 - lsls r1, 7 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081CDD96 - movs r0, 0 - b _081CDDA6 -_081CDD96: - ldr r3, =0x00006786 - adds r0, r2, r3 - movs r1, 0 - ldrsb r1, [r0, r1] - subs r3, 0x3 - adds r0, r2, r3 - adds r0, r1 - ldrb r0, [r0] -_081CDDA6: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDD7C - - thumb_func_start sub_81CDDB0 -sub_81CDDB0: @ 81CDDB0 - push {lr} - movs r0, 0xB - bl GetSubstructPtr - ldr r2, =0x00006786 - adds r1, r0, r2 - ldrb r1, [r1] - lsls r1, 24 - asrs r1, 24 - subs r2, 0x6 - adds r0, r2 - adds r0, r1 - ldrb r0, [r0] - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDDB0 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokenav_unk_7.s b/asm/pokenav_unk_7.s deleted file mode 100644 index 6c363c01f..000000000 --- a/asm/pokenav_unk_7.s +++ /dev/null @@ -1,2001 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - -@ File centered around AllocSubstruct(0xC) - - thumb_func_start sub_81CDDD4 -sub_81CDDD4: @ 81CDDD4 - push {r4,lr} - ldr r1, =0x000038ac - movs r0, 0xC - bl AllocSubstruct - adds r4, r0, 0 - cmp r4, 0 - beq _081CDE24 - ldr r0, =0x00001816 - adds r1, r4, r0 - movs r0, 0xFF - strb r0, [r1] - ldr r0, =sub_81CDE94 - movs r1, 0x1 - bl CreateLoopedTask - str r0, [r4] - ldr r0, =0x00001810 - adds r1, r4, r0 - ldr r0, =sub_81CDE80 - str r0, [r1] - ldr r0, =0x00002908 - adds r1, r4, r0 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _081CDE26 - .pool -_081CDE24: - movs r0, 0 -_081CDE26: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CDDD4 - - thumb_func_start sub_81CDE2C -sub_81CDE2C: @ 81CDE2C - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xC - bl GetSubstructPtr - adds r5, r0, 0 - ldr r0, =gUnknown_08623384 - lsls r4, 2 - adds r4, r0 - ldr r0, [r4] - movs r1, 0x1 - bl CreateLoopedTask - str r0, [r5] - ldr r0, =0x00001810 - adds r5, r0 - ldr r0, =sub_81CDE80 - str r0, [r5] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CDE2C - - thumb_func_start sub_81CDE64 -sub_81CDE64: @ 81CDE64 - push {lr} - movs r0, 0xC - bl GetSubstructPtr - ldr r1, =0x00001810 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CDE64 - - thumb_func_start sub_81CDE80 -sub_81CDE80: @ 81CDE80 - push {lr} - movs r0, 0xC - bl GetSubstructPtr - ldr r0, [r0] - bl IsLoopedTaskActive - pop {r1} - bx r1 - thumb_func_end sub_81CDE80 - - thumb_func_start sub_81CDE94 -sub_81CDE94: @ 81CDE94 - push {r4-r6,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r0, 0xC - bl GetSubstructPtr - adds r5, r0, 0 - cmp r4, 0x14 - bls _081CDEA8 - b _081CE2C4 -_081CDEA8: - lsls r0, r4, 2 - ldr r1, =_081CDEB8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CDEB8: - .4byte _081CDF0C - .4byte _081CDF18 - .4byte _081CDF94 - .4byte _081CDFB8 - .4byte _081CE030 - .4byte _081CE074 - .4byte _081CE0B0 - .4byte _081CE118 - .4byte _081CE120 - .4byte _081CE126 - .4byte _081CE136 - .4byte _081CE146 - .4byte _081CE156 - .4byte _081CE16C - .4byte _081CE1C8 - .4byte _081CE1EC - .4byte _081CE218 - .4byte _081CE23C - .4byte _081CE24A - .4byte _081CE25A - .4byte _081CE262 -_081CDF0C: - bl sub_81CD3C4 - cmp r0, 0x1 - beq _081CDF16 - b _081CE2C0 -_081CDF16: - b _081CDFB0 -_081CDF18: - ldr r0, =gUnknown_08623358 - movs r1, 0x3 - bl InitBgTemplates - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r1, =0x00007940 - movs r0, 0 - bl SetGpuReg - ldr r1, =0x00000844 - movs r0, 0x50 - bl SetGpuReg - ldr r1, =0x0000040b - movs r0, 0x52 - bl SetGpuReg - ldr r1, =gPokenavCondition_Gfx - movs r0, 0 - str r0, [sp] - movs r0, 0x3 - b _081CDFA8 - .pool -_081CDF94: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081CDFA2 - b _081CE2C0 -_081CDFA2: - ldr r1, =gUnknown_08623228 - str r0, [sp] - movs r0, 0x2 -_081CDFA8: - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram -_081CDFB0: - movs r0, 0 - b _081CE2C6 - .pool -_081CDFB8: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081CDFC4 - b _081CE2C0 -_081CDFC4: - ldr r0, =gPokenavCondition_Tilemap - adds r4, r5, 0x4 - adds r1, r4, 0 - bl LZ77UnCompVram - movs r0, 0x3 - adds r1, r4, 0 - bl SetBgTilemapBuffer - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CDFF2 - ldr r1, =gPokenavOptions_Tilemap - movs r0, 0x9 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x3 - movs r2, 0 - movs r3, 0x5 - bl CopyToBgTilemapBufferRect -_081CDFF2: - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - ldr r0, =gPokenavCondition_Pal - movs r1, 0x10 - movs r2, 0x20 - bl CopyPaletteIntoBufferUnfaded - ldr r0, =gUnknown_08623208 - movs r1, 0xF0 - movs r2, 0x20 - bl CopyPaletteIntoBufferUnfaded - ldr r0, =0x00001814 - adds r1, r5, r0 - ldr r0, =0x0000ffb0 - strh r0, [r1] - b _081CDFB0 - .pool -_081CE030: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081CE03C - b _081CE2C0 -_081CE03C: - ldr r0, =gUnknown_0862323C - ldr r1, =0x00001004 - adds r4, r5, r1 - adds r1, r4, 0 - bl LZ77UnCompVram - movs r0, 0x2 - adds r1, r4, 0 - bl SetBgTilemapBuffer - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_086231E8 - movs r1, 0x30 - movs r2, 0x20 - bl CopyPaletteIntoBufferUnfaded - movs r0, 0x2 - bl sub_81D21DC - b _081CDFB0 - .pool -_081CE074: - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_8199DF0 - movs r0, 0x1 - movs r1, 0x11 - movs r2, 0x1 - movs r3, 0x1 - bl sub_8199DF0 - movs r0, 0 - str r0, [sp, 0x8] - ldr r2, =0x00000804 - adds r4, r5, r2 - ldr r2, =0x05000200 - add r0, sp, 0x8 - adds r1, r4, 0 - bl CpuSet - movs r0, 0x1 - adds r1, r4, 0 - bl SetBgTilemapBuffer - b _081CDFB0 - .pool -_081CE0B0: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081CE0BC - b _081CE2C0 -_081CE0BC: - ldr r0, =gUnknown_08623364 - bl AddWindow - movs r2, 0xC1 - lsls r2, 5 - adds r1, r5, r2 - strb r0, [r1] - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CE0F6 - ldr r0, =gUnknown_0862336C - bl AddWindow - ldr r2, =0x00001821 - adds r1, r5, r2 - strb r0, [r1] - ldr r0, =gUnknown_08623374 - bl AddWindow - ldr r2, =0x00001822 - adds r1, r5, r2 - strb r0, [r1] - ldr r0, =gUnknown_0862337C - bl AddWindow - ldr r2, =0x00001823 - adds r1, r5, r2 - strb r0, [r1] -_081CE0F6: - bl DeactivateAllTextPrinters - b _081CDFB0 - .pool -_081CE118: - movs r0, 0 - bl sub_81CED30 - b _081CDFB0 -_081CE120: - bl sub_81CE9E4 - b _081CDFB0 -_081CE126: - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE130 - b _081CDFB0 -_081CE130: - bl sub_81CE934 - b _081CDFB0 -_081CE136: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0 - b _081CE164 -_081CE146: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x1 - b _081CE164 -_081CE156: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x2 -_081CE164: - movs r2, 0x1 - bl sub_81CE754 - b _081CDFB0 -_081CE16C: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x3 - movs r2, 0x1 - bl sub_81CE754 - cmp r0, 0x1 - beq _081CE186 - b _081CE2C0 -_081CE186: - movs r1, 0xC1 - lsls r1, 5 - adds r0, r5, r1 - ldrb r0, [r0] - bl PutWindowTilemap - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE19C - b _081CDFB0 -_081CE19C: - ldr r2, =0x00001821 - adds r0, r5, r2 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r1, =0x00001822 - adds r0, r5, r1 - ldrb r0, [r0] - bl PutWindowTilemap - ldr r2, =0x00001823 - adds r0, r5, r2 - ldrb r0, [r0] - bl PutWindowTilemap - b _081CDFB0 - .pool -_081CE1C8: - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl HideBg - movs r0, 0x3 - bl ShowBg - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE1E4 - b _081CDFB0 -_081CE1E4: - movs r0, 0x4 - bl sub_81C7BA4 - b _081CDFB0 -_081CE1EC: - movs r0, 0x1 - bl sub_81C7AC0 - bl sub_81CDD5C - cmp r0, 0 - beq _081CE1FC - b _081CDFB0 -_081CE1FC: - movs r0, 0x6 - bl LoadLeftHeaderGfxForIndex - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - bl sub_81C7FA0 - movs r0, 0x6 - movs r1, 0x1 - movs r2, 0 - bl sub_81C7FA0 - b _081CDFB0 -_081CE218: - bl IsPaletteFadeActive - cmp r0, 0 - bne _081CE2C0 - bl sub_81CDD5C - cmp r0, 0 - bne _081CE230 - bl sub_81C8010 - cmp r0, 0 - bne _081CE2C0 -_081CE230: - ldr r0, =sub_81CEE44 - bl SetVBlankCallback_ - b _081CDFB0 - .pool -_081CE23C: - bl sub_81CEE90 - bl sub_81CDC70 - bl sub_81D20AC - b _081CDFB0 -_081CE24A: - bl sub_81CDC70 - bl sub_81D20BC - lsls r0, 24 - cmp r0, 0 - bne _081CE2C0 - b _081CDFB0 -_081CE25A: - movs r0, 0x1 - bl sub_81CEE74 - b _081CDFB0 -_081CE262: - bl sub_81CDC70 - ldr r2, =0x00001814 - adds r1, r5, r2 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _081CE2C0 - ldr r0, =0x000028e0 - adds r6, r5, r0 - adds r0, r6, 0 - bl sub_81D3464 - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE298 - bl sub_81CDC60 - adds r4, r0, 0 - bl sub_81CDC50 - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - beq _081CE2C4 -_081CE298: - ldr r1, =0x00001816 - adds r0, r5, r1 - ldrb r4, [r0] - bl sub_81CDDB0 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81D3480 - b _081CE2C4 - .pool -_081CE2C0: - movs r0, 0x2 - b _081CE2C6 -_081CE2C4: - movs r0, 0x4 -_081CE2C6: - add sp, 0xC - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81CDE94 - - thumb_func_start sub_81CE2D0 -sub_81CE2D0: @ 81CE2D0 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xC - bl GetSubstructPtr - adds r5, r0, 0 - cmp r4, 0x1 - beq _081CE308 - cmp r4, 0x1 - bgt _081CE2EA - cmp r4, 0 - beq _081CE2F4 - b _081CE374 -_081CE2EA: - cmp r4, 0x2 - beq _081CE328 - cmp r4, 0x3 - beq _081CE33E - b _081CE374 -_081CE2F4: - bl sub_81CEEC8 - ldr r1, =0x000028e0 - adds r0, r5, r1 - bl sub_81D3520 - movs r0, 0x1 - b _081CE376 - .pool -_081CE308: - bl sub_81CDC70 - ldr r2, =0x00001814 - adds r1, r5, r2 - bl sub_81D31A4 - lsls r0, 24 - cmp r0, 0 - bne _081CE34E - movs r0, 0 - bl sub_81CEE74 - movs r0, 0x1 - b _081CE376 - .pool -_081CE328: - movs r0, 0 - bl sub_81C7AC0 - bl sub_81CDD5C - cmp r0, 0 - bne _081CE33A - bl sub_81C78A0 -_081CE33A: - movs r0, 0 - b _081CE376 -_081CE33E: - bl IsPaletteFadeActive - cmp r0, 0 - bne _081CE34E - bl MainMenuLoopedTaskIsBusy - cmp r0, 0 - beq _081CE352 -_081CE34E: - movs r0, 0x2 - b _081CE376 -_081CE352: - ldr r1, =0x000028e0 - adds r0, r5, r1 - bl sub_81D354C - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - movs r0, 0x3 - bl HideBg - movs r0, 0x1 - b _081CE376 - .pool -_081CE374: - movs r0, 0x4 -_081CE376: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CE2D0 - - thumb_func_start sub_81CE37C -sub_81CE37C: @ 81CE37C - push {r4-r6,lr} - adds r4, r0, 0 - movs r0, 0xC - bl GetSubstructPtr - adds r6, r0, 0 - bl sub_81CDC70 - adds r2, r0, 0 - cmp r4, 0x9 - bls _081CE394 - b _081CE4D0 -_081CE394: - lsls r0, r4, 2 - ldr r1, =_081CE3A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CE3A4: - .4byte _081CE3CC - .4byte _081CE3D0 - .4byte _081CE3DA - .4byte _081CE3F0 - .4byte _081CE3F8 - .4byte _081CE418 - .4byte _081CE428 - .4byte _081CE438 - .4byte _081CE44E - .4byte _081CE468 -_081CE3CC: - movs r0, 0 - b _081CE3D2 -_081CE3D0: - movs r0, 0x1 -_081CE3D2: - bl sub_81CD548 -_081CE3D6: - movs r0, 0x1 - b _081CE4D2 -_081CE3DA: - movs r0, 0x2 - bl sub_81CD548 - ldr r1, =0x000028e0 - adds r0, r6, r1 - bl sub_81D3520 - b _081CE3D6 - .pool -_081CE3F0: - adds r0, r2, 0 - bl sub_81D2074 - b _081CE3D6 -_081CE3F8: - ldr r1, =0x00001814 - adds r0, r6, r1 - bl sub_81D3150 - lsls r0, 24 - cmp r0, 0 - bne _081CE4CC - bl sub_81CDC84 - lsls r0, 24 - lsrs r0, 24 - bl sub_81CED30 - b _081CE3D6 - .pool -_081CE418: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0 - b _081CE446 -_081CE428: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x1 - b _081CE446 -_081CE438: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x2 -_081CE446: - movs r2, 0 - bl sub_81CE754 - b _081CE3D6 -_081CE44E: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x3 - movs r2, 0 - bl sub_81CE754 - cmp r0, 0x1 - beq _081CE3D6 - b _081CE4CC -_081CE468: - bl sub_81CDC70 - adds r2, r0, 0 - ldr r0, =0x00001814 - adds r1, r6, r0 - adds r0, r2, 0 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _081CE4CC - ldr r1, =0x000028e0 - adds r0, r6, r1 - bl sub_81D3464 - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE4A0 - bl sub_81CDC60 - adds r4, r0, 0 - bl sub_81CDC50 - lsls r4, 16 - lsls r0, 16 - cmp r4, r0 - beq _081CE3D6 -_081CE4A0: - ldr r0, =0x000028e0 - adds r5, r6, r0 - ldr r1, =0x00001816 - adds r0, r6, r1 - ldrb r4, [r0] - bl sub_81CDDB0 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_81D3480 - b _081CE3D6 - .pool -_081CE4CC: - movs r0, 0x2 - b _081CE4D2 -_081CE4D0: - movs r0, 0x4 -_081CE4D2: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81CE37C - - thumb_func_start sub_81CE4D8 -sub_81CE4D8: @ 81CE4D8 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xC - bl GetSubstructPtr - adds r5, r0, 0 - cmp r4, 0x8 - bhi _081CE5DC - lsls r0, r4, 2 - ldr r1, =_081CE4F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CE4F8: - .4byte _081CE51C - .4byte _081CE520 - .4byte _081CE524 - .4byte _081CE52E - .4byte _081CE53E - .4byte _081CE54E - .4byte _081CE55E - .4byte _081CE576 - .4byte _081CE592 -_081CE51C: - movs r0, 0 - b _081CE526 -_081CE520: - movs r0, 0x1 - b _081CE526 -_081CE524: - movs r0, 0x2 -_081CE526: - bl sub_81CD548 - movs r0, 0x1 - b _081CE5DE -_081CE52E: - bl sub_81CDC84 - lsls r0, 24 - lsrs r0, 24 - bl sub_81CED30 - movs r0, 0x1 - b _081CE5DE -_081CE53E: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0 - b _081CE56C -_081CE54E: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x1 - b _081CE56C -_081CE55E: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x2 -_081CE56C: - movs r2, 0 - bl sub_81CE754 - movs r0, 0x1 - b _081CE5DE -_081CE576: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x3 - movs r2, 0 - bl sub_81CE754 - cmp r0, 0x1 - bne _081CE5D8 - movs r0, 0x1 - b _081CE5DE -_081CE592: - bl sub_81CDC70 - ldr r2, =0x00001814 - adds r1, r5, r2 - bl sub_81D3178 - lsls r0, 24 - cmp r0, 0 - bne _081CE5D8 - ldr r0, =0x000028e0 - adds r4, r5, r0 - adds r0, r4, 0 - bl sub_81D3464 - ldr r1, =0x00001816 - adds r0, r5, r1 - ldrb r5, [r0] - bl sub_81CDDB0 - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_81D3480 - movs r0, 0x1 - b _081CE5DE - .pool -_081CE5D8: - movs r0, 0x2 - b _081CE5DE -_081CE5DC: - movs r0, 0x4 -_081CE5DE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CE4D8 - - thumb_func_start sub_81CE5E4 -sub_81CE5E4: @ 81CE5E4 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0xC - bl GetSubstructPtr - adds r5, r0, 0 - cmp r4, 0x7 - bhi _081CE6B2 - lsls r0, r4, 2 - ldr r1, =_081CE604 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081CE604: - .4byte _081CE624 - .4byte _081CE628 - .4byte _081CE632 - .4byte _081CE648 - .4byte _081CE660 - .4byte _081CE670 - .4byte _081CE680 - .4byte _081CE696 -_081CE624: - movs r0, 0 - b _081CE62A -_081CE628: - movs r0, 0x1 -_081CE62A: - bl sub_81CD548 -_081CE62E: - movs r0, 0x1 - b _081CE6B4 -_081CE632: - movs r0, 0x2 - bl sub_81CD548 - ldr r1, =0x000028e0 - adds r0, r5, r1 - bl sub_81D3520 - b _081CE62E - .pool -_081CE648: - bl sub_81CDC70 - ldr r2, =0x00001814 - adds r1, r5, r2 - bl sub_81D31A4 - lsls r0, 24 - cmp r0, 0 - beq _081CE62E - b _081CE6AE - .pool -_081CE660: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0 - b _081CE68E -_081CE670: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x1 - b _081CE68E -_081CE680: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x2 -_081CE68E: - movs r2, 0 - bl sub_81CE754 - b _081CE62E -_081CE696: - bl sub_81CDC84 - adds r1, r0, 0 - lsls r1, 24 - asrs r1, 8 - lsrs r1, 16 - movs r0, 0x3 - movs r2, 0 - bl sub_81CE754 - cmp r0, 0x1 - beq _081CE62E -_081CE6AE: - movs r0, 0x2 - b _081CE6B4 -_081CE6B2: - movs r0, 0x4 -_081CE6B4: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81CE5E4 - - thumb_func_start sub_81CE6BC -sub_81CE6BC: @ 81CE6BC - push {lr} - cmp r0, 0x1 - beq _081CE6E6 - cmp r0, 0x1 - bgt _081CE6CC - cmp r0, 0 - beq _081CE6D2 - b _081CE6FA -_081CE6CC: - cmp r0, 0x2 - beq _081CE6EE - b _081CE6FA -_081CE6D2: - bl sub_81CDD7C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xB0 - movs r2, 0x20 - bl sub_811FAA4 -_081CE6E2: - movs r0, 0x1 - b _081CE6FC -_081CE6E6: - movs r0, 0x5 - bl sub_81C7BA4 - b _081CE6E2 -_081CE6EE: - bl IsDma3ManagerBusyWithBgCopy_ - cmp r0, 0x1 - bne _081CE6E2 - movs r0, 0x2 - b _081CE6FC -_081CE6FA: - movs r0, 0x4 -_081CE6FC: - pop {r1} - bx r1 - thumb_func_end sub_81CE6BC - - thumb_func_start sub_81CE700 -sub_81CE700: @ 81CE700 - push {lr} - cmp r0, 0x1 - beq _081CE71E - cmp r0, 0x1 - bgt _081CE710 - cmp r0, 0 - beq _081CE716 - b _081CE732 -_081CE710: - cmp r0, 0x2 - beq _081CE726 - b _081CE732 -_081CE716: - bl sub_811FAF8 -_081CE71A: - movs r0, 0x1 - b _081CE734 -_081CE71E: - movs r0, 0x4 - bl sub_81C7BA4 - b _081CE71A -_081CE726: - bl IsDma3ManagerBusyWithBgCopy_ - cmp r0, 0x1 - bne _081CE71A - movs r0, 0x2 - b _081CE734 -_081CE732: - movs r0, 0x4 -_081CE734: - pop {r1} - bx r1 - thumb_func_end sub_81CE700 - - thumb_func_start sub_81CE738 -sub_81CE738: @ 81CE738 - push {lr} - lsls r1, 16 - lsrs r1, 16 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r1, =gText_Number2 - bl StringCopy - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CE738 - - thumb_func_start sub_81CE754 -sub_81CE754: @ 81CE754 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x2C - lsls r0, 24 - lsrs r4, r0, 24 - adds r7, r4, 0 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - lsls r2, 24 - lsrs r5, r2, 24 - movs r0, 0xC - bl GetSubstructPtr - adds r6, r0, 0 - cmp r4, 0x1 - beq _081CE7B8 - cmp r4, 0x1 - bgt _081CE782 - cmp r4, 0 - beq _081CE78E - b _081CE924 -_081CE782: - cmp r4, 0x2 - beq _081CE800 - cmp r4, 0x3 - bne _081CE78C - b _081CE89C -_081CE78C: - b _081CE924 -_081CE78E: - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE7A6 - b _081CE924 -_081CE7A6: - ldr r1, =0x00001821 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0 - bl FillWindowPixelBuffer - b _081CE924 - .pool -_081CE7B8: - bl sub_81CDC60 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81CDC50 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r4, r0 - bne _081CE7DA - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CE7DA - b _081CE924 -_081CE7DA: - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_81CDD04 - adds r2, r0, 0 - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - str r7, [sp] - movs r1, 0 - str r1, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - b _081CE924 -_081CE800: - bl sub_81CDD5C - adds r7, r0, 0 - cmp r7, 0x1 - beq _081CE80C - b _081CE924 -_081CE80C: - mov r1, r8 - lsls r0, r1, 24 - lsrs r0, 24 - bl sub_81CDD24 - adds r2, r0, 0 - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x11 - str r1, [sp] - movs r4, 0 - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - add r1, sp, 0xC - movs r0, 0xFC - strb r0, [r1] - movs r0, 0x4 - strb r0, [r1, 0x1] - movs r0, 0x8 - strb r0, [r1, 0x2] - adds r0, r1, 0 - strb r4, [r0, 0x3] - movs r0, 0x9 - strb r0, [r1, 0x4] - mov r5, sp - adds r5, 0x11 - ldr r1, =gText_Number2 - adds r0, r5, 0 - bl StringCopy - ldr r0, =0x00001821 - adds r6, r0 - ldrb r0, [r6] - str r7, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - movs r3, 0x4 - bl AddTextPrinterParameterized - bl sub_81CDD48 - adds r1, r0, 0 - lsls r1, 16 - lsrs r1, 16 - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldrb r0, [r6] - str r7, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - add r2, sp, 0xC - movs r3, 0x1C - bl AddTextPrinterParameterized - b _081CE924 - .pool -_081CE89C: - ldr r1, =0x00002908 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _081CE8B0 - cmp r0, 0x1 - beq _081CE8EC - b _081CE924 - .pool -_081CE8B0: - cmp r5, 0 - beq _081CE8C4 - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - b _081CE8D2 -_081CE8C4: - movs r1, 0xC1 - lsls r1, 5 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram -_081CE8D2: - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CE910 - ldr r0, =0x00002908 - adds r1, r6, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081CE924 - .pool -_081CE8EC: - cmp r5, 0 - beq _081CE904 - ldr r1, =0x00001821 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - b _081CE910 - .pool -_081CE904: - ldr r1, =0x00001821 - adds r0, r6, r1 - ldrb r0, [r0] - movs r1, 0x2 - bl CopyWindowToVram -_081CE910: - ldr r0, =0x00002908 - adds r1, r6, r0 - movs r0, 0 - strb r0, [r1] - movs r0, 0x1 - b _081CE926 - .pool -_081CE924: - movs r0, 0 -_081CE926: - add sp, 0x2C - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81CE754 - - thumb_func_start sub_81CE934 -sub_81CE934: @ 81CE934 - push {r4,lr} - movs r0, 0xC - bl GetSubstructPtr - adds r4, r0, 0 - ldr r1, =0x00001822 - adds r0, r4, r1 - ldrb r0, [r0] - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =0x00001823 - adds r4, r0 - ldrb r0, [r4] - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CE934 - - thumb_func_start sub_81CE964 -sub_81CE964: @ 81CE964 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0x2E - ldrsh r4, [r5, r0] - bl sub_81CDC60 - lsls r0, 16 - lsrs r0, 16 - cmp r4, r0 - bne _081CE982 - adds r0, r5, 0 - movs r1, 0 - bl StartSpriteAnim - b _081CE98A -_081CE982: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnim -_081CE98A: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CE964 - - thumb_func_start sub_81CE990 -sub_81CE990: @ 81CE990 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_81CDC60 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81CDC50 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r4, r0 - bne _081CE9B0 - movs r0, 0x65 - b _081CE9B2 -_081CE9B0: - movs r0, 0x66 -_081CE9B2: - bl IndexOfSpritePaletteTag - lsls r0, 4 - ldrb r2, [r5, 0x5] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r5, 0x5] - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CE990 - - thumb_func_start sub_81CE9C8 -sub_81CE9C8: @ 81CE9C8 - push {r4,lr} - adds r4, r0, 0 - bl sub_81CDD7C - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CE9C8 - - thumb_func_start sub_81CE9E4 -sub_81CE9E4: @ 81CE9E4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x58 - movs r0, 0xC - bl GetSubstructPtr - adds r6, r0, 0 - add r4, sp, 0x20 - add r5, sp, 0x38 - mov r0, sp - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81D321C - bl sub_81CDD5C - adds r7, r4, 0 - mov r10, r5 - cmp r0, 0x1 - bne _081CEA78 - ldr r1, =0x00001824 - adds r0, r6, r1 - movs r2, 0x6A - strh r2, [r0] - ldr r3, =0x00001826 - adds r1, r6, r3 - strh r2, [r1] - bl sub_811F90C - bl sub_811FA90 - ldr r2, =gUnknown_08623338 - movs r0, 0x69 - movs r1, 0x69 - bl sub_811FF94 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - movs r1, 0xC0 - strh r1, [r0, 0x20] - movs r1, 0x20 - strh r1, [r0, 0x22] - ldr r1, =sub_81CE9C8 - str r1, [r0, 0x1C] - ldr r2, =0x000028dc - adds r1, r6, r2 - str r0, [r1] - movs r0, 0x69 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - bl sub_81C7990 - add r3, sp, 0x50 - mov r8, r3 - b _081CEBC6 - .pool -_081CEA78: - mov r0, sp - bl LoadSpriteSheets - mov r0, r10 - bl Pokenav_AllocAndLoadPalettes - movs r4, 0 - add r0, sp, 0x50 - mov r8, r0 - b _081CEAE8 -_081CEA8C: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r1, 0x80 - lsls r1, 12 - adds r2, r1 - asrs r2, 16 - adds r0, r7, 0 - movs r1, 0xE2 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081CEAD8 - ldr r2, =0x00001806 - adds r0, r6, r2 - adds r0, r4 - strb r3, [r0] - ldr r2, =gSprites - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - adds r1, r0, r2 - strh r4, [r1, 0x2E] - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_81CE964 - str r1, [r0] - b _081CEAE2 - .pool -_081CEAD8: - ldr r3, =0x00001806 - adds r0, r6, r3 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_081CEAE2: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_081CEAE8: - bl sub_81CDC50 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r4, r0 - blt _081CEA8C - movs r0, 0x67 - strh r0, [r7] - ldr r0, =SpriteCallbackDummy - str r0, [r7, 0x14] - cmp r4, 0x5 - bhi _081CEB5C - ldr r0, =0x00001806 - adds r5, r6, r0 - ldr r1, =gSprites - mov r9, r1 -_081CEB0A: - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r3, 0x80 - lsls r3, 12 - adds r2, r3 - asrs r2, 16 - adds r0, r7, 0 - movs r1, 0xE6 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081CEB4C - adds r0, r5, r4 - strb r3, [r0] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - add r1, r9 - ldrb r2, [r1, 0x3] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1, 0x3] - b _081CEB52 - .pool -_081CEB4C: - adds r1, r5, r4 - movs r0, 0xFF - strb r0, [r1] -_081CEB52: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x5 - bls _081CEB0A -_081CEB5C: - movs r0, 0x66 - strh r0, [r7] - ldr r0, =sub_81CE990 - str r0, [r7, 0x14] - lsls r2, r4, 2 - adds r2, r4 - lsls r2, 18 - movs r0, 0x80 - lsls r0, 12 - adds r2, r0 - asrs r2, 16 - adds r0, r7, 0 - movs r1, 0xDE - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x40 - beq _081CEBBC - ldr r1, =0x00001806 - adds r0, r6, r1 - adds r0, r4 - strb r3, [r0] - ldr r0, =gSprites - lsls r2, r3, 4 - adds r2, r3 - lsls r2, 2 - adds r2, r0 - ldrb r3, [r2, 0x1] - movs r1, 0x3F - adds r0, r1, 0 - ands r0, r3 - movs r3, 0x40 - orrs r0, r3 - strb r0, [r2, 0x1] - ldrb r0, [r2, 0x3] - ands r1, r0 - movs r0, 0x80 - orrs r1, r0 - strb r1, [r2, 0x3] - b _081CEBC6 - .pool -_081CEBBC: - ldr r2, =0x00001806 - adds r0, r6, r2 - adds r0, r4 - movs r1, 0xFF - strb r1, [r0] -_081CEBC6: - mov r0, r8 - mov r1, r10 - bl sub_81D32B0 - mov r0, r8 - bl LoadSpriteSheet - movs r0, 0 - mov r3, r10 - str r0, [r3, 0x8] - mov r0, r10 - bl Pokenav_AllocAndLoadPalettes - add sp, 0x58 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CE9E4 - - thumb_func_start sub_81CEBF4 -sub_81CEBF4: @ 81CEBF4 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CEC28 - ldr r1, =0x000028dc - adds r0, r5, r1 - ldr r0, [r0] - bl DestroySprite - movs r0, 0x6A - bl FreeSpriteTilesByTag - movs r0, 0x69 - bl FreeSpriteTilesByTag - movs r0, 0x6A - bl FreeSpritePaletteByTag - movs r0, 0x69 - bl FreeSpritePaletteByTag - b _081CEC68 - .pool -_081CEC28: - movs r4, 0 -_081CEC2A: - ldr r1, =0x00001806 - adds r0, r5, r1 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _081CEC2A - movs r0, 0x65 - bl FreeSpriteTilesByTag - movs r0, 0x66 - bl FreeSpriteTilesByTag - movs r0, 0x67 - bl FreeSpriteTilesByTag - movs r0, 0x65 - bl FreeSpritePaletteByTag - movs r0, 0x66 - bl FreeSpritePaletteByTag -_081CEC68: - ldr r0, =0x00001816 - adds r1, r5, r0 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081CEC8E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - movs r0, 0x64 - bl FreeSpriteTilesByTag - movs r0, 0x64 - bl FreeSpritePaletteByTag -_081CEC8E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CEBF4 - - thumb_func_start sub_81CECA0 -sub_81CECA0: @ 81CECA0 - push {r4,lr} - movs r0, 0xC - bl GetSubstructPtr - adds r4, r0, 0 - movs r1, 0xC1 - lsls r1, 5 - adds r0, r4, r1 - ldrb r0, [r0] - bl RemoveWindow - bl sub_81CDD5C - cmp r0, 0x1 - bne _081CECEC - ldr r1, =0x00001821 - adds r0, r4, r1 - ldrb r0, [r0] - bl RemoveWindow - ldr r1, =0x00001822 - adds r0, r4, r1 - ldrb r0, [r0] - bl RemoveWindow - ldr r1, =0x00001823 - adds r0, r4, r1 - ldrb r0, [r0] - bl RemoveWindow - b _081CECF0 - .pool -_081CECEC: - bl sub_81C7FDC -_081CECF0: - movs r1, 0x8A - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - adds r0, r4, 0 - bl sub_81CEBF4 - bl sub_81CEE68 - movs r0, 0xC - bl FreePokenavSubstruct - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CECA0 - - thumb_func_start sub_81CED10 -sub_81CED10: @ 81CED10 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0xC - bl GetSubstructPtr - ldr r1, =0x00001814 - adds r0, r1 - ldrh r0, [r0] - adds r0, 0x26 - strh r0, [r4, 0x20] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CED10 - - thumb_func_start sub_81CED30 -sub_81CED30: @ 81CED30 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x28 - lsls r0, 24 - lsrs r6, r0, 24 - movs r0, 0xC - bl GetSubstructPtr - mov r8, r0 - ldr r7, =0x00001816 - add r7, r8 - ldrb r0, [r7] - cmp r0, 0xFF - bne _081CEDFC - add r5, sp, 0x18 - add r4, sp, 0x20 - adds r0, r5, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_81D31D0 - adds r0, r6, 0 - bl sub_81CDCB4 - str r0, [sp, 0x18] - adds r0, r6, 0 - bl sub_81CDCD4 - str r0, [sp, 0x20] - adds r0, r4, 0 - bl LoadSpritePalette - lsls r0, 24 - lsrs r0, 24 - ldr r4, =0x00001818 - add r4, r8 - strh r0, [r4] - adds r0, r5, 0 - bl LoadSpriteSheet - ldr r5, =0x0000181a - add r5, r8 - strh r0, [r5] - mov r0, sp - movs r1, 0x26 - movs r2, 0x68 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - strb r0, [r7] - cmp r0, 0x40 - bne _081CEDBC - movs r0, 0x64 - bl FreeSpriteTilesByTag - movs r0, 0x64 - bl FreeSpritePaletteByTag - movs r0, 0xFF - strb r0, [r7] - b _081CEE26 - .pool -_081CEDBC: - strb r0, [r7] - ldr r2, =gSprites - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_81CED10 - str r1, [r0] - ldr r1, =0x0000181c - add r1, r8 - ldrh r0, [r5] - lsls r0, 5 - ldr r2, =0x06010000 - adds r0, r2 - str r0, [r1] - ldrh r0, [r4] - lsls r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1 - strh r0, [r4] - b _081CEE26 - .pool -_081CEDFC: - adds r0, r6, 0 - bl sub_81CDCB4 - ldr r1, =0x0000181c - add r1, r8 - ldr r2, [r1] - ldr r1, =0x040000d4 - str r0, [r1] - str r2, [r1, 0x4] - ldr r0, =0x80000400 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r0, r6, 0 - bl sub_81CDCD4 - ldr r1, =0x00001818 - add r1, r8 - ldrh r1, [r1] - movs r2, 0x20 - bl LoadPalette -_081CEE26: - add sp, 0x28 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CED30 - - thumb_func_start sub_81CEE44 -sub_81CEE44: @ 81CEE44 - push {r4,lr} - bl sub_81CDC70 - adds r4, r0, 0 - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - adds r0, r4, 0 - bl sub_81D2108 - bl ScanlineEffect_InitHBlankDmaTransfer - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81CEE44 - - thumb_func_start sub_81CEE68 -sub_81CEE68: @ 81CEE68 - push {lr} - bl SetPokenavVBlankCallback - pop {r0} - bx r0 - thumb_func_end sub_81CEE68 - - thumb_func_start sub_81CEE74 -sub_81CEE74: @ 81CEE74 - push {lr} - lsls r0, 24 - cmp r0, 0 - beq _081CEE84 - movs r0, 0x2 - bl ShowBg - b _081CEE8A -_081CEE84: - movs r0, 0x2 - bl HideBg -_081CEE8A: - pop {r0} - bx r0 - thumb_func_end sub_81CEE74 - - thumb_func_start sub_81CEE90 -sub_81CEE90: @ 81CEE90 - push {r4,lr} - bl sub_81CDC70 - adds r4, r0, 0 - bl sub_81CDC84 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_030012BC - strb r0, [r1] - adds r1, r4, 0 - adds r1, 0x50 - lsls r2, r0, 2 - adds r2, r0 - lsls r2, 2 - adds r2, 0x14 - adds r2, r4, r2 - adds r0, r4, 0 - bl sub_81D1F84 - adds r0, r4, 0 - bl sub_81D2074 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81CEE90 - - thumb_func_start sub_81CEEC8 -sub_81CEEC8: @ 81CEEC8 - push {r4,r5,lr} - bl sub_81CDC70 - adds r5, r0, 0 - bl sub_81CDD5C - cmp r0, 0 - bne _081CEEF0 - bl sub_81CDC60 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl sub_81CDC50 - lsls r0, 16 - lsrs r0, 16 - subs r0, 0x1 - cmp r4, r0 - beq _081CEF0C -_081CEEF0: - bl sub_81CDC84 - lsls r0, 24 - asrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, 0x14 - adds r1, r5, r1 - adds r2, r5, 0 - adds r2, 0x50 - adds r0, r5, 0 - bl sub_81D1F84 -_081CEF0C: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81CEEC8 - - thumb_func_start sub_81CEF14 -sub_81CEF14: @ 81CEF14 - push {r4,lr} - movs r0, 0xC - bl GetSubstructPtr - adds r4, r0, 0 - bl sub_81CDD5C - cmp r0, 0x1 - beq _081CEF2A - movs r0, 0 - b _081CEF30 -_081CEF2A: - ldr r1, =0x00001828 - adds r0, r4, r1 - ldrb r0, [r0] -_081CEF30: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CEF14 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/pokenav_unk_8.s b/asm/pokenav_unk_8.s index 5bba161bb..6fcf21374 100644 --- a/asm/pokenav_unk_8.s +++ b/asm/pokenav_unk_8.s @@ -5,219 +5,7 @@ @ File centered around AllocSubstruct(7) - thumb_func_start sub_81CEF3C -sub_81CEF3C: @ 81CEF3C - push {r4,lr} - movs r0, 0x7 - movs r1, 0x24 - bl AllocSubstruct - adds r4, r0, 0 - cmp r4, 0 - beq _081CEF90 - ldr r1, =0x000006ac - movs r0, 0x12 - bl AllocSubstruct - str r0, [r4, 0x20] - cmp r0, 0 - beq _081CEF90 - ldr r0, =sub_81CF010 - str r0, [r4] - ldr r0, =sub_81CF11C - movs r1, 0x1 - bl CreateLoopedTask - str r0, [r4, 0x4] - movs r0, 0 - str r0, [r4, 0x18] - bl sub_81C76AC - ldr r1, =gUnknown_086233A0 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r4, 0x14] - movs r0, 0x1 - b _081CEF92 - .pool -_081CEF90: - movs r0, 0 -_081CEF92: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CEF3C - thumb_func_start sub_81CEF98 -sub_81CEF98: @ 81CEF98 - push {r4,lr} - movs r0, 0x7 - movs r1, 0x24 - bl AllocSubstruct - adds r4, r0, 0 - cmp r4, 0 - beq _081CEFD4 - movs r0, 0x12 - bl GetSubstructPtr - str r0, [r4, 0x20] - ldr r0, =sub_81CF030 - str r0, [r4] - movs r0, 0x1 - str r0, [r4, 0x18] - bl sub_81C76AC - ldr r1, =gUnknown_086233A0 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r4, 0x14] - movs r0, 0x1 - b _081CEFD6 - .pool -_081CEFD4: - movs r0, 0 -_081CEFD6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81CEF98 - - thumb_func_start sub_81CEFDC -sub_81CEFDC: @ 81CEFDC - push {lr} - movs r0, 0x7 - bl GetSubstructPtr - ldr r1, [r0] - bl _call_via_r1 - pop {r1} - bx r1 - thumb_func_end sub_81CEFDC - - thumb_func_start sub_81CEFF0 -sub_81CEFF0: @ 81CEFF0 - push {lr} - movs r0, 0x7 - bl GetSubstructPtr - ldr r0, [r0, 0x1C] - cmp r0, 0 - bne _081CF004 - movs r0, 0x12 - bl FreePokenavSubstruct -_081CF004: - movs r0, 0x7 - bl FreePokenavSubstruct - pop {r0} - bx r0 - thumb_func_end sub_81CEFF0 - - thumb_func_start sub_81CF010 -sub_81CF010: @ 81CF010 - push {r4,lr} - adds r4, r0, 0 - ldr r0, [r4, 0x4] - bl IsLoopedTaskActive - cmp r0, 0 - bne _081CF022 - ldr r0, =sub_81CF030 - str r0, [r4] -_081CF022: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CF010 - - thumb_func_start sub_81CF030 -sub_81CF030: @ 81CF030 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r2, =gMain - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081CF048 - movs r0, 0x1 - b _081CF0A6 - .pool -_081CF048: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081CF054 - movs r0, 0x2 - b _081CF0A6 -_081CF054: - ldrh r1, [r2, 0x2E] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _081CF062 - movs r0, 0x3 - b _081CF0A6 -_081CF062: - movs r0, 0x10 - ands r0, r1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0 - beq _081CF072 - movs r0, 0x4 - b _081CF0A6 -_081CF072: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081CF088 - str r2, [r4, 0x1C] - ldr r0, =sub_81CF0B0 - str r0, [r4] - movs r0, 0x5 - b _081CF0A6 - .pool -_081CF088: - movs r5, 0x1 - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - bne _081CF096 - movs r0, 0 - b _081CF0A6 -_081CF096: - bl GetSelectedMatchCall - ldr r1, [r4, 0x20] - strh r0, [r1, 0x2] - str r5, [r4, 0x1C] - ldr r0, =sub_81CF0B8 - str r0, [r4] - movs r0, 0x6 -_081CF0A6: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81CF030 - - thumb_func_start sub_81CF0B0 -sub_81CF0B0: @ 81CF0B0 - ldr r0, =0x000186a3 - bx lr - .pool - thumb_func_end sub_81CF0B0 - - thumb_func_start sub_81CF0B8 -sub_81CF0B8: @ 81CF0B8 - ldr r0, =0x000186a9 - bx lr - .pool - thumb_func_end sub_81CF0B8 - - thumb_func_start sub_81CF0C0 -sub_81CF0C0: @ 81CF0C0 - push {lr} - movs r0, 0x7 - bl GetSubstructPtr - ldr r0, [r0, 0x18] - pop {r1} - bx r1 - thumb_func_end sub_81CF0C0 thumb_func_start sub_81CF0D0 sub_81CF0D0: @ 81CF0D0 diff --git a/common_syms/ereader_screen.txt b/common_syms/ereader_screen.txt new file mode 100644 index 000000000..5a89d370d --- /dev/null +++ b/common_syms/ereader_screen.txt @@ -0,0 +1 @@ +gUnknown_03006370 diff --git a/common_syms/librfu.txt b/common_syms/librfu.txt new file mode 100644 index 000000000..e81d78795 --- /dev/null +++ b/common_syms/librfu.txt @@ -0,0 +1,6 @@ +gUnknown_03007870 +gUnknown_03007880 +gUnknown_03007890 +gUnknown_03007894 +gUnknown_03007898 +gUnknown_030078A0 diff --git a/common_syms/librfu_stwi.txt b/common_syms/librfu_stwi.txt new file mode 100644 index 000000000..0e8468f4d --- /dev/null +++ b/common_syms/librfu_stwi.txt @@ -0,0 +1 @@ +gRfuState diff --git a/data/dodrio_berry_picking.s b/data/dodrio_berry_picking.s deleted file mode 100755 index 7537d9f04..000000000 --- a/data/dodrio_berry_picking.s +++ /dev/null @@ -1,666 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gUnknown_082F449C:: @ 82F449C - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 - .byte 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x03, 0x08 - .byte 0x09, 0x00, 0x00, 0x01, 0x02, 0x05, 0x06, 0x03 - .byte 0x04, 0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 - .byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x02, 0x09 - .byte 0x00, 0x00, 0x01, 0x04, 0x05, 0x06, 0x07, 0x02 - .byte 0x03, 0x04, 0x09, 0x00, 0x00, 0x01, 0x06, 0x07 - .byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x09, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02 - .byte 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x00 - .byte 0x00, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01 - .byte 0x02, 0x03, 0x00, 0x00, 0x05, 0x06, 0x07, 0x08 - .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x07 - .byte 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03 - .byte 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x02 - .byte 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00 - .byte 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08 - .byte 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 - .byte 0x08, 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 - .byte 0x06, 0x07, 0x08 - -gUknnown_082F45AF:: - .byte 0x04, 0x05, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 - .byte 0x04, 0x05, 0x05, 0x06, 0x03, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x05 - .byte 0x06, 0x06, 0x07, 0x02, 0x02, 0x03, 0x04, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x05 - .byte 0x05, 0x06, 0x07, 0x07, 0x08, 0x01, 0x01, 0x02 - .byte 0x03, 0x00, 0x00, 0x00, 0x04, 0x05, 0x06, 0x06 - .byte 0x07, 0x08, 0x08, 0x09, 0x00, 0x00, 0x01, 0x02 - .byte 0x02, 0x03, 0x04, 0x01, 0x00, 0x01, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01 - .byte 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x03, 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02 - .byte 0x03, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x04 - .byte 0x00, 0x01, 0x00, 0x01, 0x02, 0x01, 0x02, 0x03 - .byte 0x02, 0x03, 0x04, 0x03, 0x04, 0x00, 0x00, 0x00 - .byte 0x00, 0x09, 0x09, 0x09, 0x09, 0x01, 0x01, 0x01 - .byte 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x00 - .byte 0x00, 0x01, 0x01, 0x00, 0x09, 0x09, 0x09, 0x09 - .byte 0x09, 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x01 - .byte 0x09, 0x09, 0x09, 0x03, 0x03, 0x00, 0x00, 0x01 - .byte 0x01, 0x02, 0x02, 0x03, 0x09, 0x03, 0x03, 0x04 - .byte 0x04, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03 - .byte 0x05, 0x00, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00 - .byte 0x00, 0x00, 0x03, 0x05, 0x07, 0x00, 0x00, 0x02 - .byte 0x04, 0x06, 0x08, 0x00, 0x01, 0x03, 0x05, 0x06 - .byte 0x09 - - .align 2 -gUnknown_082F7DF0_UnrefDupe:: @ 82F4698 - .incbin "graphics/link_games/dodrioberry_bg1.gbapal" - - .align 2 - .incbin "graphics/link_games/dodrioberry_bg2.gbapal" - - .align 2 -gUnknown_082F7E30_UnrefDupe:: @ 82F46B8 - .incbin "graphics/link_games/dodrioberry_pkmn.gbapal" - - .align 2 -gUnknown_082F7E50_UnrefDupe:: @ 82F46D8 - .incbin "graphics/link_games/dodrioberry_shiny.gbapal" - - .align 2 -gUnknown_082F7E70_UnrefDupe:: @ 82F46F8 - .incbin "graphics/link_games/dodrioberry_status.gbapal" - - .align 2 -gUnknown_082F7E90_UnrefDupe:: @ 82F4718 - .incbin "graphics/link_games/dodrioberry_berrysprites.gbapal" - - .align 2 -gUnknown_082F7EB0_UnrefDupe:: @ 82F4738 - .incbin "graphics/link_games/dodrioberry_berrysprites.4bpp.lz" - - .align 2 -gUnknown_082F8064_UnrefDupe:: @ 82F490C - .incbin "graphics/link_games/dodrioberry_platform.gbapal" - - .align 2 -gUnknown_082F8084_UnrefDupe:: @ 82F492C - .incbin "graphics/link_games/dodrioberry_bg1.4bpp.lz" - - .align 2 -gUnknown_082F8914_UnrefDupe:: @ 82F51BC - .incbin "graphics/link_games/dodrioberry_bg2.4bpp.lz" - - .align 2 -gUnknown_082F96E0_UnrefDupe:: @ 82F5F88 - .incbin "graphics/link_games/dodrioberry_status.4bpp.lz" - - .align 2 -gUnknown_082F9774_UnrefDupe:: @ 82F601C - .incbin "graphics/link_games/dodrioberry_platform.4bpp.lz" - - .align 2 -gUnknown_082F98BC_UnrefDupe:: @ 82F6164 - .incbin "graphics/link_games/dodrioberry_pkmn.4bpp.lz" - - .align 2 -gUnknown_082FAAD8_UnrefDupe:: @ 82F7380 - .incbin "graphics/link_games/dodrioberry_bg1.bin.lz" - - .align 2 -gUnknown_082FAD44_UnrefDupe:: @ 82F75EC - .incbin "graphics/link_games/dodrioberry_bg2right.bin.lz" - - .align 2 -gUnknown_082FAF94_UnrefDupe:: @ 82F783C - .incbin "graphics/link_games/dodrioberry_bg2left.bin.lz" - - .align 2 -gUnknown_082F7A88:: @ 82F7A88 - .byte 0x28, 0x18, 0x0d, 0x20, 0x13, 0x0a, 0x16, 0x0d - .byte 0x07, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_082F7A94:: @ 82F7A94 - .byte 0x08, 0x05, 0x08, 0x0b, 0x0f, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_082F7A9C:: @ 82F7A9C - .byte 0x05, 0x0a, 0x14, 0x1e, 0x32, 0x46, 0x64, 0x00 - - .align 2 -gUnknown_082F7AA4:: @ 82F7AA4 - .byte 0x0f, 0x10, 0x11, 0x12, 0x13, 0x13, 0x12, 0x11 - .byte 0x10, 0x0f, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19 - .byte 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21 - .byte 0x22, 0x22, 0x21, 0x20, 0x1f, 0x1e, 0x00, 0x00 - - .align 2 -gUnknown_082F7AC4:: @ 82F7AC4 - .4byte sub_8024DBC - .4byte sub_8024E00 - .4byte sub_8024E38 - .4byte sub_8024F10 - .4byte sub_8024F38 - .4byte sub_8025198 - .4byte sub_8025324 - .4byte sub_8025470 - .4byte sub_8025644 - .4byte sub_80256AC - .4byte sub_8025758 - .4byte sub_80250D4 - - .align 2 -gUnknown_082F7AF4:: @ 82F7AF4 - .4byte sub_8024DBC - .4byte sub_8024E00 - .4byte sub_8024E38 - .4byte sub_8024F10 - .4byte sub_8024FFC - .4byte sub_8025230 - .4byte sub_8025324 - .4byte sub_8025470 - .4byte sub_8025644 - .4byte sub_80256AC - .4byte sub_8025758 - .4byte sub_8025158 - - .align 2 -gUnknown_082F7B24:: @ 82F7B24 - .2byte 0x000a, 0x001e, 0x0032, 0x0032 - - .align 2 -gUnknown_082F7B2C:: @ 82F7B2C - .byte 0x00, 0x05, 0x01, 0x14, 0x0b, 0x0f, 0x01, 0x00 - - .align 2 -gUnknown_082F7B34:: @ 82F7B34 - .4byte gText_BerriesPicked - .4byte gText_BestScore - .4byte gText_BerriesInRowFivePlayers - - .align 2 -gUnknown_082F7B40:: @ 82F7B40 - .byte 0x04, 0x07, 0x04, 0x00 - - .align 2 -gUnknown_082F7B44:: @ 82F7B44 - .2byte 0x0019, 0x0029, 0x0039 - -gUnknown_082F7B4A:: @ 82F7B4A - .2byte 0x0019, 0x0029, 0x0049 - - .align 2 -gUnknown_082F7B50:: @ 82F7B50 - .2byte 0x270f, 0x0000, 0x005a, 0x270f, 0x270f, 0x270f, 0x0046, 0x270f - .2byte 0x270f, 0x0000, 0x270f, 0x0000, 0x270f, 0x270f, 0x003c, 0x0000 - .2byte 0x270f, 0x270f, 0x270f, 0x0000 - - .align 2 -gUnknown_082F7B78:: @ 82F7B78 - .string "ÀÁÂÇÈÉÊ$" - - .align 2 -gUnknown_082F7B80:: @ 82F7B80 - .string "ABCDEFG$" - - .align 2 -gUnknown_082F7B88:: @ 82F7B88 - .string "0123456$" - - .align 2 -gUnknown_082F7B90:: @ 82F7B90 - .4byte gUnknown_082F7B78 - .4byte gUnknown_082F7B78 - .4byte gUnknown_082F7B78 - .4byte gUnknown_082F7B80 - .4byte gUnknown_082F7B88 - - .align 2 -gUnknown_082F7BA4:: @ 82F7BA4 struct BgTemplate - .4byte 0x000001e0 - .4byte 0x000012c9 - .4byte 0x000012ea - .4byte 0x000021ff - .4byte 0x000000ff - .4byte 0x00000000 - - .align 2 -gUnknown_082F7BBC:: @ 82F7BBC - window_template 0x00, 0x01, 0x01, 0x1c, 0x02, 0x0d, 0x0013 - window_template 0x00, 0x01, 0x05, 0x1c, 0x0e, 0x0d, 0x004b - - .align 2 -gUnknown_082F7BCC:: @ 82F7BCC - window_template 0x00, 0x01, 0x05, 0x1c, 0x07, 0x0d, 0x004b - - .align 2 -gUnknown_082F7BD4:: @ 82F7BD4 - window_template 0x00, 0x01, 0x08, 0x13, 0x03, 0x0d, 0x0013 - window_template 0x00, 0x16, 0x07, 0x06, 0x04, 0x0d, 0x004c - - .align 2 -gUnknown_082F7BE4:: @ 82F7BE4 - window_template 0x00, 0x04, 0x06, 0x16, 0x05, 0x0d, 0x0013 - - .align 2 -gUnknown_082F7BEC:: @ 82F7BEC - window_template 0x00, 0x05, 0x08, 0x13, 0x03, 0x0d, 0x0013 - - .align 2 -gUnknown_082F449C_UnrefDupe:: @ 82F7BF4 - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 - .byte 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x03, 0x08 - .byte 0x09, 0x00, 0x00, 0x01, 0x02, 0x05, 0x06, 0x03 - .byte 0x04, 0x05, 0x08, 0x09, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 - .byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x02, 0x09 - .byte 0x00, 0x00, 0x01, 0x04, 0x05, 0x06, 0x07, 0x02 - .byte 0x03, 0x04, 0x09, 0x00, 0x00, 0x01, 0x06, 0x07 - .byte 0x02, 0x03, 0x04, 0x05, 0x06, 0x09, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02 - .byte 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x00 - .byte 0x00, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01 - .byte 0x02, 0x03, 0x00, 0x00, 0x05, 0x06, 0x07, 0x08 - .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00, 0x07 - .byte 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03 - .byte 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x02 - .byte 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00 - .byte 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08 - .byte 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 - .byte 0x08, 0x09, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 - .byte 0x06, 0x07, 0x08, 0x04, 0x05, 0x06, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x03, 0x04, 0x05, 0x05, 0x06, 0x03 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x04, 0x05, 0x06, 0x06, 0x07, 0x02, 0x02 - .byte 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x03, 0x04, 0x05, 0x05, 0x06, 0x07, 0x07, 0x08 - .byte 0x01, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00, 0x04 - .byte 0x05, 0x06, 0x06, 0x07, 0x08, 0x08, 0x09, 0x00 - .byte 0x00, 0x01, 0x02, 0x02, 0x03, 0x04, 0x01, 0x00 - .byte 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01 - .byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00 - .byte 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01 - .byte 0x02, 0x01, 0x02, 0x03, 0x02, 0x03, 0x00, 0x00 - .byte 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x02 - .byte 0x01, 0x02, 0x03, 0x02, 0x03, 0x04, 0x03, 0x04 - .byte 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x09, 0x09 - .byte 0x01, 0x01, 0x01, 0x09, 0x09, 0x09, 0x09, 0x09 - .byte 0x09, 0x09, 0x00, 0x00, 0x01, 0x01, 0x00, 0x09 - .byte 0x09, 0x09, 0x09, 0x09, 0x02, 0x02, 0x00, 0x00 - .byte 0x01, 0x01, 0x01, 0x09, 0x09, 0x09, 0x03, 0x03 - .byte 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03, 0x09 - .byte 0x03, 0x03, 0x04, 0x04, 0x00, 0x00, 0x01, 0x01 - .byte 0x02, 0x02, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00 - .byte 0x04, 0x06, 0x00, 0x00, 0x00, 0x03, 0x05, 0x07 - .byte 0x00, 0x00, 0x02, 0x04, 0x06, 0x08, 0x00, 0x01 - .byte 0x03, 0x05, 0x06, 0x09 - - .align 2 -gDodrioBerryBgPal1:: @ 82F7DF0 - .incbin "graphics/link_games/dodrioberry_bg1.gbapal" - - .align 2 - .incbin "graphics/link_games/dodrioberry_bg2.gbapal" - - .align 2 -gDodrioBerryPkmnPal:: @ 82F7E30 - .incbin "graphics/link_games/dodrioberry_pkmn.gbapal" - - .align 2 -gDodrioBerryShinyPal:: @ 82F7E50 - .incbin "graphics/link_games/dodrioberry_shiny.gbapal" - - .align 2 -gDodrioBerryStatusPal:: @ 82F7E70 - .incbin "graphics/link_games/dodrioberry_status.gbapal" - - .align 2 -gDodrioBerrySpritesPal:: @ 82F7E90 - .incbin "graphics/link_games/dodrioberry_berrysprites.gbapal" - - .align 2 -gDodrioBerrySpritesGfx:: @ 82F7EB0 - .incbin "graphics/link_games/dodrioberry_berrysprites.4bpp.lz" - - .align 2 -gDodrioBerryPlatformPal:: @ 82F8064 - .incbin "graphics/link_games/dodrioberry_platform.gbapal" - - .align 2 -gDodrioBerryBgGfx1:: @ 82F8084 - .incbin "graphics/link_games/dodrioberry_bg1.4bpp.lz" - - .align 2 -gDodrioBerryBgGfx2:: @ 82F8914 - .incbin "graphics/link_games/dodrioberry_bg2.4bpp.lz" - - .align 2 -gDodrioBerryStatusGfx:: @ 82F96E0 - .incbin "graphics/link_games/dodrioberry_status.4bpp.lz" - - .align 2 -gDodrioBerryPlatformGfx:: @ 82F9774 - .incbin "graphics/link_games/dodrioberry_platform.4bpp.lz" - - .align 2 -gDodrioBerryPkmnGfx:: @ 82F98BC - .incbin "graphics/link_games/dodrioberry_pkmn.4bpp.lz" - - .align 2 -gDodrioBerryBgTilemap1:: @ 82FAAD8 - .incbin "graphics/link_games/dodrioberry_bg1.bin.lz" - - .align 2 -gDodrioBerryBgTilemap2Right:: @ 82FAD44 - .incbin "graphics/link_games/dodrioberry_bg2right.bin.lz" - - .align 2 -gDodrioBerryBgTilemap2Left:: @ 82FAF94 - .incbin "graphics/link_games/dodrioberry_bg2left.bin.lz" - - .align 2 -gUnknown_082FB1E0:: @ 82FB1E0 - .byte 0x00, 0x00, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 - - .align 2 -gUnknown_082FB1E8:: @ 82FB1E8 - .byte 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_082FB1F0:: @ 82FB1F0 - .byte 0x00, 0x00, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00 - - .align 2 -gUnknown_082FB1F8:: @ 82FB1F8 - .byte 0x00, 0x40, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0x00 - - .align 2 -gUnknown_082FB200:: @ 82FB200 - .2byte 0x0000, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB208:: @ 82FB208 - .2byte 0x0040, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB210:: @ 82FB210 - .2byte 0x0080, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB218:: @ 82FB218 - .2byte 0x00c0, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB220:: @ 82FB220 - .2byte 0x0100, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB228:: @ 82FB228 - .4byte gUnknown_082FB200 - .4byte gUnknown_082FB208 - .4byte gUnknown_082FB210 - .4byte gUnknown_082FB218 - .4byte gUnknown_082FB220 - - .align 2 -gUnknown_082FB23C:: @ 82FB23C - .2byte 0x0000, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB244:: @ 82FB244 - .2byte 0x0004, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB24C:: @ 82FB24C - .2byte 0x0008, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB254:: @ 82FB254 - .4byte gUnknown_082FB23C - .4byte gUnknown_082FB244 - .4byte gUnknown_082FB24C - - .align 2 -gUnknown_082FB260:: @ 82FB260 - .2byte 0x0000, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB268:: @ 82FB268 - .2byte 0x0004, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB270:: @ 82FB270 - .2byte 0x0008, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB278:: @ 82FB278 - .2byte 0x000c, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB280:: @ 82FB280 - .2byte 0x0010, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB288:: @ 82FB288 - .2byte 0x0014, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB290:: @ 82FB290 - .2byte 0x0018, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB298:: @ 82FB298 - .2byte 0x001c, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB2A0:: @ 82FB2A0 - .2byte 0x0020, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB2A8:: @ 82FB2A8 - .4byte gUnknown_082FB260 - .4byte gUnknown_082FB268 - .4byte gUnknown_082FB270 - .4byte gUnknown_082FB278 - .4byte gUnknown_082FB280 - .4byte gUnknown_082FB288 - .4byte gUnknown_082FB290 - .4byte gUnknown_082FB298 - .4byte gUnknown_082FB2A0 - - .align 2 -gUnknown_082FB2CC:: @ 82FB2CC - .2byte 0x0000, 0x0014 - .2byte 0xfffe, 0x0000 - - .align 2 -gUnknown_082FB2D4:: @ 82FB2D4 - .4byte gUnknown_082FB2CC - - .align 2 -gUnknown_082FB2D8:: @ 82FB2D8 - obj_pal gDodrioBerryPkmnPal, 0x0000 - - .align 2 -gUnknown_082FB2E0:: @ 82FB2E0 - obj_pal gDodrioBerryShinyPal, 0x0001 - - .align 2 -gUnknown_082FB2E8:: @ 82FB2E8 - obj_pal gDodrioBerryStatusPal, 0x0002 - - .align 2 -gUnknown_082FB2F0:: @ 82FB2F0 - spr_template 0x0001, 0x0002, gUnknown_082FB1E8, gUnknown_082FB254, NULL, gDummySpriteAffineAnimTable, nullsub_15 - - .align 2 - .byte 0xD4, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44 - .byte 0x45, 0xFB, 0x00, 0x00 - - .align 2 -gUnknown_082FB314:: @ 82FB314 - obj_pal gDodrioBerrySpritesPal, 0x0003 - - .align 2 -gUnknown_082FB31C:: @ 82FB31C - .2byte 0x0058, 0x0080, 0x00a8, 0x00d0 - - .align 2 -gUnknown_082FB324:: @ 82FB324 - spr_template 0x0002, 0x0003, gUnknown_082FB1F0, gUnknown_082FB2A8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_082FB33C:: @ 82FB33C - spr_template 0x0002, 0x0003, gUnknown_082FB1E8, gUnknown_082FB2A8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_082FB354:: @ 82FB354 - .byte 0x1E, 0x14 - -gUnknown_082FB356:: @ 82FB356 - .byte 0xE6, 0x00 - - .align 2 -gUnknown_082FB358:: @ 82FB358 - .2byte 0x0037, 0x001e, 0x004a, 0x0000 - - .align 2 -gUnknown_082FB360:: @ 82FB360 - obj_pal gDodrioBerryPlatformPal, 0x0006 - - .align 2 -gUnknown_082FB368:: @ 82FB368 - spr_template 0x0005, 0x0006, gUnknown_082FB1F8, gUnknown_082FB2D4, NULL, gDummySpriteAffineAnimTable, sub_8028CF4 - - .align 2 -gUnknown_082FB380:: @ 82FB380 - .byte 0x01, 0x02, 0x03 - -gUnknown_082FB383:: @ 82FB383 - .byte 0x01, 0x04, 0x05 - .byte 0x01, 0x08, 0x09 - .byte 0x01, 0x06, 0x07 - - .align 2 -gUnknown_082FB38C:: @ 82FB38C - .byte 0x0c, 0x06, 0x00, 0x00 - - .align 2 -gUnknown_082FB390:: @ 82FB390 - .byte 0x09, 0x0a, 0x00, 0x00, 0x0f, 0x06, 0x00, 0x00 - - .align 2 -gUnknown_082FB398:: @ 82FB398 - .byte 0x0c, 0x06, 0x00, 0x00, 0x12, 0x0a, 0x00, 0x00 - .byte 0x06, 0x0a, 0x00, 0x00 - - .align 2 -gUnknown_082FB3A4:: @ 82FB3A4 - .byte 0x09, 0x0a, 0x00, 0x00, 0x0f, 0x06, 0x00, 0x00 - .byte 0x15, 0x0a, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00 - - .align 2 -gUnknown_082FB3B4:: @ 82FB3B4 - .byte 0x0c, 0x06, 0x00, 0x00, 0x12, 0x0a, 0x00, 0x00 - .byte 0x17, 0x06, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00 - .byte 0x06, 0x0a, 0x00, 0x00 - - .align 2 -gUnknown_082FB3C8:: @ 82FB3C8 - .4byte gUnknown_082FB38C - .4byte gUnknown_082FB390 - .4byte gUnknown_082FB398 - .4byte gUnknown_082FB3A4 - .4byte gUnknown_082FB3B4 - - .align 2 -gUnknown_082FB3DC:: @ 82FB3DC - .4byte gText_1Colon - .4byte gText_2Colon - .4byte gText_3Colon - .4byte gText_4Colon - .4byte gText_5Colon - - .align 2 -gUnknown_082FB3F0:: @ 82FB3F0 - .2byte 0x005c, 0x0084, 0x00ac, 0x00d4 - -gUnknown_082FB3F8:: @ 82FB3F8 - .2byte 0x0021, 0x0031, 0x0041, 0x0051, 0x0061 - -gUnknown_082FB402:: @ 82FB402 - .2byte 0x0011, 0x0021, 0x0031, 0x0041, 0x0051 - - .align 2 -gUnknown_082FB40C:: @ 82FB40C - .4byte 0x00000000, sub_8029338 - .4byte 0x00000001, sub_8029440 - .4byte 0x00000002, sub_802988C - .4byte 0x00000003, sub_802A010 - .4byte 0x00000004, sub_802A380 - .4byte 0x00000005, sub_802A454 - .4byte 0x00000006, sub_802A534 - .4byte 0x00000007, sub_802A588 - .4byte 0x00000008, unused_0 - .4byte 0x00000009, nullsub_16 - - .align 2 -gUnknown_082FB45C:: @ 82FB45C - .byte 0x00, 0x01, 0x02, 0x03, 0x04, 0x00, 0x00, 0x00 diff --git a/data/pokemon_jump.s b/data/pokemon_jump.s deleted file mode 100755 index b10c37600..000000000 --- a/data/pokemon_jump.s +++ /dev/null @@ -1,573 +0,0 @@ -#include "constants/species.h" - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - .align 2 -gUnknown_082FB63C:: @ 82FB63C - .2byte 0x001a, 0x001f, 0x0024, 0x0029, 0x002e, 0x0033, 0x0038, 0x003d - - .align 2 -gUnknown_082FB64C:: @ 82FB64C - .2byte 0x0000, 0x0001, 0x0001, 0x0002 - - .align 2 -gUnknown_082FB654:: @ 82FB654 - .2byte 0x005f, 0x0066, 0x00e4, 0x0105 - - .align 2 -gUnknown_082FB65C:: @ 82FB65C - .byte 0xfd, 0xfa, 0xf8, 0xf6, 0xf3, 0xf1, 0xef, 0xed - .byte 0xeb, 0xe9, 0xe7, 0xe5, 0xe4, 0xe3, 0xe2, 0xe2 - .byte 0xe2, 0xe4, 0xe5, 0xe6, 0xe7, 0xe9, 0xea, 0xec - .byte 0xee, 0xef, 0xf1, 0xf3, 0xf5, 0xf8, 0xfa, 0xfc - .byte 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - .byte 0xfd, 0xfa, 0xf7, 0xf5, 0xf2, 0xf0, 0xee, 0xec - .byte 0xea, 0xe8, 0xe6, 0xe4, 0xe3, 0xe2, 0xe2, 0xe4 - .byte 0xe6, 0xe8, 0xea, 0xec, 0xee, 0xf0, 0xf2, 0xf5 - .byte 0xf7, 0xfa, 0xfc, 0xff, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - .byte 0xfd, 0xfa, 0xf7, 0xf5, 0xf3, 0xf1, 0xef, 0xed - .byte 0xeb, 0xe9, 0xe7, 0xe5, 0xe4, 0xe3, 0xe2, 0xe2 - .byte 0xe2, 0xe2, 0xe3, 0xe3, 0xe4, 0xe4, 0xe5, 0xe5 - .byte 0xe6, 0xe7, 0xe8, 0xea, 0xec, 0xee, 0xf0, 0xf2 - .byte 0xf4, 0xf5, 0xf7, 0xfa, 0xfc, 0xff, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_082FB6EC:: @ 82FB6EC - .4byte 0x00000000, 0x00000000, 0x00000032, 0x00000064 - .4byte 0x000000c8, 0x000001f4 - - .align 2 -gUnknown_082FB704:: @ 82FB704 - .2byte 0x008a, 0x008d, 0x008e, 0x008f, 0x0090, 0x0091, 0x0092, 0x0093 - - .align 2 -gUnknown_082FB714:: @ 82FB714 - .4byte 0x00001388, 0x00000001, 0x00001f40, 0x00000002 - .4byte 0x00002ee0, 0x00000003, 0x00003e80, 0x00000004 - .4byte 0x00004e20, 0x00000005 - - .align 2 -gPkmnJumpPal1:: @ 82FB73C - .incbin "graphics/link_games/pkmnjump_pal1.gbapal" - - .align 2 -gPkmnJumpPal2:: @ 82FB75C - .incbin "graphics/link_games/pkmnjump_pal2.gbapal" - - .align 2 -gPkmnJumpRopeGfx1:: @ 82FB77C - .incbin "graphics/link_games/pkmnjump_rope1.4bpp.lz" - - .align 2 -gPkmnJumpRopeGfx2:: @ 82FB89C - .incbin "graphics/link_games/pkmnjump_rope2.4bpp.lz" - - .align 2 -gPkmnJumpRopeGfx3:: @ 82FBA70 - .incbin "graphics/link_games/pkmnjump_rope3.4bpp.lz" - - .align 2 -gPkmnJumpRopeGfx4:: @ 82FBBA0 - .incbin "graphics/link_games/pkmnjump_rope4.4bpp.lz" - - .align 2 -gPkmnJumpStarGfx:: @ 82FBC9C - .incbin "graphics/link_games/pkmnjump_star.4bpp.lz" - - .align 2 -gUnknown_082FBE08:: @ 82FBE08 - obj_tiles gPkmnJumpRopeGfx1, 0x0600, 0x0005 - - .align 2 - obj_tiles gPkmnJumpRopeGfx2, 0x0c00, 0x0006 - - .align 2 - obj_tiles gPkmnJumpRopeGfx3, 0x0600, 0x0007 - - .align 2 - obj_tiles gPkmnJumpRopeGfx4, 0x0600, 0x0008 - - .align 2 - obj_tiles gPkmnJumpStarGfx, 0x0200, 0x000a - - .align 2 -gUnknown_082FBE30:: @ 82FBE30 - obj_pal gPkmnJumpPal1, 0x0005 - - .align 2 - obj_pal gPkmnJumpPal2, 0x0006 - - .align 2 -gUnknown_082FBE40:: @ 82FBE40 - spr_template 0x0000, 0x0000, gUnknown_082FBEC8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - -gUnknown_082FBE58:: @ 82FBE58 - .2byte 0x0060, 0x0060, 0x0060, 0x0072, 0x0078, 0x0078, 0x0078, 0x0072 - .2byte 0x0060, 0x0060, 0x0046, 0x0050, 0x0060, 0x0072, 0x0078, 0x0080 - .2byte 0x0078, 0x0072, 0x0060, 0x0050, 0x0032, 0x0048, 0x0060, 0x0072 - .2byte 0x0080, 0x0088, 0x0080, 0x0072, 0x0060, 0x0048, 0x002a, 0x0048 - .2byte 0x0060, 0x0072, 0x0080, 0x0088, 0x0080, 0x0072, 0x0060, 0x0048 - -gUnknown_082FBEA8:: @ 82FBEA8 - .2byte 0x0010, 0x0028, 0x0048, 0x0068, 0x0088, 0x00a8, 0x00c8, 0x00e0 - - .align 2 -gUnknown_082FBEB8:: @ 82FBEB8 - .4byte gUnknown_082FBF78 - .4byte gUnknown_082FBF90 - .4byte gUnknown_082FBFA8 - .4byte gUnknown_082FBFC0 - - .align 2 -gUnknown_082FBEC8:: @ 82FBED0 - .byte 0x00, 0x00, 0x00, 0xc0, 0x00, 0x08, 0x00, 0x00 - - .align 2 -gUnknown_082FBED0:: @ 82FBED0 - .byte 0x00, 0x80, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 - - .align 2 -gUnknown_082FBED8:: @ 82FBED8 - .byte 0x00, 0x00, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 - - .align 2 -gUnknown_082FBEE0:: @ 82FBEE0 - .byte 0x00, 0x40, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00 - - .align 2 -gUnknown_082FBEE8:: @ 82FBEE8 - .2byte 0x0000, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBEF0:: @ 82FBEF0 - .2byte 0x0008, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBEF8:: @ 82FBEF8 - .2byte 0x0010, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF00:: @ 82FBF00 - .2byte 0x0018, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF08:: @ 82FBF08 - .2byte 0x0020, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF10:: @ 82FBF10 - .2byte 0x0028, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF18:: @ 82FBF18 - .2byte 0x0000, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF20:: @ 82FBF20 - .2byte 0x0010, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF28:: @ 82FBF28 - .2byte 0x0020, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF30:: @ 82FBF30 - .2byte 0x0030, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF38:: @ 82FBF38 - .2byte 0x0040, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF40:: @ 82FBF40 - .2byte 0x0050, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBF48:: @ 82FBF48 - .4byte gUnknown_082FBEE8 - .4byte gUnknown_082FBEF0 - .4byte gUnknown_082FBEF8 - .4byte gUnknown_082FBF00 - .4byte gUnknown_082FBF08 - .4byte gUnknown_082FBF10 - - .align 2 -gUnknown_082FBF60:: @ 82FBF60 - .4byte gUnknown_082FBF18 - .4byte gUnknown_082FBF20 - .4byte gUnknown_082FBF28 - .4byte gUnknown_082FBF30 - .4byte gUnknown_082FBF38 - .4byte gUnknown_082FBF40 - - .align 2 -gUnknown_082FBF78:: @ 82FBF78 - spr_template 0x0005, 0x0005, gUnknown_082FBED0, gUnknown_082FBF48, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_082FBF90:: @ 82FBF90 - spr_template 0x0006, 0x0005, gUnknown_082FBED8, gUnknown_082FBF60, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_082FBFA8:: @ 82FBFA8 - spr_template 0x0007, 0x0005, gUnknown_082FBEE0, gUnknown_082FBF48, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_082FBFC0:: @ 82FBFC0 - spr_template 0x0008, 0x0005, gUnknown_082FBEE0, gUnknown_082FBF48, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_082FBFD8:: @ 82FBFD8 - .byte 0x00, 0x00, 0x00, 0x40, 0x00, 0x04, 0x00, 0x00 - - .align 2 -gUnknown_082FBFE0:: @ 82FBFE0 - .2byte 0x0000, 0x0000 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FBFE8:: @ 82FBFE8 - .2byte 0x0000, 0x0004 - .2byte 0x0004, 0x0004 - .2byte 0x0008, 0x0004 - .2byte 0x000c, 0x0004 - .2byte 0xfffd, 0x0001 - .2byte 0x0000, 0x0004 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FC004:: @ 82FC004 - .4byte gUnknown_082FBFE0 - .4byte gUnknown_082FBFE8 - - .align 2 -gUnknown_082FC00C:: @ 82FC00C - spr_template 0x000a, 0x0005, gUnknown_082FBFD8, gUnknown_082FC004, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gPkmnJumpPal3:: @ 82FC024 - .incbin "graphics/link_games/pkmnjump_pal3.gbapal" - - .align 2 -gPkmnJumpBgPal:: @ 82FC044 - .incbin "graphics/link_games/pkmnjump_bg.gbapal" - - .align 2 -gPkmnJumpBgGfx:: @ 82FC064 - .incbin "graphics/link_games/pkmnjump_bg.4bpp.lz" - - .align 2 -gPkmnJumpBgTilemap:: @ 82FC290 - .incbin "graphics/link_games/pkmnjump_bg.bin.lz" - - .align 2 -gPkmnJumpVenusaurPal:: @ 82FC440 - .incbin "graphics/link_games/pkmnjump_venusaur.gbapal" - - .align 2 -gPkmnJumpVenusaurGfx:: @ 82FC460 - .incbin "graphics/link_games/pkmnjump_venusaur.4bpp.lz" - - .align 2 -gPkmnJumpVenusaurTilemap:: @ 82FCDB0 - .incbin "graphics/link_games/pkmnjump_venusaur.bin.lz" - - .align 2 -gPkmnJumpResultsPal:: @ 82FD168 - .incbin "graphics/link_games/pkmnjump_results.gbapal" - - .align 2 -gPkmnJumpResultsGfx:: @ 82FD188 - .incbin "graphics/link_games/pkmnjump_results.4bpp.lz" - - .align 2 -gPkmnJumpResultsTilemap:: @ 82FDC38 - .incbin "graphics/link_games/pkmnjump_results.bin.lz" - - .align 2 -gUnknown_082FE164:: @ 82FE164 struct BgTemplate - .4byte 0x000001b0, 0x000025e6, 0x000016c9, 0x000031df - - .align 2 -gUnknown_082FE174:: @ 82FE174 - window_template 0x00, 0x13, 0x00, 0x06, 0x02, 0x02, 0x0013 - window_template 0x00, 0x08, 0x00, 0x06, 0x02, 0x02, 0x001f - null_window_template - - .align 2 -gUnknown_082FE18C:: @ 82FE18C - .4byte 0x00000000, sub_802D150 - .4byte 0x00000001, sub_802D2E4 - .4byte 0x00000002, sub_802D350 - .4byte 0x00000003, sub_802D3BC - .4byte 0x00000004, sub_802D448 - .4byte 0x00000005, sub_802D4F4 - .4byte 0x00000006, sub_802D598 - .4byte 0x00000007, sub_802D5E4 - .4byte 0x00000009, sub_802D72C - .4byte 0x00000008, sub_802D688 - - .align 2 -gUnknown_082FE1DC:: @ 82FE1DC - .byte 0x00, 0x02, 0x03 - -gUnknown_082FE1DF:: @ 82FE1DF - .byte 0x02, 0x02, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00 - .byte 0x00, 0x02, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_082FE1EC:: @ 82FE1EC - obj_tiles gUnknown_082FF1F8, 0x0000, 0x0320 - - .align 2 -gUnknown_082FE1F4:: @ 82FE1F4 - obj_pal gUnknown_082FF1D8, 0x0320 - - .align 2 -gUnknown_082FE1FC:: @ 82FE1FC - .2byte 0x0006, 0x0008, 0x0010, 0x0008 - - .align 2 -gUnknown_082FE204:: @ 82FE204 - .2byte 0x0006, 0x0008, 0x000b, 0x0006, 0x0010, 0x0008 - - .align 2 -gUnknown_082FE210:: @ 82FE210 - .2byte 0x0002, 0x0006, 0x0006, 0x0008, 0x0010, 0x0008, 0x0014, 0x0006 - - .align 2 -gUnknown_082FE220:: @ 82FE220 - .2byte 0x0002, 0x0006, 0x0006, 0x0008, 0x000b, 0x0006 - .2byte 0x0010, 0x0008, 0x0014, 0x0006 - - .align 2 -gUnknown_082FE234:: @ 82FE234 - .4byte gUnknown_082FE1FC - .4byte gUnknown_082FE204 - .4byte gUnknown_082FE210 - .4byte gUnknown_082FE220 - - .align 2 -gUnknown_082FE244:: @ 82FE244 - .2byte 0x0058, 0x0098 - -gUnknown_082FE248:: @ 82FE248 - .2byte 0x0058, 0x0078, 0x0098 - -gUnknown_082FE24E:: @ 82FE24E - .2byte 0x0038, 0x0058, 0x0098, 0x00b8 - -gUnknown_082FE256:: @ 82FE256 - .2byte 0x0038, 0x0058, 0x0078, 0x0098, 0x00b8 - - .align 2 -gUnknown_082FE260:: @ 82FE260 - .4byte gUnknown_082FE244 - .4byte gUnknown_082FE248 - .4byte gUnknown_082FE24E - .4byte gUnknown_082FE256 - - .align 2 -gUnknown_082FE270:: @ 82FE270 - .4byte 0x1c010100, 0x00010f09 - - .align 2 -gUnknown_082FE278:: @ 82FE278 - .4byte gText_JumpsInARow - .4byte gText_BestScore2 - .4byte gText_ExcellentsInARow - - .align 2 -gPkmnJump321StartPal1:: @ 82FE284 - .incbin "graphics/link_games/pkmnjump_321start1.gbapal" - - .align 2 -gPkmnJump321StartGfx1:: @ 82FE2A4 - .incbin "graphics/link_games/pkmnjump_321start1.4bpp.lz" - - .align 2 -gUnknown_082FE6C8:: @ 82FE6C8 - obj_tiles gPkmnJump321StartGfx1, 0x0c00, 0x2000 - null_obj_tiles - - .align 2 -gUnknown_082FE6D8:: @ 82FE6D8 - obj_pal gPkmnJump321StartPal1, 0x2000 - null_obj_pal - - .align 2 -gUnknown_082FE6E8:: @ 82FE6E8 - .2byte 0x0000, 0x0000 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FE6F0:: @ 82FE6F0 - .2byte 0x0010, 0x0000 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FE6F8:: @ 82FE6F8 - .2byte 0x0020, 0x0000 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FE700:: @ 82FE700 - .2byte 0x0040, 0x0000 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FE708:: @ 82FE708 - .2byte 0x0030, 0x0000 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FE710:: @ 82FE710 - .2byte 0x0050, 0x0000 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FE718:: @ 82FE718 - .4byte gUnknown_082FE6E8 - .4byte gUnknown_082FE6F0 - .4byte gUnknown_082FE6F8 - .4byte gUnknown_082FE700 - .4byte gUnknown_082FE708 - .4byte gUnknown_082FE710 - - .align 2 -gUnknown_082FE730:: @ 82FE730 - spr_template 0x2000, 0x2000, gUnknown_08524914, gUnknown_082FE718, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_082FE748:: @ 82FE748 - .4byte sub_802E83C - .4byte sub_802E8C8 - .4byte sub_802EA50 - .4byte sub_802EAB0 - - .align 2 -gPkmnJump321StartPal2:: @ 82FE758 - .incbin "graphics/link_games/pkmnjump_321start2.gbapal" - - .align 2 -gPkmnJump321StartGfx2:: @ 82FE778 - .incbin "graphics/link_games/pkmnjump_321start2.4bpp.lz" - - .align 2 -gUnknown_082FEBCC:: @ 82FEBCC - obj_tiles gPkmnJump321StartGfx2, 0x0e00, 0x0000 - - .align 2 -gUnknown_082FEBD4:: @ 82FEBD4 - obj_pal gPkmnJump321StartPal2, 0x0000 - - .align 2 -gUnknown_082FEBDC:: @ 82FEBDC - .byte 0x00, 0x03, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_082FEBE4:: @ 82FEBE4 - .byte 0x00, 0x40, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_082FEBEC:: @ 82FEBEC - .2byte 0x0000, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FEBF4:: @ 82FEBF4 - .2byte 0x0010, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FEBFC:: @ 82FEBFC - .2byte 0x0020, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FEC04:: @ 82FEC04 - .4byte gUnknown_082FEBEC - .4byte gUnknown_082FEBF4 - .4byte gUnknown_082FEBFC - - .align 2 -gUnknown_082FEC10:: @ 82FEC10 - .2byte 0x0030, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FEC18:: @ 82FEC18 - .2byte 0x0050, 0x0001 - .2byte 0xffff, 0x0000 - - .align 2 -gUnknown_082FEC20:: @ 82FEC20 - .4byte gUnknown_082FEC10 - .4byte gUnknown_082FEC18 - - .align 2 -gUnknown_082FEC28:: @ 82FEC28 - .2byte 0x0100, 0x0100 - .2byte 0x0000, 0x0000 - .2byte 0x7fff, 0x0000 - .2byte 0x0000, 0x0000 - - .align 2 -gUnknown_082FEC38:: @ 82FEC38 - .2byte 0x0100, 0x0100 - .2byte 0x0000, 0x0000 - .2byte 0x0010, 0xfff0 - .2byte 0x0800, 0x0000 - .2byte 0x7fff, 0x0000 - .2byte 0x0000, 0x0000 - - .align 2 -gUnknown_082FEC50:: @ 82FEC50 - .2byte 0xffee, 0x0012 - .2byte 0x0800, 0x0000 - .2byte 0x7fff, 0x0000 - .2byte 0x0000, 0x0000 - - .align 2 -gUnknown_082FEC60:: @ 82FEC60 - .2byte 0x0006, 0xfffa - .2byte 0x0800, 0x0000 - .2byte 0xfffc, 0x0004 - .2byte 0x0800, 0x0000 - .2byte 0x0100, 0x0100 - .2byte 0x0000, 0x0000 - .2byte 0x7fff, 0x0000 - .2byte 0x0000, 0x0000 - - .align 2 -gUnknown_082FEC80:: @ 82FEC80 - .4byte gUnknown_082FEC28 - .4byte gUnknown_082FEC38 - .4byte gUnknown_082FEC50 - .4byte gUnknown_082FEC60 - -gUnknown_082FEC90:: @ 82FEC90 - spr_template 0x0000, 0x0000, gUnknown_082FEBDC, gUnknown_082FEC04, NULL, gUnknown_082FEC80, SpriteCallbackDummy - -gUnknown_082FECA8:: @ 82FECA8 - spr_template 0x0000, 0x0000, gUnknown_082FEBE4, gUnknown_082FEC20, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy diff --git a/data/pokenav.s b/data/pokenav.s deleted file mode 100644 index 2ed2cf9a0..000000000 --- a/data/pokenav.s +++ /dev/null @@ -1,1658 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -// pokenav_unk_2.s -gUnknown_0861FC78:: @ 861FC78 - .incbin "graphics/pokenav/bg.gbapal" - -gUnknown_0861FC98:: @ 861FC98 - .incbin "graphics/pokenav/bg.4bpp.lz" - -gUnknown_0861FCAC:: @ 861FCAC - .incbin "graphics/pokenav/bg.bin.lz" - -gUnknown_0861FD4C:: @ 861FD4C - .incbin "graphics/pokenav/outline.gbapal" - -gUnknown_0861FD6C:: @ 861FD6C - .incbin "graphics/pokenav/outline.4bpp.lz" - -gUnknown_0861FFF4:: @ 861FFF4 - .incbin "graphics/pokenav/outline_map.bin.lz" - -gUnknown_08620104:: @ 8620104 - .incbin "graphics/pokenav/blue_light.gbapal" - -gUnknown_08620124:: @ 8620124 - .incbin "graphics/pokenav/blue_light.4bpp.lz" - -gUnknown_08620194:: @ 8620194 - .byte 0xF5, 0x10, 0, 0, 0x7A, 0x21, 0, 0, 0xFF, 0x31, 0, 0 - -gUnknown_086201A0:: @ 86201A0 - .4byte NULL - .4byte sub_81C9C6C - .4byte sub_81C9CA8 - .4byte sub_81C9D44 - .4byte sub_81C9DD8 - .4byte sub_81C9E58 - .4byte sub_81C9EC8 - .4byte sub_81C9EF8 - .4byte sub_81C9F28 - -gUnknown_086201C4:: @ 86201C4 - .4byte gPokenavOptions_Gfx - .byte 0, 0x34, 3, 0 - .4byte gUnknown_08620124 - .byte 0, 1, 1, 0 - -gUnknown_086201D4:: @ 86201D4 - .4byte gPokenavOptions_Pal + 0x0, 4 - .4byte gPokenavOptions_Pal + 0x20, 5 - .4byte gPokenavOptions_Pal + 0x40, 6 - .4byte gPokenavOptions_Pal + 0x60, 7 - .4byte gPokenavOptions_Pal + 0x80, 8 - .4byte gUnknown_08620104, 3 - .4byte 0, 0 - -gUnknown_0862020C:: @ 862020C - .2byte 0, 0 - -gUnknown_08620210:: @ 8620210 - .2byte 0x20, 1 - -gUnknown_08620214:: @ 8620214 - .2byte 0x40, 4 - -gUnknown_08620218:: @ 8620218 - .2byte 0x60, 2 - -gUnknown_0862021C:: @ 862021C - .2byte 0x80, 3 - -gUnknown_08620220:: @ 8620220 - .2byte 0xA0, 1 - -gUnknown_08620224:: @ 8620224 - .2byte 0xC0, 1 - -gUnknown_08620228:: @ 8620228 - .2byte 0xE0, 4 - -gUnknown_0862022C:: @ 862022C - .2byte 0x100, 1 - -gUnknown_08620230:: @ 8620230 - .2byte 0x120, 2 - -gUnknown_08620234:: @ 8620234 - .2byte 0x140, 0 - -gUnknown_08620238:: @ 8620238 - .2byte 0x160, 0 - -gUnknown_0862023C:: @ 862023C - .2byte 0x180, 3 - -gUnknown_08620240:: @ 8620240 - .2byte 0x2A, 0x14 - -gUnknown_08620244:: @ 8620244 - .4byte gUnknown_0862020C - .4byte gUnknown_08620210 - .4byte gUnknown_0862021C - .4byte NULL - .4byte NULL - .4byte NULL - .2byte 0x2A, 0x14 - .4byte gUnknown_0862020C - .4byte gUnknown_08620210 - .4byte gUnknown_08620214 - .4byte gUnknown_0862021C - .4byte NULL - .4byte NULL - .2byte 0x2A, 0x14 - .4byte gUnknown_0862020C - .4byte gUnknown_08620210 - .4byte gUnknown_08620214 - .4byte gUnknown_08620218 - .4byte gUnknown_0862021C - .4byte NULL - .2byte 0x38, 0x14 - .4byte gUnknown_08620220 - .4byte gUnknown_08620224 - .4byte gUnknown_0862023C - .4byte NULL - .4byte NULL - .4byte NULL - .2byte 0x28, 0x10 - .4byte gUnknown_08620228 - .4byte gUnknown_0862022C - .4byte gUnknown_08620230 - .4byte gUnknown_08620234 - .4byte gUnknown_08620238 - .4byte gUnknown_0862023C - -gUnknown_086202CC:: @ 86202CC - window_template 1, 3, 17, 0x18, 2, 1, 8 - -gUnknown_086202D4:: @ 86202D4 - .4byte gUnknown_085EBCC5 - .4byte gUnknown_085EBCE8 - .4byte gUnknown_085EBD01 - .4byte gUnknown_085EBD1C - .4byte gUnknown_085EBD34 - .4byte gUnknown_085EBD83 - .4byte gUnknown_085EBDA2 - .4byte gUnknown_085EBDBF - .4byte gUnknown_085EBDDB - .4byte gUnknown_085EBDEE - .4byte gUnknown_085EBE06 - .4byte gUnknown_085EBE19 - .4byte gUnknown_085EBE2D - .4byte gUnknown_085EBE41 - -gUnknown_0862030C:: @ 862030C - .byte 6, 8, 7 - -gUnknown_0862030F:: @ 862030F - .byte 6, 8, 7, 0, 0 - -gUnknown_08620314:: @ 8620314 - .byte 0, 0x40, 0, 0x80, 0, 8, 0, 0 - -gUnknown_0862031C:: @ 862031C - obj_rot_scal_anim_frame 0x100, 0x100, 0, 0 - obj_rot_scal_anim_end - -gUnknown_0862032C:: @ 862032C - obj_rot_scal_anim_frame 0x100, 0x100, 0, 0 - obj_rot_scal_anim_frame 0x10, 0x10, 0, 0x12 - obj_rot_scal_anim_end - -gUnknown_08620344:: @ 8620344 - .4byte gUnknown_0862031C - .4byte gUnknown_0862032C - -gUnknown_0862034C:: @ 862034C - spr_template 3, 4, gUnknown_08620314, gDummySpriteAnimTable, NULL, gUnknown_08620344, SpriteCallbackDummy - -gUnknown_08620364:: @ 8620364 - .2byte 0x4000 - .2byte 0x8000 - .2byte 0x800 - .2byte 0 - -gUnknown_0862036C:: @ 862036C - spr_template 1, 3, gUnknown_08620364, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - -gUnknown_08620384:: @ 8620384 - .4byte 0x4000040 - .4byte 0xa2600001 - .byte 1, 0, 0, 0 - -// pokenav_unk_3.s -gUnknown_08620390:: @ 8620390 - .string "Becalm fighting emotions.$" - -gUnknown_086203AA:: @ 86203AA - .string "Fragrant GRASS POKéMON.$" - -gUnknown_086203C2:: @ 86203C2 - .string "Soothing aromas make the$" - -gUnknown_086203DB:: @ 86203DB - .string "body and mind healthy.$" - -gUnknown_086203F2:: @ 86203F2 - .string "I'm not very good at this.$" - -gUnknown_0862040D:: @ 862040D - .string "Ruin-exploration partners.$" - -gUnknown_08620428:: @ 8620428 - .string "I am searching for undersea$" - -gUnknown_08620444:: @ 8620444 - .string "ruins and relics.$" - -gUnknown_08620456:: @ 8620456 - .string "Overwhelm with power!$" - -gUnknown_0862046C:: @ 862046C - .string "Craggy ROCK POKéMON.$" - -gUnknown_08620481:: @ 8620481 - .string "In search of ancient lore,$" - -gUnknown_0862049C:: @ 862049C - .string "I travel the world.$" - -gUnknown_086204B0:: @ 86204B0 - .string "I'm going to try hard!$" - -gUnknown_086204C7:: @ 86204C7 - .string "Good swimmer POKéMON.$" - -gUnknown_086204DD:: @ 86204DD - .string "I wish I could swim without$" - -gUnknown_086204F9:: @ 86204F9 - .string "using an inner tube.$" - -gUnknown_0862050E:: @ 862050E - .string "I don't know. I'll try hard.$" - -gUnknown_0862052B:: @ 862052B - .string "WATER POKéMON are buddies.$" - -gUnknown_08620546:: @ 8620546 - .string "It's not like I can't swim.$" - -gUnknown_08620562:: @ 8620562 - .string "I just like my inner tube.$" - -gUnknown_0862057D:: @ 862057D - .string "We split our duties.$" - -gUnknown_08620592:: @ 8620592 - .string "We like friendly POKéMON.$" - -gUnknown_086205AC:: @ 86205AC - .string "We enjoy POKéMON together$" - -gUnknown_086205C6:: @ 86205C6 - .string "as sister and brother.$" - -gUnknown_086205DD:: @ 86205DD - .string "I finish with power moves!$" - -gUnknown_086205F8:: @ 86205F8 - .string "A mix of different types.$" - -gUnknown_08620612:: @ 8620612 - .string "I aim to become the ultimate$" - -gUnknown_0862062F:: @ 862062F - .string "TRAINER!$" - -gUnknown_08620638:: @ 8620638 - .string "Exploit the foe's weakness.$" - -gUnknown_08620654:: @ 8620654 - .string "Balance is crucial.$" - -gUnknown_08620668:: @ 8620668 - .string "My goal is to become the$" - -gUnknown_08620681:: @ 8620681 - .string "POKéMON CHAMPION.$" - -gUnknown_08620693:: @ 8620693 - .string "Upset the opponent.$" - -gUnknown_086206A7:: @ 86206A7 - .string "Type doesn't matter.$" - -gUnknown_086206BC:: @ 86206BC - .string "I'm a top student at the$" - -gUnknown_086206D5:: @ 86206D5 - .string "TRAINER'S SCHOOL.$" - -gUnknown_086206E7:: @ 86206E7 - .string "Slow, steady suffering.$" - -gUnknown_086206FF:: @ 86206FF - .string "Scary to meet at night.$" - -gUnknown_08620717:: @ 8620717 - .string "I see things that others$" - -gUnknown_08620730:: @ 8620730 - .string "can't see...$" - -gUnknown_0862073D:: @ 862073D - .string "Anything to win.$" - -gUnknown_0862074E:: @ 862074E - .string "Gorgeous type!$" - -gUnknown_0862075D:: @ 862075D - .string "I have a pool specially for$" - -gUnknown_08620779:: @ 8620779 - .string "my POKéMON at home.$" - -gUnknown_0862078D:: @ 862078D - .string "You'll fall under my spell!$" - -gUnknown_086207A9:: @ 86207A9 - .string "Mature WATER type.$" - -gUnknown_086207BC:: @ 86207BC - .string "I dream of cruising around$" - -gUnknown_086207D7:: @ 86207D7 - .string "the world on a luxury liner.$" - -gUnknown_086207F4:: @ 86207F4 - .string "I'll lead you astray.$" - -gUnknown_0862080A:: @ 862080A - .string "Cute, of course.$" - -gUnknown_0862081B:: @ 862081B - .string "I love the SAFARI ZONE.$" - -gUnknown_08620833:: @ 8620833 - .string "I seem to end up there.$" - -gUnknown_0862084B:: @ 862084B - .string "Strategy? Who needs it?$" - -gUnknown_08620863:: @ 8620863 - .string "I spent big money on it!$" - -gUnknown_0862087C:: @ 862087C - .string "I, being rich, sleep in a$" - -gUnknown_08620896:: @ 8620896 - .string "custom POKéMON bed.$" - -gUnknown_086208AA:: @ 86208AA - .string "Wrestle down with power.$" - -gUnknown_086208C3:: @ 86208C3 - .string "Took all night to catch.$" - -gUnknown_086208DC:: @ 86208DC - .string "Big, burly, and buff$" - -gUnknown_086208F1:: @ 86208F1 - .string "POKéMON are the best...$" - -gUnknown_08620909:: @ 8620909 - .string "Ram at full speed!$" - -gUnknown_0862091C:: @ 862091C - .string "Funky WATER type!$" - -gUnknown_0862092E:: @ 862092E - .string "If I can't be out swimming,$" - -gUnknown_0862094A:: @ 862094A - .string "I'll be pumping weights.$" - -gUnknown_08620963:: @ 8620963 - .string "Grand slam pummeling!$" - -gUnknown_08620979:: @ 8620979 - .string "FIGHTING type.$" - -gUnknown_08620988:: @ 8620988 - .string "Not to brag, but I can bust$" - -gUnknown_086209A4:: @ 86209A4 - .string "ten roof tiles!$" - -gUnknown_086209B4:: @ 86209B4 - .string "Witness karate power!$" - -gUnknown_086209CA:: @ 86209CA - .string "My partners in training!$" - -gUnknown_086209E3:: @ 86209E3 - .string "Let us discuss matters of$" - -gUnknown_086209FD:: @ 86209FD - .string "the world with bare fists!$" - -gUnknown_08620A18:: @ 8620A18 - .string "Rock to stunning sounds!$" - -gUnknown_08620A31:: @ 8620A31 - .string "Electric-and-sound combo!$" - -gUnknown_08620A4B:: @ 8620A4B - .string "My compositions will shock$" - -gUnknown_08620A66:: @ 8620A66 - .string "you and stun you!$" - -gUnknown_08620A78:: @ 8620A78 - .string "I'll electrify you!$" - -gUnknown_08620A8C:: @ 8620A8C - .string "They're ELECTRIC!$" - -gUnknown_08620A9E:: @ 8620A9E - .string "I want to make people cry$" - -gUnknown_08620AB8:: @ 8620AB8 - .string "with songs from my heart.$" - -gUnknown_08620AD2:: @ 8620AD2 - .string "Burn it all down!$" - -gUnknown_08620AE4:: @ 8620AE4 - .string "Burn-inducing POKéMON.$" - -gUnknown_08620AFB:: @ 8620AFB - .string "When you light a campfire,$" - -gUnknown_08620B16:: @ 8620B16 - .string "be sure there's some water.$" - -gUnknown_08620B32:: @ 8620B32 - .string "Hang in and be tenacious!$" - -gUnknown_08620B4C:: @ 8620B4C - .string "I'll raise any POKéMON.$" - -gUnknown_08620B64:: @ 8620B64 - .string "POKéMON raised in the wild$" - -gUnknown_08620B7F:: @ 8620B7F - .string "grow strong!$" - -gUnknown_08620B8C:: @ 8620B8C - .string "Our love lets us prevail.$" - -gUnknown_08620BA6:: @ 8620BA6 - .string "We've had them for years.$" - -gUnknown_08620BC0:: @ 8620BC0 - .string "Married 50 years, we've$" - -gUnknown_08620BD8:: @ 8620BD8 - .string "devotedly raised POKéMON.$" - -gUnknown_08620BF2:: @ 8620BF2 - .string "Attack in waves!$" - -gUnknown_08620C03:: @ 8620C03 - .string "BUG POKéMON are cool.$" - -gUnknown_08620C19:: @ 8620C19 - .string "I go into the forest every$" - -gUnknown_08620C34:: @ 8620C34 - .string "day to catch BUG POKéMON.$" - -gUnknown_08620C4E:: @ 8620C4E - .string "Daze and confuse!$" - -gUnknown_08620C60:: @ 8620C60 - .string "Ones with weird powers.$" - -gUnknown_08620C78:: @ 8620C78 - .string "I can see through exactly$" - -gUnknown_08620C92:: @ 8620C92 - .string "what you're thinking!$" - -gUnknown_08620CA8:: @ 8620CA8 - .string "Battle at full power.$" - -gUnknown_08620CBE:: @ 8620CBE - .string "POKéMON of many mysteries.$" - -gUnknown_08620CD9:: @ 8620CD9 - .string "When we spoke, I was really$" - -gUnknown_08620CF5:: @ 8620CF5 - .string "using telepathy.$" - -gUnknown_08620D06:: @ 8620D06 - .string "Calm and collected.$" - -gUnknown_08620D1A:: @ 8620D1A - .string "POKéMON of distinction.$" - -gUnknown_08620D32:: @ 8620D32 - .string "We enjoy a spot of tea$" - -gUnknown_08620D49:: @ 8620D49 - .string "every day. It's imported.$" - -gUnknown_08620D63:: @ 8620D63 - .string "I use my head to battle.$" - -gUnknown_08620D7C:: @ 8620D7C - .string "I love any kind of POKéMON!$" - -gUnknown_08620D98:: @ 8620D98 - .string "My daddy gives me spending$" - -gUnknown_08620DB3:: @ 8620DB3 - .string "money if I ace a test.$" - -gUnknown_08620DCA:: @ 8620DCA - .string "My knowledge rules!$" - -gUnknown_08620DDE:: @ 8620DDE - .string "Any smart POKéMON!$" - -gUnknown_08620DF1:: @ 8620DF1 - .string "I want to be a POKéMON$" - -gUnknown_08620E08:: @ 8620E08 - .string "researcher in the future.$" - -gUnknown_08620E22:: @ 8620E22 - .string "We talk it over first.$" - -gUnknown_08620E39:: @ 8620E39 - .string "POKéMON that we both like.$" - -gUnknown_08620E54:: @ 8620E54 - .string "We're senior and junior$" - -gUnknown_08620E6C:: @ 8620E6C - .string "students into POKéMON!$" - -gUnknown_08620E83:: @ 8620E83 - .string "Go for it, my dears!$" - -gUnknown_08620E98:: @ 8620E98 - .string "I have no likes or dislikes.$" - -gUnknown_08620EB5:: @ 8620EB5 - .string "While out shopping for$" - -gUnknown_08620ECC:: @ 8620ECC - .string "supper, I battle too.$" - -gUnknown_08620EE2:: @ 8620EE2 - .string "I battle with love!$" - -gUnknown_08620EF6:: @ 8620EF6 - .string "A POKéMON raised with love!$" - -gUnknown_08620F12:: @ 8620F12 - .string "It's important to build$" - -gUnknown_08620F2A:: @ 8620F2A - .string "trust with your POKéMON.$" - -gUnknown_08620F43:: @ 8620F43 - .string "I see through your moves!$" - -gUnknown_08620F5D:: @ 8620F5D - .string "The essence of FIGHTING.$" - -gUnknown_08620F76:: @ 8620F76 - .string "I'm not ready to give way$" - -gUnknown_08620F90:: @ 8620F90 - .string "to the young yet!$" - -gUnknown_08620FA2:: @ 8620FA2 - .string "Attack while defending.$" - -gUnknown_08620FBA:: @ 8620FBA - .string "The FIGHTING type.$" - -gUnknown_08620FCD:: @ 8620FCD - .string "Being old, I have my own$" - -gUnknown_08620FE6:: @ 8620FE6 - .string "style of battling.$" - -gUnknown_08620FF9:: @ 8620FF9 - .string "I do what I can.$" - -gUnknown_0862100A:: @ 862100A - .string "I use different types.$" - -gUnknown_08621021:: @ 8621021 - .string "I'm going to keep working$" - -gUnknown_0862103B:: @ 862103B - .string "until I beat a GYM LEADER.$" - -gUnknown_08621056:: @ 8621056 - .string "I battle patiently.$" - -gUnknown_0862106A:: @ 862106A - .string "WATER POKéMON to battle!$" - -gUnknown_08621083:: @ 8621083 - .string "I'm the world's only guy to$" - -gUnknown_0862109F:: @ 862109F - .string "catch a huge POKéMON!$" - -gUnknown_086210B5:: @ 86210B5 - .string "Exploit the environment!$" - -gUnknown_086210CE:: @ 86210CE - .string "All hail the WATER type!$" - -gUnknown_086210E7:: @ 86210E7 - .string "I won't be beaten by some$" - -gUnknown_08621101:: @ 8621101 - .string "beach bum SWIMMER!$" - -gUnknown_08621114:: @ 8621114 - .string "Speed above all!$" - -gUnknown_08621125:: @ 8621125 - .string "I use a speedy POKéMON.$" - -gUnknown_0862113D:: @ 862113D - .string "A marathon is a challenge$" - -gUnknown_08621157:: @ 8621157 - .string "against your own self.$" - -gUnknown_0862116E:: @ 862116E - .string "Defense is crucial.$" - -gUnknown_08621182:: @ 8621182 - .string "My POKéMON is solid.$" - -gUnknown_08621197:: @ 8621197 - .string "I started this for dieting,$" - -gUnknown_086211B3:: @ 86211B3 - .string "but I got right into it.$" - -gUnknown_086211CC:: @ 86211CC - .string "Strike before stricken!$" - -gUnknown_086211E4:: @ 86211E4 - .string "A fast-running POKéMON!$" - -gUnknown_086211FC:: @ 86211FC - .string "If you ran and ran, you'd$" - -gUnknown_08621216:: @ 8621216 - .string "become one with the wind.$" - -gUnknown_08621230:: @ 8621230 - .string "All-out offensive!$" - -gUnknown_08621243:: @ 8621243 - .string "WATER POKéMON rule!$" - -gUnknown_08621257:: @ 8621257 - .string "I must swim over 6 miles$" - -gUnknown_08621270:: @ 8621270 - .string "every day.$" - -gUnknown_0862127B:: @ 862127B - .string "Push and push again!$" - -gUnknown_08621290:: @ 8621290 - .string "The strength of STEEL.$" - -gUnknown_086212A7:: @ 86212A7 - .string "If you're sweating, get$" - -gUnknown_086212BF:: @ 86212BF - .string "fluids into you regularly.$" - -gUnknown_086212DA:: @ 86212DA - .string "Draw the power of WATER.$" - -gUnknown_086212F3:: @ 86212F3 - .string "Toughened WATER POKéMON.$" - -gUnknown_0862130C:: @ 862130C - .string "Training POKéMON is good,$" - -gUnknown_08621326:: @ 8621326 - .string "but don't neglect yourself.$" - -gUnknown_08621342:: @ 8621342 - .string "It's about POKéMON power!$" - -gUnknown_0862135C:: @ 862135C - .string "See the power of DRAGONS!$" - -gUnknown_08621376:: @ 8621376 - .string "I'll become legendary as the$" - -gUnknown_08621393:: @ 8621393 - .string "strongest one day!$" - -gUnknown_086213A6:: @ 86213A6 - .string "I'll show you my technique!$" - -gUnknown_086213C2:: @ 86213C2 - .string "Elegantly wheeling BIRDS.$" - -gUnknown_086213DC:: @ 86213DC - .string "My BIRD POKéMON, deliver my$" - -gUnknown_086213F8:: @ 86213F8 - .string "love to that girl!$" - -gUnknown_0862140B:: @ 862140B - .string "You'll suffer from poison!$" - -gUnknown_08621426:: @ 8621426 - .string "Poisonous POKéMON.$" - -gUnknown_08621439:: @ 8621439 - .string "I undertake training so$" - -gUnknown_08621451:: @ 8621451 - .string "that I may become a ninja.$" - -gUnknown_0862146C:: @ 862146C - .string "The first strike wins!$" - -gUnknown_08621483:: @ 8621483 - .string "Speedy FIGHTING type.$" - -gUnknown_08621499:: @ 8621499 - .string "If my POKéMON lose,$" - -gUnknown_086214AD:: @ 86214AD - .string "I'll carry on the fight!$" - -gUnknown_086214C6:: @ 86214C6 - .string "Go, go, my POKéMON!$" - -gUnknown_086214DA:: @ 86214DA - .string "I'll raise anything.$" - -gUnknown_086214EF:: @ 86214EF - .string "UV rays are your skin's$" - -gUnknown_08621507:: @ 8621507 - .string "enemy. Get protected.$" - -gUnknown_0862151D:: @ 862151D - .string "No mercy!$" - -gUnknown_08621527:: @ 8621527 - .string "Cute WATER POKéMON.$" - -gUnknown_0862153B:: @ 862153B - .string "I have too many fans.$" - -gUnknown_08621551:: @ 8621551 - .string "I was interviewed on TV.$" - -gUnknown_0862156A:: @ 862156A - .string "I think about this & that.$" - -gUnknown_08621585:: @ 8621585 - .string "I like all POKéMON.$" - -gUnknown_08621599:: @ 8621599 - .string "What lies beyond that$" - -gUnknown_086215AF:: @ 86215AF - .string "yonder hill?$" - -gUnknown_086215BC:: @ 86215BC - .string "We battle together!$" - -gUnknown_086215D0:: @ 86215D0 - .string "We train together!$" - -gUnknown_086215E3:: @ 86215E3 - .string "We like the same POKéMON,$" - -gUnknown_086215FD:: @ 86215FD - .string "but different desserts.$" - -gUnknown_08621615:: @ 8621615 - .string "I force things with power!$" - -gUnknown_08621630:: @ 8621630 - .string "WATER and FIGHTING types.$" - -gUnknown_0862164A:: @ 862164A - .string "Seamen are rough spirits!$" - -gUnknown_08621664:: @ 8621664 - .string "Any complaints?$" - -gUnknown_08621674:: @ 8621674 - .string "Up for a fight anytime!$" - -gUnknown_0862168C:: @ 862168C - .string "WATER POKéMON are my faves!$" - -gUnknown_086216A8:: @ 86216A8 - .string "If you want to shout loud,$" - -gUnknown_086216C3:: @ 86216C3 - .string "suck in air with your belly!$" - -gUnknown_086216E0:: @ 86216E0 - .string "Protect POKéMON from harm.$" - -gUnknown_086216FB:: @ 86216FB - .string "I love rare POKéMON.$" - -gUnknown_08621710:: @ 8621710 - .string "I want to collect all the$" - -gUnknown_0862172A:: @ 862172A - .string "world's rare POKéMON.$" - -gUnknown_08621740:: @ 8621740 - .string "I count on power.$" - -gUnknown_08621752:: @ 8621752 - .string "POKéMON are my children.$" - -gUnknown_0862176B:: @ 862176B - .string "It takes knowledge and$" - -gUnknown_08621782:: @ 8621782 - .string "love to raise POKéMON.$" - -gUnknown_08621799:: @ 8621799 - .string "Full-on attack!$" - -gUnknown_086217A9:: @ 86217A9 - .string "Anything. I'll raise it.$" - -gUnknown_086217C2:: @ 86217C2 - .string "I give them {POKEBLOCK}S for$" - -gUnknown_086217D9:: @ 86217D9 - .string "going after CONTEST titles.$" - -gUnknown_086217F5:: @ 86217F5 - .string "I raise POKéMON with care.$" - -gUnknown_08621810:: @ 8621810 - .string "Fun-to-raise POKéMON.$" - -gUnknown_08621826:: @ 8621826 - .string "Treat every POKéMON you$" - -gUnknown_0862183E:: @ 862183E - .string "meet with respect.$" - -gUnknown_08621851:: @ 8621851 - .string "I believe in my POKéMON.$" - -gUnknown_0862186A:: @ 862186A - .string "I like strong POKéMON.$" - -gUnknown_08621881:: @ 8621881 - .string "I'm training for rescue$" - -gUnknown_08621899:: @ 8621899 - .string "work with my POKéMON.$" - -gUnknown_086218AF:: @ 86218AF - .string "Attack in waves!$" - -gUnknown_086218C0:: @ 86218C0 - .string "I use different types.$" - -gUnknown_086218D7:: @ 86218D7 - .string "Those who destroy nature$" - -gUnknown_086218F0:: @ 86218F0 - .string "must never be forgiven!$" - -gUnknown_08621908:: @ 8621908 - .string "I'll show you some guts!$" - -gUnknown_08621921:: @ 8621921 - .string "Cute POKéMON are my faves!$" - -gUnknown_0862193C:: @ 862193C - .string "After a battle, I always$" - -gUnknown_08621955:: @ 8621955 - .string "bathe with my POKéMON.$" - -gUnknown_0862196C:: @ 862196C - .string "Lightning-fast attack!$" - -gUnknown_08621983:: @ 8621983 - .string "BUG POKéMON are number 1!$" - -gUnknown_0862199D:: @ 862199D - .string "If you want to catch BUG$" - -gUnknown_086219B6:: @ 86219B6 - .string "POKéMON, wake up early.$" - -gUnknown_086219CE:: @ 86219CE - .string "I battle with power.$" - -gUnknown_086219E3:: @ 86219E3 - .string "Hard-bodied POKéMON.$" - -gUnknown_086219F8:: @ 86219F8 - .string "I've been planning a month$" - -gUnknown_08621A13:: @ 8621A13 - .string "for today's hike.$" - -gUnknown_08621A25:: @ 8621A25 - .string "I like it hot!$" - -gUnknown_08621A34:: @ 8621A34 - .string "Hot POKéMON!$" - -gUnknown_08621A41:: @ 8621A41 - .string "As much as I love POKéMON,$" - -gUnknown_08621A5C:: @ 8621A5C - .string "I surely like hiking!$" - -gUnknown_08621A72:: @ 8621A72 - .string "Lovey-dovey strategy!$" - -gUnknown_08621A88:: @ 8621A88 - .string "Lovey-dovey POKéMON!$" - -gUnknown_08621A9D:: @ 8621A9D - .string "We're lovey-dovey!$" - -gUnknown_08621AB0:: @ 8621AB0 - .string "Forever lovey-dovey!$" - -gUnknown_08621AC5:: @ 8621AC5 - .string "We let it all hang out.$" - -gUnknown_08621ADD:: @ 8621ADD - .string "The 1st POKéMON I caught.$" - -gUnknown_08621AF7:: @ 8621AF7 - .string "POKéMON and I have grown$" - -gUnknown_08621B10:: @ 8621B10 - .string "stronger together.$" - -gUnknown_08621B23:: @ 8621B23 - .string "ROCK-type power attack.$" - -gUnknown_08621B3B:: @ 8621B3B - .string "I prefer rock-hard POKéMON.$" - -gUnknown_08621B57:: @ 8621B57 - .string "A LEADER of a big GYM bears$" - -gUnknown_08621B73:: @ 8621B73 - .string "a lot of responsibility.$" - -gUnknown_08621B8C:: @ 8621B8C - .string "Direct physical action!$" - -gUnknown_08621BA4:: @ 8621BA4 - .string "FIGHTING POKéMON rule!$" - -gUnknown_08621BBB:: @ 8621BBB - .string "The world awaits me as the$" - -gUnknown_08621BD6:: @ 8621BD6 - .string "next big wave!$" - -gUnknown_08621BE5:: @ 8621BE5 - .string "I choose to electrify.$" - -gUnknown_08621BFC:: @ 8621BFC - .string "Get shocked by electricity!$" - -gUnknown_08621C18:: @ 8621C18 - .string "One must never throw a$" - -gUnknown_08621C2F:: @ 8621C2F - .string "match. Even I must not.$" - -gUnknown_08621C47:: @ 8621C47 - .string "Battle aggressively.$" - -gUnknown_08621C5C:: @ 8621C5C - .string "Burn with passion!$" - -gUnknown_08621C6F:: @ 8621C6F - .string "Completely wash away daily$" - -gUnknown_08621C8A:: @ 8621C8A - .string "fatigue in hot springs!$" - -gUnknown_08621CA2:: @ 8621CA2 - .string "I flexibly adapt my style.$" - -gUnknown_08621CBD:: @ 8621CBD - .string "Grown in a balanced manner.$" - -gUnknown_08621CD9:: @ 8621CD9 - .string "I walk the 30 minutes from$" - -gUnknown_08621CF4:: @ 8621CF4 - .string "home to here every day.$" - -gUnknown_08621D0C:: @ 8621D0C - .string "I take advantage of speed.$" - -gUnknown_08621D27:: @ 8621D27 - .string "Graceful sky dancers.$" - -gUnknown_08621D3D:: @ 8621D3D - .string "The ultimate would be to$" - -gUnknown_08621D56:: @ 8621D56 - .string "live as one with nature.$" - -gUnknown_08621D6F:: @ 8621D6F - .string "We battle in cooperation.$" - -gUnknown_08621D89:: @ 8621D89 - .string "Always friendly POKéMON.$" - -gUnknown_08621DA2:: @ 8621DA2 - .string "Papa has trouble telling$" - -gUnknown_08621DBB:: @ 8621DBB - .string "the two of us apart!$" - -gUnknown_08621DD0:: @ 8621DD0 - .string "I use splendid waterpower.$" - -gUnknown_08621DEB:: @ 8621DEB - .string "POKéMON of elegance!$" - -gUnknown_08621E00:: @ 8621E00 - .string "The adulation of beautiful$" - -gUnknown_08621E1B:: @ 8621E1B - .string "ladies fills me with energy!$" - -gUnknown_08621E38:: @ 8621E38 - .string "Offense over defense!$" - -gUnknown_08621E4E:: @ 8621E4E - .string "The DARK side's beauties.$" - -gUnknown_08621E68:: @ 8621E68 - .string "They said I was a punk, but$" - -gUnknown_08621E84:: @ 8621E84 - .string "I'm one of the ELITE FOUR!$" - -gUnknown_08621E9F:: @ 8621E9F - .string "Confuse and confound.$" - -gUnknown_08621EB5:: @ 8621EB5 - .string "There's nothing definite.$" - -gUnknown_08621ECF:: @ 8621ECF - .string "I wonder how my grandma at$" - -gUnknown_08621EEA:: @ 8621EEA - .string "MT. PYRE is doing?$" - -gUnknown_08621EFD:: @ 8621EFD - .string "I use items for help.$" - -gUnknown_08621F13:: @ 8621F13 - .string "Flaming passion in icy cold!$" - -gUnknown_08621F30:: @ 8621F30 - .string "The ICE type can be better$" - -gUnknown_08621F4B:: @ 8621F4B - .string "trained in this hot land.$" - -gUnknown_08621F65:: @ 8621F65 - .string "Harness strong abilities.$" - -gUnknown_08621F7F:: @ 8621F7F - .string "The raw power of DRAGONS!$" - -gUnknown_08621F99:: @ 8621F99 - .string "I dedicate myself to the$" - -gUnknown_08621FB2:: @ 8621FB2 - .string "POKéMON that saved me.$" - -gUnknown_08621FC9:: @ 8621FC9 - .string "Dignity and respect.$" - -gUnknown_08621FDE:: @ 8621FDE - .string "I prefer POKéMON of grace.$" - -gUnknown_08621FF9:: @ 8621FF9 - .string "I represent beauty as$" - -gUnknown_0862200F:: @ 862200F - .string "well as intelligence.$" - -.align 2 - -@ strategy, mon text, introduction1, introduction2 -gUnknown_08622028:: @ 8622028 - .4byte gUnknown_08620390, gUnknown_086203AA, gUnknown_086203C2, gUnknown_086203DB - .4byte gUnknown_086203F2, gUnknown_0862040D, gUnknown_08620428, gUnknown_08620444 - .4byte gUnknown_08620456, gUnknown_0862046C, gUnknown_08620481, gUnknown_0862049C - .4byte gUnknown_086204B0, gUnknown_086204C7, gUnknown_086204DD, gUnknown_086204F9 - .4byte gUnknown_0862050E, gUnknown_0862052B, gUnknown_08620546, gUnknown_08620562 - .4byte gUnknown_0862057D, gUnknown_08620592, gUnknown_086205AC, gUnknown_086205C6 - .4byte gUnknown_086205DD, gUnknown_086205F8, gUnknown_08620612, gUnknown_0862062F - .4byte gUnknown_08620638, gUnknown_08620654, gUnknown_08620668, gUnknown_08620681 - .4byte gUnknown_08620693, gUnknown_086206A7, gUnknown_086206BC, gUnknown_086206D5 - .4byte gUnknown_086206E7, gUnknown_086206FF, gUnknown_08620717, gUnknown_08620730 - .4byte gUnknown_0862073D, gUnknown_0862074E, gUnknown_0862075D, gUnknown_08620779 - .4byte gUnknown_0862078D, gUnknown_086207A9, gUnknown_086207BC, gUnknown_086207D7 - .4byte gUnknown_086207F4, gUnknown_0862080A, gUnknown_0862081B, gUnknown_08620833 - .4byte gUnknown_0862084B, gUnknown_08620863, gUnknown_0862087C, gUnknown_08620896 - .4byte gUnknown_086208AA, gUnknown_086208C3, gUnknown_086208DC, gUnknown_086208F1 - .4byte gUnknown_08620909, gUnknown_0862091C, gUnknown_0862092E, gUnknown_0862094A - .4byte gUnknown_08620963, gUnknown_08620979, gUnknown_08620988, gUnknown_086209A4 - .4byte gUnknown_086209B4, gUnknown_086209CA, gUnknown_086209E3, gUnknown_086209FD - .4byte gUnknown_08620A18, gUnknown_08620A31, gUnknown_08620A4B, gUnknown_08620A66 - .4byte gUnknown_08620A78, gUnknown_08620A8C, gUnknown_08620A9E, gUnknown_08620AB8 - .4byte gUnknown_08620AD2, gUnknown_08620AE4, gUnknown_08620AFB, gUnknown_08620B16 - .4byte gUnknown_08620B32, gUnknown_08620B4C, gUnknown_08620B64, gUnknown_08620B7F - .4byte gUnknown_08620B8C, gUnknown_08620BA6, gUnknown_08620BC0, gUnknown_08620BD8 - .4byte gUnknown_08620BF2, gUnknown_08620C03, gUnknown_08620C19, gUnknown_08620C34 - .4byte gUnknown_08620C4E, gUnknown_08620C60, gUnknown_08620C78, gUnknown_08620C92 - .4byte gUnknown_08620CA8, gUnknown_08620CBE, gUnknown_08620CD9, gUnknown_08620CF5 - .4byte gUnknown_08620D06, gUnknown_08620D1A, gUnknown_08620D32, gUnknown_08620D49 - .4byte gUnknown_08620D63, gUnknown_08620D7C, gUnknown_08620D98, gUnknown_08620DB3 - .4byte gUnknown_08620DCA, gUnknown_08620DDE, gUnknown_08620DF1, gUnknown_08620E08 - .4byte gUnknown_08620E22, gUnknown_08620E39, gUnknown_08620E54, gUnknown_08620E6C - .4byte gUnknown_08620E83, gUnknown_08620E98, gUnknown_08620EB5, gUnknown_08620ECC - .4byte gUnknown_08620EE2, gUnknown_08620EF6, gUnknown_08620F12, gUnknown_08620F2A - .4byte gUnknown_08620F43, gUnknown_08620F5D, gUnknown_08620F76, gUnknown_08620F90 - .4byte gUnknown_08620FA2, gUnknown_08620FBA, gUnknown_08620FCD, gUnknown_08620FE6 - .4byte gUnknown_08620FF9, gUnknown_0862100A, gUnknown_08621021, gUnknown_0862103B - .4byte gUnknown_08621056, gUnknown_0862106A, gUnknown_08621083, gUnknown_0862109F - .4byte gUnknown_086210B5, gUnknown_086210CE, gUnknown_086210E7, gUnknown_08621101 - .4byte gUnknown_08621114, gUnknown_08621125, gUnknown_0862113D, gUnknown_08621157 - .4byte gUnknown_0862116E, gUnknown_08621182, gUnknown_08621197, gUnknown_086211B3 - .4byte gUnknown_086211CC, gUnknown_086211E4, gUnknown_086211FC, gUnknown_08621216 - .4byte gUnknown_08621230, gUnknown_08621243, gUnknown_08621257, gUnknown_08621270 - .4byte gUnknown_0862127B, gUnknown_08621290, gUnknown_086212A7, gUnknown_086212BF - .4byte gUnknown_086212DA, gUnknown_086212F3, gUnknown_0862130C, gUnknown_08621326 - .4byte gUnknown_08621342, gUnknown_0862135C, gUnknown_08621376, gUnknown_08621393 - .4byte gUnknown_086213A6, gUnknown_086213C2, gUnknown_086213DC, gUnknown_086213F8 - .4byte gUnknown_0862140B, gUnknown_08621426, gUnknown_08621439, gUnknown_08621451 - .4byte gUnknown_0862146C, gUnknown_08621483, gUnknown_08621499, gUnknown_086214AD - .4byte gUnknown_086214C6, gUnknown_086214DA, gUnknown_086214EF, gUnknown_08621507 - .4byte gUnknown_0862151D, gUnknown_08621527, gUnknown_0862153B, gUnknown_08621551 - .4byte gUnknown_0862156A, gUnknown_08621585, gUnknown_08621599, gUnknown_086215AF - .4byte gUnknown_086215BC, gUnknown_086215D0, gUnknown_086215E3, gUnknown_086215FD - .4byte gUnknown_08621615, gUnknown_08621630, gUnknown_0862164A, gUnknown_08621664 - .4byte gUnknown_08621674, gUnknown_0862168C, gUnknown_086216A8, gUnknown_086216C3 - .4byte gUnknown_086216E0, gUnknown_086216FB, gUnknown_08621710, gUnknown_0862172A - .4byte gUnknown_08621740, gUnknown_08621752, gUnknown_0862176B, gUnknown_08621782 - .4byte gUnknown_08621799, gUnknown_086217A9, gUnknown_086217C2, gUnknown_086217D9 - .4byte gUnknown_086217F5, gUnknown_08621810, gUnknown_08621826, gUnknown_0862183E - .4byte gUnknown_08621851, gUnknown_0862186A, gUnknown_08621881, gUnknown_08621899 - .4byte gUnknown_086218AF, gUnknown_086218C0, gUnknown_086218D7, gUnknown_086218F0 - .4byte gUnknown_08621908, gUnknown_08621921, gUnknown_0862193C, gUnknown_08621955 - .4byte gUnknown_0862196C, gUnknown_08621983, gUnknown_0862199D, gUnknown_086219B6 - .4byte gUnknown_086219CE, gUnknown_086219E3, gUnknown_086219F8, gUnknown_08621A13 - .4byte gUnknown_08621A25, gUnknown_08621A34, gUnknown_08621A41, gUnknown_08621A5C - .4byte gUnknown_08621A72, gUnknown_08621A88, gUnknown_08621A9D, gUnknown_08621AB0 - .4byte gUnknown_08621AC5, gUnknown_08621ADD, gUnknown_08621AF7, gUnknown_08621B10 - .4byte gUnknown_08621B23, gUnknown_08621B3B, gUnknown_08621B57, gUnknown_08621B73 - .4byte gUnknown_08621B8C, gUnknown_08621BA4, gUnknown_08621BBB, gUnknown_08621BD6 - .4byte gUnknown_08621BE5, gUnknown_08621BFC, gUnknown_08621C18, gUnknown_08621C2F - .4byte gUnknown_08621C47, gUnknown_08621C5C, gUnknown_08621C6F, gUnknown_08621C8A - .4byte gUnknown_08621CA2, gUnknown_08621CBD, gUnknown_08621CD9, gUnknown_08621CF4 - .4byte gUnknown_08621D0C, gUnknown_08621D27, gUnknown_08621D3D, gUnknown_08621D56 - .4byte gUnknown_08621D6F, gUnknown_08621D89, gUnknown_08621DA2, gUnknown_08621DBB - .4byte gUnknown_08621DD0, gUnknown_08621DEB, gUnknown_08621E00, gUnknown_08621E1B - .4byte gUnknown_08621E38, gUnknown_08621E4E, gUnknown_08621E68, gUnknown_08621E84 - .4byte gUnknown_08621E9F, gUnknown_08621EB5, gUnknown_08621ECF, gUnknown_08621EEA - .4byte gUnknown_08621EFD, gUnknown_08621F13, gUnknown_08621F30, gUnknown_08621F4B - .4byte gUnknown_08621F65, gUnknown_08621F7F, gUnknown_08621F99, gUnknown_08621FB2 - .4byte gUnknown_08621FC9, gUnknown_08621FDE, gUnknown_08621FF9, gUnknown_0862200F - -gUnknown_08622508:: @ 8622508 - .byte 0, 2 - -gUnknown_0862250A:: @ 862250A - .byte 0, 1, 2, 0, 0, 0 - -// pokenav_unk_4.s -gUnknown_08622510:: @ 8622510 - .incbin "graphics/pokenav/ui_matchcall.gbapal" - -gUnknown_08622530:: @ 8622530 - .incbin "graphics/pokenav/ui_matchcall.4bpp.lz" - -gUnknown_086225D4:: @ 86225D4 - .incbin "graphics/pokenav/ui_matchcall.bin.lz" - -gUnknown_08622698:: @ 8622698 - .incbin "graphics/pokenav/arrow2.gbapal" - -gUnknown_086226B8:: @ 86226B8 - .incbin "graphics/pokenav/arrow2.4bpp.lz" - -gUnknown_086226E0:: @ 86226E0 - .incbin "graphics/pokenav/86226E0.gbapal" - -gUnknown_08622700:: @ 8622700 - .incbin "graphics/pokenav/8622700.gbapal" - -gUnknown_08622720:: @ 8622720 - .incbin "graphics/pokenav/pokeball_matchcall.gbapal" - -gUnknown_08622760:: @ 8622760 - .incbin "graphics/pokenav/pokeball_matchcall.4bpp.lz" - -gUnknown_0862278C:: @ 862278C - .4byte 0x11FD - .4byte 0x20206A - -gUnknown_08622794:: @ 8622794 - .4byte 0x00003077 - -gUnknown_08622798:: @ 8622798 - .4byte NULL - .4byte sub_81CB510 - .4byte sub_81CB588 - .4byte sub_81CB600 - .4byte sub_81CB678 - .4byte sub_81CB6F0 - .4byte sub_81CB734 - .4byte sub_81CB75C - .4byte sub_81CB7A0 - .4byte sub_81CB824 - .4byte sub_81CB888 - .4byte sub_81CB93C - .4byte sub_81CBAD4 - .4byte sub_81CB9C8 - .4byte sub_81CBA68 - .4byte sub_81CBB74 - -gUnknown_086227D8:: @ 86227D8 - window_template 2, 0, 5, 11, 2, 2, 16 - -gUnknown_086227E0:: @ 86227E0 - window_template 2, 0, 9, 11, 8, 2, 0x26 - -gUnknown_086227E8:: @ 86227E8 - .4byte gUnknown_085EC017 - .4byte gUnknown_085EC01C - .4byte gUnknown_085EC022 - -gUnknown_086227F4:: @ 86227F4 - .string "·{PAUSE 0x04}·{PAUSE 0x04}·{PAUSE 0x04}·{PAUSE 0x04}·\p" - .string "$" - .align 2 - -gUnknown_08622808:: @ 8622808 - window_template 1, 1, 12, 0x1C, 4, 1, 10 - -gUnknown_08622810:: @ 8622810 - obj_tiles gUnknown_086226B8, 0x40, 7 - -gUnknown_08622818:: @ 8622818 - obj_pal gUnknown_08622698, 12 - null_obj_pal - -gUnknown_08622828:: @ 8622828 - .2byte 0x8000 - .2byte 0x0 - .2byte 0x400 - .2byte 0x0 - -gUnknown_08622830:: @ 8622830 - spr_template 7, 12, gUnknown_08622828, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_81CC34C - -gUnknown_08622848:: @ 8622848 - .2byte 0x0 - .2byte 0xC000 - .2byte 0x400 - .2byte 0x0 - -gUnknown_08622850:: @ 8622850 - spr_template 8, 13, gUnknown_08622848, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - -// pokenav_unk_5.s -gUnknown_08622868:: @ 8622868 - .incbin "graphics/pokenav/8622868.gbapal" - -gUnknown_08622888:: @ 8622888 - .incbin "graphics/pokenav/zoom_tiles.4bpp.lz" - -gUnknown_08622A7C:: @ 8622A7C - .incbin "graphics/pokenav/city_maps/lavaridge_0.bin.lz" - -gUnknown_08622AC0:: @ 8622AC0 - .incbin "graphics/pokenav/city_maps/fallarbor_0.bin.lz" - -gUnknown_08622B08:: @ 8622B08 - .incbin "graphics/pokenav/city_maps/fortree_0.bin.lz" - -gUnknown_08622B58:: @ 8622B58 - .incbin "graphics/pokenav/city_maps/slateport_0.bin.lz" - -gUnknown_08622BB8:: @ 8622BB8 - .incbin "graphics/pokenav/city_maps/slateport_1.bin.lz" - -gUnknown_08622C04:: @ 8622C04 - .incbin "graphics/pokenav/city_maps/rustboro_0.bin.lz" - -gUnknown_08622C58:: @ 8622C58 - .incbin "graphics/pokenav/city_maps/rustboro_1.bin.lz" - -gUnknown_08622CAC:: @ 8622CAC - .incbin "graphics/pokenav/city_maps/pacifidlog_0.bin.lz" - -gUnknown_08622CEC:: @ 8622CEC - .incbin "graphics/pokenav/city_maps/mauville_0.bin.lz" - -gUnknown_08622D44:: @ 8622D44 - .incbin "graphics/pokenav/city_maps/mauville_1.bin.lz" - -gUnknown_08622D98:: @ 8622D98 - .incbin "graphics/pokenav/city_maps/oldale_0.bin.lz" - -gUnknown_08622DC8:: @ 8622DC8 - .incbin "graphics/pokenav/city_maps/lilycove_0.bin.lz" - -gUnknown_08622E14:: @ 8622E14 - .incbin "graphics/pokenav/city_maps/lilycove_1.bin.lz" - -gUnknown_08622E6C:: @ 8622E6C - .incbin "graphics/pokenav/city_maps/littleroot_0.bin.lz" - -gUnknown_08622E9C:: @ 8622E9C - .incbin "graphics/pokenav/city_maps/dewford_0.bin.lz" - -gUnknown_08622ED4:: @ 8622ED4 - .incbin "graphics/pokenav/city_maps/sootopolis_0.bin.lz" - -gUnknown_08622F14:: @ 8622F14 - .incbin "graphics/pokenav/city_maps/ever_grande_0.bin.lz" - -gUnknown_08622F5C:: @ 8622F5C - .incbin "graphics/pokenav/city_maps/ever_grande_1.bin.lz" - -gUnknown_08622FA0:: @ 8622FA0 - .incbin "graphics/pokenav/city_maps/verdanturf_0.bin.lz" - -gUnknown_08622FD8:: @ 8622FD8 - .incbin "graphics/pokenav/city_maps/mossdeep_0.bin.lz" - -gUnknown_08623020:: @ 8623020 - .incbin "graphics/pokenav/city_maps/mossdeep_1.bin.lz" - -gUnknown_0862307C:: @ 862307C - .incbin "graphics/pokenav/city_maps/petalburg_0.bin.lz" - -gUnknown_086230D8:: @ 86230D8 - .4byte 0x11F5 - .4byte 0x206A - .4byte 0x3402 - -gUnknown_086230E4:: @ 86230E4 - .4byte NULL - .4byte sub_81CC848 - .4byte sub_81CC878 - .4byte sub_81CC8D8 - .4byte sub_81CC95C - -gUnknown_086230F8:: @ 86230F8 - obj_tiles gHoennMapZoomIcons_Gfx, 0x800, 6 - -gUnknown_08623100:: @ 8623100 - obj_pal gHoennMapZoomIcons_Pal, 11 - null_obj_pal - -gUnknown_08623110:: @ 8623110 - .byte 1 - .byte 17 - .byte 4 - .byte 12 - .byte 13 - .byte 1 - .2byte 0x4C - -gUnknown_08623118:: @ 8623118 - .4byte 0, gUnknown_08622E6C - .4byte 1, gUnknown_08622D98 - .4byte 2, gUnknown_08622E9C - .4byte 3, gUnknown_08622A7C - .4byte 4, gUnknown_08622AC0 - .4byte 5, gUnknown_08622FA0 - .4byte 6, gUnknown_08622CAC - .4byte 7, gUnknown_0862307C - .4byte 8, gUnknown_08622B58 - .4byte 0x10008, gUnknown_08622BB8 - .4byte 9, gUnknown_08622D44 - .4byte 0x10009, gUnknown_08622CEC - .4byte 0xA, gUnknown_08622C04 - .4byte 0x1000A, gUnknown_08622C58 - .4byte 0xB, gUnknown_08622B08 - .4byte 0xC, gUnknown_08622E14 - .4byte 0x1000C, gUnknown_08622DC8 - .4byte 0xD, gUnknown_08623020 - .4byte 0x1000D, gUnknown_08622FD8 - .4byte 0xE, gUnknown_08622ED4 - .4byte 0xF, gUnknown_08622F14 - .4byte 0x1000F, gUnknown_08622F5C - -gUnknown_086231C8:: @ 86231C8 - .2byte 0x4000 - .2byte 0x4000 - .2byte 0x400 - .2byte 0x0 - -gUnknown_086231D0:: @ 86231D0 - spr_template 6, 11, gUnknown_086231C8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_81CCEF4 - -// pokenav_unk_6.s -// - -// pokenav_unk_7.s -gUnknown_086231E8:: @ 86231E8 - .incbin "graphics/pokenav/86231E8.gbapal" - -gUnknown_08623208:: @ 8623208 - .incbin "graphics/pokenav/8623208.gbapal" - -gUnknown_08623228:: @ 8623228 - .incbin "graphics/pokenav/8623228.4bpp.lz" - -gUnknown_0862323C:: @ 862323C - .incbin "graphics/pokenav/862323C.bin.lz" - -gUnknown_08623338:: @ 8623338 - .incbin "graphics/pokenav/8623338.gbapal" - -gUnknown_08623358:: @ 8623358 - .4byte 0x11F5 - .4byte 0x21DE - .4byte 0x31EB - -gUnknown_08623364:: @ 8623364 - window_template 1, 13, 1, 13, 4, 15, 2 - -gUnknown_0862336C:: @ 862336C - window_template 1, 1, 6, 7, 2, 15, 0x36 - -gUnknown_08623374:: @ 8623374 - window_template 1, 1, 0x1C, 5, 2, 15, 0x44 - -gUnknown_0862337C:: @ 862337C - window_template 1, 13, 0x1C, 3, 2, 15, 0x44 - -// pokenav_unk_8.s -gUnknown_08623384:: @ 8623384 - .4byte NULL - .4byte sub_81CE37C - .4byte sub_81CE2D0 - .4byte sub_81CE4D8 - .4byte sub_81CE5E4 - .4byte sub_81CE6BC - .4byte sub_81CE700 - -gUnknown_086233A0:: @ 86233A0 - .4byte 0x16, 0x17, 0x18, 0x21, 0x2F - -gUnknown_086233B4:: @ 86233B4 - .4byte sub_81CF134 - .4byte sub_81CF1C4 - .4byte sub_81CF1D8 - .4byte sub_81CF278 - -gUnknown_086233C4:: @ 86233C4 - .incbin "graphics/pokenav/condition_search2.gbapal" - -gUnknown_086233E4:: @ 86233E4 - .incbin "graphics/pokenav/condition_search2.4bpp.lz" - -gUnknown_086234AC:: @ 86234AC - .incbin "graphics/pokenav/condition_search2.bin.lz" - -gUnknown_08623570:: @ 8623570 - .incbin "graphics/pokenav/8623570.gbapal" - -gUnknown_08623590:: @ 8623590 - .4byte 0x2065 - -gUnknown_08623594:: @ 8623594 - .4byte 0x307A - -gUnknown_08623598:: @ 8623598 - .4byte NULL - .4byte sub_81CF578 - .4byte sub_81CF5F0 - .4byte sub_81CF668 - .4byte sub_81CF6E0 - .4byte sub_81CF758 - .4byte sub_81CF798 - -gUnknown_086235B4:: @ 86235B4 - window_template 1, 1, 6, 7, 2, 1, 20 - -gUnknown_086235BC:: @ 86235BC - .string "{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}$" - .align 2 - -gUnknown_086235C8:: @ 86235C8 - .string "{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}$" - .align 2 - -gUnknown_086235D4:: @ 86235D4 - .string "{UNK_SPACER}$" - .align 2 - -// pokenav_unk_9.s -gUnknown_086235D8:: @ 86235D8 - .4byte sub_81CFB8C - .4byte sub_81CFC2C - .4byte sub_81CFC40 - -gUnknown_086235E4:: @ 86235E4 - .incbin "graphics/pokenav/ui_ribbons.gbapal" - -gUnknown_08623604:: @ 8623604 - .incbin "graphics/pokenav/ui_ribbons.4bpp.lz" - -gUnknown_086236CC:: @ 86236CC - .incbin "graphics/pokenav/ui_ribbons.bin.lz" - -gUnknown_08623790:: @ 8623790 - .incbin "graphics/pokenav/8623790.gbapal" - -gUnknown_086237B0:: @ 86237B0 - .4byte 0x2065 - -gUnknown_086237B4:: @ 86237B4 - .4byte 0x307A - -gUnknown_086237B8:: @ 86237B8 - .4byte NULL - .4byte sub_81CFFFC - .4byte sub_81D0074 - .4byte sub_81D00EC - .4byte sub_81D0164 - .4byte sub_81D01DC - .4byte sub_81D021C - -gUnknown_086237D4:: @ 86237D4 - window_template 1, 1, 6, 7, 2, 1, 20 - -gUnknown_086237DC:: @ 86237DC - .string "{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}$" - .align 2 - -gUnknown_086237E8:: @ 86237E8 - .string "{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}$" - .align 2 - -gUnknown_086237F4:: @ 86237F4 - .string "{UNK_SPACER}$" - .align 2 - -// pokenav_unk_10.s -gUnknown_086237F8:: @ 86237F8 - .byte 1, 1, 0, 0 - .byte 3, 4, 1, 0 - .byte 3, 4, 5, 0 - .byte 3, 4, 9, 0 - .byte 3, 4, 13, 0 - .byte 3, 4, 17, 0 - .byte 1, 1, 21, 0 - .byte 1, 1, 22, 0 - .byte 1, 1, 23, 0 - .byte 1, 1, 24, 0 - .byte 1, 1, 25, 1 - .byte 1, 1, 26, 1 - .byte 1, 1, 27, 1 - .byte 1, 1, 28, 1 - .byte 1, 1, 29, 1 - .byte 1, 1, 30, 1 - .byte 1, 1, 31, 1 - -@ 862383C - .include "data/text/ribbon_descriptions.inc" - -@ 8623A74 - .include "data/text/gift_ribbon_descriptions.inc" - -gUnknown_08623FF8:: @ 8623FF8 - .incbin "graphics/pokenav/ribbons_icon1.gbapal" - -gUnknown_08624018:: @ 8624018 - .incbin "graphics/pokenav/ribbons_icon2.gbapal" - -gUnknown_08624038:: @ 8624038 - .incbin "graphics/pokenav/ribbons_icon3.gbapal" - -gUnknown_08624058:: @ 8624058 - .incbin "graphics/pokenav/ribbons_icon4.gbapal" - -gUnknown_08624078:: @ 8624078 - .incbin "graphics/pokenav/ribbons_icon5.gbapal" - -gUnknown_08624098:: @ 8624098 - .incbin "graphics/pokenav/8624098.gbapal" - -gUnknown_086240B8:: @ 86240B8 - .incbin "graphics/pokenav/ribbons_icon.4bpp.lz" - -gUnknown_08624280:: @ 8624280 - .incbin "graphics/pokenav/ribbons_icon_big.4bpp.lz" - -gUnknown_08624B98:: @ 8624B98 - .4byte 0x107D - .4byte 0x2066 - -gUnknown_08624BA0:: @ 8624BA0 - .4byte NULL - .4byte sub_81D0C84 - .4byte sub_81D0D2C - .4byte sub_81D0D8C - .4byte sub_81D0E00 - .4byte sub_81D0C54 diff --git a/data/text/gift_ribbon_descriptions.inc b/data/text/gift_ribbon_descriptions.inc deleted file mode 100644 index 47e004d67..000000000 --- a/data/text/gift_ribbon_descriptions.inc +++ /dev/null @@ -1,207 +0,0 @@ -gGiftRibbonDescriptionPart1_2003RegionalTourney:: @ 8623A74 - .string "2003 REGIONAL TOURNEY$" - -gGiftRibbonDescriptionPart2_Champion:: @ 8623A8A - .string "CHAMPION RIBBON$" - -gGiftRibbonDescriptionPart1_2003NationalTourney:: @ 8623A9A - .string "2003 NATIONAL TOURNEY$" - -gGiftRibbonDescriptionPart1_2003GlobalCup:: @ 8623AB0 - .string "2003 GLOBAL CUP$" - -gGiftRibbonDescriptionPart2_RunnerUp:: @ 8623AC0 - .string "Runner-up RIBBON$" - -gGiftRibbonDescriptionPart2_Semifinalist:: @ 8623AD1 - .string "Semifinalist RIBBON$" - -gGiftRibbonDescriptionPart1_2004RegionalTourney:: @ 8623AE5 - .string "2004 REGIONAL TOURNEY$" - -gGiftRibbonDescriptionPart1_2004NationalTourney:: @ 8623AFB - .string "2004 NATIONAL TOURNEY$" - -gGiftRibbonDescriptionPart1_2004GlobalCup:: @ 8623B11 - .string "2004 GLOBAL CUP$" - -gGiftRibbonDescriptionPart1_2005RegionalTourney:: @ 8623B21 - .string "2005 REGIONAL TOURNEY$" - -gGiftRibbonDescriptionPart1_2005NationalTourney:: @ 8623B37 - .string "2005 NATIONAL TOURNEY$" - -gGiftRibbonDescriptionPart1_2005GlobalCup:: @ 8623B4D - .string "2005 GLOBAL CUP$" - -gGiftRibbonDescriptionPart1_PokemonBattleCup:: @ 8623B5D - .string "POKéMON BATTLE CUP$" - -gGiftRibbonDescriptionPart2_Participation:: @ 8623B70 - .string "Participation RIBBON$" - -gGiftRibbonDescriptionPart1_PokemonLeague:: @ 8623B85 - .string "POKéMON LEAGUE$" - -gGiftRibbonDescriptionPart1_AdvanceCup:: @ 8623B94 - .string "ADVANCE CUP$" - -gGiftRibbonDescriptionPart1_PokemonTournament:: @ 8623BA0 - .string "POKéMON Tournament$" - -gGiftRibbonDescriptionPart2_Participation2:: @ 8623BB3 - .string "Participation RIBBON$" - -gGiftRibbonDescriptionPart1_PokemonEvent:: @ 8623BC8 - .string "POKéMON Event$" - -gGiftRibbonDescriptionPart1_PokemonFestival:: @ 8623BD6 - .string "POKéMON Festival$" - -gGiftRibbonDescriptionPart1_DifficultyClearing:: @ 8623BE7 - .string "Difficulty-clearing$" - -gGiftRibbonDescriptionPart2_Commemorative:: @ 8623BFB - .string "Commemorative RIBBON$" - -gGiftRibbonDescriptionPart1_ClearingAllChallenges:: @ 8623C10 - .string "RIBBON awarded for$" - -gGiftRibbonDescriptionPart2_ClearingAllChallenges:: @ 8623C23 - .string "clearing all challenges.$" - -gGiftRibbonDescriptionPart1_100StraightWin:: @ 8623C3C - .string "100-straight Win$" - -gGiftRibbonDescriptionPart1_DarknessTower:: @ 8623C4D - .string "DARKNESS TOWER Clear$" - -gGiftRibbonDescriptionPart1_RedTower:: @ 8623C62 - .string "RED TOWER Clear$" - -gGiftRibbonDescriptionPart1_BlackironTower:: @ 8623C72 - .string "BLACKIRON TOWER Clear$" - -gGiftRibbonDescriptionPart1_FinalTower:: @ 8623C88 - .string "FINAL TOWER Clear$" - -gGiftRibbonDescriptionPart1_LegendMaking:: @ 8623C9A - .string "Legend-making$" - -gGiftRibbonDescriptionPart1_PokemonCenterTokyo:: @ 8623CA8 - .string "POKéMON CENTER TOKYO$" - -gGiftRibbonDescriptionPart1_PokemonCenterOsaka:: @ 8623CBD - .string "POKéMON CENTER OSAKA$" - -gGiftRibbonDescriptionPart1_PokemonCenterNagoya:: @ 8623CD2 - .string "POKéMON CENTER NAGOYA$" - -gGiftRibbonDescriptionPart1_PokemonCenterNY:: @ 8623CE8 - .string "POKéMON CENTER NY$" - -gGiftRibbonDescriptionPart1_SummerHolidays:: @ 8623CFA - .string "Summer Holidays RIBBON$" - -gGiftRibbonDescriptionPart2_EmptyString:: @ 8623D11 - .string "$" - -gGiftRibbonDescriptionPart1_WinterHolidays:: @ 8623D12 - .string "Winter Holidays RIBBON$" - -gGiftRibbonDescriptionPart1_SpringHolidays:: @ 8623D29 - .string "Spring Holidays RIBBON$" - -gGiftRibbonDescriptionPart1_Evergreen:: @ 8623D40 - .string "Evergreen RIBBON$" - -gGiftRibbonDescriptionPart1_SpecialHoliday:: @ 8623D51 - .string "Special Holiday RIBBON$" - -gGiftRibbonDescriptionPart1_HardWorker:: @ 8623D68 - .string "Hard Worker RIBBON$" - -gGiftRibbonDescriptionPart1_LotsOfFriends:: @ 8623D7B - .string "Lots of Friends RIBBON$" - -gGiftRibbonDescriptionPart1_FullOfEnergy:: @ 8623D92 - .string "Full of Energy RIBBON$" - -gGiftRibbonDescriptionPart1_LovedPokemon:: @ 8623DA8 - .string "A commemorative RIBBON$" - -gGiftRibbonDescriptionPart2_LovedPokemon:: @ 8623DBF - .string "for a loved POKéMON.$" - -gGiftRibbonDescriptionPart1_LoveForPokemon:: @ 8623DD4 - .string "RIBBON that shows$" - -gGiftRibbonDescriptionPart2_LoveForPokemon:: @ 8623DE6 - .string "love for POKéMON.$" - - .align 2 -gGiftRibbonDescriptionPointers:: @ 8623DF8 - .4byte gGiftRibbonDescriptionPart1_2003RegionalTourney, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_2003NationalTourney, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_2003GlobalCup, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_2003RegionalTourney, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_2003NationalTourney, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_2003GlobalCup, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_2003RegionalTourney, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_2003NationalTourney, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_2003GlobalCup, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_2004RegionalTourney, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_2004NationalTourney, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_2004GlobalCup, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_2004RegionalTourney, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_2004NationalTourney, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_2004GlobalCup, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_2004RegionalTourney, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_2004NationalTourney, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_2004GlobalCup, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_2005RegionalTourney, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_2005NationalTourney, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_2005GlobalCup, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_2005RegionalTourney, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_2005NationalTourney, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_2005GlobalCup, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_2005RegionalTourney, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_2005NationalTourney, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_2005GlobalCup, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_PokemonBattleCup, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_PokemonBattleCup, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_PokemonBattleCup, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_PokemonBattleCup, gGiftRibbonDescriptionPart2_Participation - .4byte gGiftRibbonDescriptionPart1_PokemonLeague, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_PokemonLeague, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_PokemonLeague, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_PokemonLeague, gGiftRibbonDescriptionPart2_Participation - .4byte gGiftRibbonDescriptionPart1_AdvanceCup, gGiftRibbonDescriptionPart2_Champion - .4byte gGiftRibbonDescriptionPart1_AdvanceCup, gGiftRibbonDescriptionPart2_RunnerUp - .4byte gGiftRibbonDescriptionPart1_AdvanceCup, gGiftRibbonDescriptionPart2_Semifinalist - .4byte gGiftRibbonDescriptionPart1_AdvanceCup, gGiftRibbonDescriptionPart2_Participation - .4byte gGiftRibbonDescriptionPart1_PokemonTournament, gGiftRibbonDescriptionPart2_Participation2 - .4byte gGiftRibbonDescriptionPart1_PokemonEvent, gGiftRibbonDescriptionPart2_Participation2 - .4byte gGiftRibbonDescriptionPart1_PokemonFestival, gGiftRibbonDescriptionPart2_Participation2 - .4byte gGiftRibbonDescriptionPart1_DifficultyClearing, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_ClearingAllChallenges, gGiftRibbonDescriptionPart2_ClearingAllChallenges - .4byte gGiftRibbonDescriptionPart1_100StraightWin, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_DarknessTower, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_RedTower, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_BlackironTower, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_FinalTower, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_LegendMaking, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_PokemonCenterTokyo, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_PokemonCenterOsaka, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_PokemonCenterNagoya, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_PokemonCenterNY, gGiftRibbonDescriptionPart2_Commemorative - .4byte gGiftRibbonDescriptionPart1_SummerHolidays, gGiftRibbonDescriptionPart2_EmptyString - .4byte gGiftRibbonDescriptionPart1_WinterHolidays, gGiftRibbonDescriptionPart2_EmptyString - .4byte gGiftRibbonDescriptionPart1_SpringHolidays, gGiftRibbonDescriptionPart2_EmptyString - .4byte gGiftRibbonDescriptionPart1_Evergreen, gGiftRibbonDescriptionPart2_EmptyString - .4byte gGiftRibbonDescriptionPart1_SpecialHoliday, gGiftRibbonDescriptionPart2_EmptyString - .4byte gGiftRibbonDescriptionPart1_HardWorker, gGiftRibbonDescriptionPart2_EmptyString - .4byte gGiftRibbonDescriptionPart1_LotsOfFriends, gGiftRibbonDescriptionPart2_EmptyString - .4byte gGiftRibbonDescriptionPart1_FullOfEnergy, gGiftRibbonDescriptionPart2_EmptyString - .4byte gGiftRibbonDescriptionPart1_LovedPokemon, gGiftRibbonDescriptionPart2_LovedPokemon - .4byte gGiftRibbonDescriptionPart1_LoveForPokemon, gGiftRibbonDescriptionPart2_LoveForPokemon diff --git a/data/text/ribbon_descriptions.inc b/data/text/ribbon_descriptions.inc deleted file mode 100644 index 6dd82c288..000000000 --- a/data/text/ribbon_descriptions.inc +++ /dev/null @@ -1,84 +0,0 @@ -gRibbonDescriptionPart1_Champion:: @ 862383C - .string "CHAMPION-beating, HALL$" - -gRibbonDescriptionPart2_Champion:: @ 8623853 - .string "OF FAME Member RIBBON$" - -gRibbonDescriptionPart1_CoolContest:: @ 8623869 - .string "COOL CONTEST$" - -gRibbonDescriptionPart1_BeautyContest:: @ 8623876 - .string "BEAUTY CONTEST$" - -gRibbonDescriptionPart1_CuteContest:: @ 8623885 - .string "CUTE CONTEST$" - -gRibbonDescriptionPart1_SmartContest:: @ 8623892 - .string "SMART CONTEST$" - -gRibbonDescriptionPart1_ToughContest:: @ 86238A0 - .string "TOUGH CONTEST$" - -gRibbonDescriptionPart2_NormalRank:: @ 86238AE - .string "Normal Rank winner!$" - -gRibbonDescriptionPart2_SuperRank:: @ 86238C2 - .string "Super Rank winner!$" - -gRibbonDescriptionPart2_HyperRank:: @ 86238D5 - .string "Hyper Rank winner!$" - -gRibbonDescriptionPart2_MasterRank:: @ 86238E8 - .string "Master Rank winner!$" - -gRibbonDescriptionPart1_Winning:: @ 86238FC - .string "For clearing LV50$" - -gRibbonDescriptionPart2_Winning:: @ 862390E - .string "at the BATTLE TOWER.$" - -gRibbonDescriptionPart1_Victory:: @ 8623923 - .string "For clearing Open Level$" - -gRibbonDescriptionPart2_Victory:: @ 862393B - .string "at the BATTLE TOWER.$" - -gRibbonDescriptionPart1_Artist:: @ 8623950 - .string "RIBBON for being chosen$" - -gRibbonDescriptionPart2_Artist:: @ 8623968 - .string "as a super sketch model.$" - -gRibbonDescriptionPart1_Effort:: @ 8623981 - .string "RIBBON awarded for$" - -gRibbonDescriptionPart2_Effort:: @ 8623994 - .string "being a hard worker.$" - - .align 2 -gRibbonDescriptionPointers:: @ 86239AC - .4byte gRibbonDescriptionPart1_Champion, gRibbonDescriptionPart2_Champion - .4byte gRibbonDescriptionPart1_CoolContest, gRibbonDescriptionPart2_NormalRank - .4byte gRibbonDescriptionPart1_CoolContest, gRibbonDescriptionPart2_SuperRank - .4byte gRibbonDescriptionPart1_CoolContest, gRibbonDescriptionPart2_HyperRank - .4byte gRibbonDescriptionPart1_CoolContest, gRibbonDescriptionPart2_MasterRank - .4byte gRibbonDescriptionPart1_BeautyContest, gRibbonDescriptionPart2_NormalRank - .4byte gRibbonDescriptionPart1_BeautyContest, gRibbonDescriptionPart2_SuperRank - .4byte gRibbonDescriptionPart1_BeautyContest, gRibbonDescriptionPart2_HyperRank - .4byte gRibbonDescriptionPart1_BeautyContest, gRibbonDescriptionPart2_MasterRank - .4byte gRibbonDescriptionPart1_CuteContest, gRibbonDescriptionPart2_NormalRank - .4byte gRibbonDescriptionPart1_CuteContest, gRibbonDescriptionPart2_SuperRank - .4byte gRibbonDescriptionPart1_CuteContest, gRibbonDescriptionPart2_HyperRank - .4byte gRibbonDescriptionPart1_CuteContest, gRibbonDescriptionPart2_MasterRank - .4byte gRibbonDescriptionPart1_SmartContest, gRibbonDescriptionPart2_NormalRank - .4byte gRibbonDescriptionPart1_SmartContest, gRibbonDescriptionPart2_SuperRank - .4byte gRibbonDescriptionPart1_SmartContest, gRibbonDescriptionPart2_HyperRank - .4byte gRibbonDescriptionPart1_SmartContest, gRibbonDescriptionPart2_MasterRank - .4byte gRibbonDescriptionPart1_ToughContest, gRibbonDescriptionPart2_NormalRank - .4byte gRibbonDescriptionPart1_ToughContest, gRibbonDescriptionPart2_SuperRank - .4byte gRibbonDescriptionPart1_ToughContest, gRibbonDescriptionPart2_HyperRank - .4byte gRibbonDescriptionPart1_ToughContest, gRibbonDescriptionPart2_MasterRank - .4byte gRibbonDescriptionPart1_Winning, gRibbonDescriptionPart2_Winning - .4byte gRibbonDescriptionPart1_Victory, gRibbonDescriptionPart2_Victory - .4byte gRibbonDescriptionPart1_Artist, gRibbonDescriptionPart2_Artist - .4byte gRibbonDescriptionPart1_Effort, gRibbonDescriptionPart2_Effort diff --git a/data/use_pokeblock.s b/data/use_pokeblock.s deleted file mode 100644 index dc2c7bd70..000000000 --- a/data/use_pokeblock.s +++ /dev/null @@ -1,113 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -.align 4 - -gUnknown_085DFA60:: @ 85DFA60 - .incbin "graphics/interface/85DFA60.bin" - -gUnknown_085DFA80:: @ 85DFA80 - .incbin "graphics/interface/85DFA80.4bpp" - -gUnknown_085DFB60:: @ 85DFB60 - .incbin "graphics/interface/85DFB60.bin" - -gUnknown_085DFC0C:: @ 85DFC0C - .incbin "graphics/interface/85DFC0C.bin" - -gUnknown_085DFCB0:: @ 85DFCB0 - .4byte 22, 47, 33, 24, 23 - -gUnknown_085DFCC4:: @ 85DFCC4 - .byte 0, 4, 3, 2, 1 - -gUnknown_085DFCC9:: @ 85DFCC9 - .byte 0, 8, 1 - -gUnknown_085DFCCC:: @ 85DFCCC - .4byte 0x1F8 - .4byte 0x31E1 - .4byte 0x4021DF - .4byte 0x1172 - -gUnknown_085DFCDC:: @ 85DFCDC - window_template 0, 0xD, 1, 0xD, 4, 0xF, 1 - window_template 0, 0, 0xE, 0xB, 2, 0xF, 0x35 - window_template 0, 1, 0x11, 0x1C, 2, 0xF, 0x4B - null_window_template - -sUsePokeblockYesNoWinTemplate:: @ 85DFCFC - window_template 0, 0x18, 0xB, 5, 4, 0xF, 0x83 - -sContestStatNames:: @ 85DFD04 - .4byte gText_Coolness - .4byte gText_Toughness - .4byte gText_Smartness - .4byte gText_Cuteness - .4byte gText_Beauty3 - -gSpriteSheet_ConditionUpDown:: @ 85DFD18 - obj_tiles gUsePokeblockUpDown_Gfx, 0x200, 0 - -gSpritePalette_ConditionUpDown:: @ 85DFD20 - obj_pal gUsePokeblockUpDown_Pal, 0 - -gUnknown_085DFD28:: @ 85DFD28 - .2byte 0x9c, 0x24 - .2byte 0x75, 0x3b - .2byte 0x75, 0x76 - .2byte 0xc5, 0x76 - .2byte 0xc5, 0x3b - -gUnknown_085DFD3C:: @ 85DFD3C - .2byte 0x4000 - .2byte 0x8000 - .2byte 0x400 - .2byte 0 - -gUnknown_085DFD44:: @ 85DFD44 - obj_image_anim_frame 0, 5 - obj_image_anim_end - -gUnknown_085DFD4C:: @ 85DFD4C - obj_image_anim_frame 8, 5 - obj_image_anim_end - -gUnknown_085DFD54:: @ 85DFD54 - .4byte gUnknown_085DFD44 - .4byte gUnknown_085DFD4C - -gSpriteTemplate_085DFD5C:: @ 85DFD5C - spr_template 0, 0, gUnknown_085DFD3C, gUnknown_085DFD54, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - -gUnknown_085DFD74:: @ 85DFD74 - .2byte 0x4000 - .2byte 0xC000 - .2byte 0x400 - .2byte 0 - -gUnknown_085DFD7C:: @ 85DFD7C - obj_image_anim_frame 0, 5 - obj_image_anim_end - -gUnknown_085DFD84:: @ 85DFD84 - obj_image_anim_frame 32, 5 - obj_image_anim_end - -gUnknown_085DFD8C:: @ 85DFD8C - obj_image_anim_frame 64, 5 - obj_image_anim_end - -gUnknown_085DFD94:: @ 85DFD94 - .4byte gUnknown_085DFD7C - .4byte gUnknown_085DFD84 - .4byte gUnknown_085DFD8C - -gUnknown_085DFDA0:: @ 85DFDA0 - spr_template 1, 1, gUnknown_085DFD74, gUnknown_085DFD94, NULL, gDummySpriteAffineAnimTable, sub_8168374 - -gUnknown_085DFDB8:: @ 85DFDB8 - .4byte gUsePokeblockCondition_Pal - .4byte 1 diff --git a/graphics/pokenav/city_maps/lilycove_0.bin b/graphics/pokenav/city_maps/lilycove_0.bin index e8bf09eae..99895574d 100644 --- a/graphics/pokenav/city_maps/lilycove_0.bin +++ b/graphics/pokenav/city_maps/lilycove_0.bin @@ -1 +1,3 @@ -0000000000000000000000000000000 0 0000000000000000000 00000000000000000000 00000000000000000000000000000 \ No newline at end of file +00000000000000000000000000000000 0 0 0 0 00 000000000 +0000 0 0 0 0 0 00 000000000 +000000 0 0 0 00 0000000000000000000000 \ No newline at end of file diff --git a/graphics/pokenav/city_maps/lilycove_1.bin b/graphics/pokenav/city_maps/lilycove_1.bin index 99895574d..e8bf09eae 100644 --- a/graphics/pokenav/city_maps/lilycove_1.bin +++ b/graphics/pokenav/city_maps/lilycove_1.bin @@ -1,3 +1 @@ -00000000000000000000000000000000 0 0 0 0 00 000000000 -0000 0 0 0 0 0 00 000000000 -000000 0 0 0 00 0000000000000000000000 \ No newline at end of file +0000000000000000000000000000000 0 0000000000000000000 00000000000000000000 00000000000000000000000000000 \ No newline at end of file diff --git a/graphics/pokenav/city_maps/mauville_0.bin b/graphics/pokenav/city_maps/mauville_0.bin index 103d39e54..a0662010a 100644 --- a/graphics/pokenav/city_maps/mauville_0.bin +++ b/graphics/pokenav/city_maps/mauville_0.bin @@ -1,3 +1,3 @@ -000000000000000000000000000000000000000000 00 00 0 000000 -0000000000 -00000000 0 00 00000000000000000000000000 \ No newline at end of file +000000000000000000000000000000000000 +000000 000 00 0 000000 +0000000000 0000000000000 0 00000000 00000000000000 \ No newline at end of file diff --git a/graphics/pokenav/city_maps/mauville_1.bin b/graphics/pokenav/city_maps/mauville_1.bin index a0662010a..103d39e54 100644 --- a/graphics/pokenav/city_maps/mauville_1.bin +++ b/graphics/pokenav/city_maps/mauville_1.bin @@ -1,3 +1,3 @@ -000000000000000000000000000000000000 -000000 000 00 0 000000 -0000000000 0000000000000 0 00000000 00000000000000 \ No newline at end of file +000000000000000000000000000000000000000000 00 00 0 000000 +0000000000 +00000000 0 00 00000000000000000000000000 \ No newline at end of file diff --git a/graphics/pokenav/city_maps/mossdeep_0.bin b/graphics/pokenav/city_maps/mossdeep_0.bin index fd03cfe02..6c11d5624 100644 --- a/graphics/pokenav/city_maps/mossdeep_0.bin +++ b/graphics/pokenav/city_maps/mossdeep_0.bin @@ -1 +1,3 @@ -0000000000000000000000000000000000000000000000000000000000000000000000000000000000 0 00000000000000000 \ No newline at end of file +00000000000000000000000000 0 00000000 +0000000000 +000000000 000000000 000 0 00000000 0000000000000000000000000 \ No newline at end of file diff --git a/graphics/pokenav/city_maps/mossdeep_1.bin b/graphics/pokenav/city_maps/mossdeep_1.bin index 6c11d5624..fd03cfe02 100644 --- a/graphics/pokenav/city_maps/mossdeep_1.bin +++ b/graphics/pokenav/city_maps/mossdeep_1.bin @@ -1,3 +1 @@ -00000000000000000000000000 0 00000000 -0000000000 -000000000 000000000 000 0 00000000 0000000000000000000000000 \ No newline at end of file +0000000000000000000000000000000000000000000000000000000000000000000000000000000000 0 00000000000000000 \ No newline at end of file diff --git a/include/battle_message.h b/include/battle_message.h index 76c662a51..5c842832a 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -161,7 +161,7 @@ { \ textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \ textVar[1] = B_BUFF_MOVE; \ - textVar[2] = move & 0xFF; \ + textVar[2] = (move & 0xFF); \ textVar[3] = (move & 0xFF00) >> 8; \ textVar[4] = B_BUFF_EOS; \ } diff --git a/include/berry_crush.h b/include/berry_crush.h index 101450a33..8909ae821 100755 --- a/include/berry_crush.h +++ b/include/berry_crush.h @@ -1,6 +1,8 @@ #ifndef GUARD_BERRY_CRUSH_H #define GUARD_BERRY_CRUSH_H +#include "main.h" + void sub_8020C70(MainCallback callback); #endif // GUARD_BERRY_CRUSH_H diff --git a/include/dodrio_berry_picking.h b/include/dodrio_berry_picking.h new file mode 100644 index 000000000..55e8fa880 --- /dev/null +++ b/include/dodrio_berry_picking.h @@ -0,0 +1,8 @@ +#ifndef GUARD_DODRIO_BERRY_PICKING_H +#define GUARD_DODRIO_BERRY_PICKING_H + +void sub_802493C(u16 a0, void (*callback)(void)); +void sub_8027A5C(void); +void sub_8027AAC(void); + +#endif // GUARD_DODRIO_BERRY_PICKING_H diff --git a/include/fieldmap.h b/include/fieldmap.h index 2384ed46a..be5610a46 100644 --- a/include/fieldmap.h +++ b/include/fieldmap.h @@ -23,9 +23,9 @@ int GetMapBorderIdAt(int x, int y); int CanCameraMoveInDirection(int direction); u16 GetBehaviorByMetatileId(u16 metatileId); void GetCameraFocusCoords(u16 *x, u16 *y); -u8 MapGridGetMetatileLayerTypeAt(s32 x, s32 y); +u8 MapGridGetMetatileLayerTypeAt(int x, int y); u8 MapGridGetZCoordAt(int x, int y); -u8 CameraMove(s32 deltaX, s32 deltaY); +bool8 CameraMove(int deltaX, int deltaY); struct MapConnection *sub_8088950(u8 direction, int x, int y); bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection); bool8 sub_8088A0C(int x, int src_width, int dest_width, int offset); diff --git a/include/gba/defines.h b/include/gba/defines.h index b68a2ad1e..9bd695aaa 100644 --- a/include/gba/defines.h +++ b/include/gba/defines.h @@ -6,9 +6,16 @@ #define TRUE 1 #define FALSE 0 +#define BSS_DATA __attribute__((section(".bss"))) #define IWRAM_DATA __attribute__((section("iwram_data"))) #define EWRAM_DATA __attribute__((section("ewram_data"))) +#if MODERN +#define NOINLINE __attribute__((noinline)) +#else +#define NOINLINE +#endif + #define ALIGNED(n) __attribute__((aligned(n))) #define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0) diff --git a/include/global.h b/include/global.h index 924949d46..e1acc154c 100644 --- a/include/global.h +++ b/include/global.h @@ -2,6 +2,7 @@ #define GUARD_GLOBAL_H #include +#include #include "config.h" // we need to define config before gba headers as print stuff needs the functions nulled before defines. #include "gba/gba.h" #include "constants/global.h" @@ -68,6 +69,10 @@ #define min(a, b) ((a) < (b) ? (a) : (b)) #define max(a, b) ((a) >= (b) ? (a) : (b)) +#if MODERN +#define abs(x) (((x) < 0) ? -(x) : (x)) +#endif + // Extracts the upper 16 bits of a 32-bit number #define HIHALF(n) (((n) & 0xFFFF0000) >> 16) @@ -164,18 +169,17 @@ struct Pokedex /*0x44*/ u8 seen[DEX_FLAGS_NO]; }; -struct PokemonJumpResults // possibly used in the game itself? +struct PokemonJumpResults { u16 jumpsInRow; u16 field2; u16 excellentsInRow; u16 field6; - u16 field8; - u16 fieldA; + u32 field8; u32 bestJumpScore; }; -struct BerryPickingResults // possibly used in the game itself? Size may be wrong as well +struct BerryPickingResults { u32 bestScore; u16 berriesPicked; diff --git a/include/graphics.h b/include/graphics.h index 6e5420a64..d6da5cb10 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4005,10 +4005,13 @@ extern const u32 gBerryPalette_Starf[]; extern const u32 gBerryPic_Enigma[]; extern const u32 gBerryPalette_Enigma[]; -//credits -extern const u32 gCreditsCopyrightEnd_Gfx[]; - //pokenav +extern const u16 gPokenavCondition_Pal[]; +extern const u32 gPokenavCondition_Gfx[]; +extern const u32 gPokenavCondition_Tilemap[]; +extern const u16 gPokenavOptions_Tilemap[]; +extern const u32 gPokenavOptions_Gfx[]; +extern const u16 gPokenavOptions_Pal[]; extern const u8 gPokenavConditionMarker_Gfx[]; extern const u16 gPokenavConditionMarker_Pal[]; extern const u16 gPokenavLeftHeader_Pal[]; @@ -4027,6 +4030,9 @@ extern const u32 gPokenavLeftHeaderBeauty_Gfx[]; extern const u32 gPokenavLeftHeaderCute_Gfx[]; extern const u32 gPokenavLeftHeaderSmart_Gfx[]; extern const u32 gPokenavLeftHeaderTough_Gfx[]; +extern const u16 gUnknown_08DDE010[]; +extern const u32 gUnknown_08DDE030[]; +extern const u32 gUnknown_08DDE12C[]; extern const u32 gPageInfoTilemap[]; extern const u32 gUnknown_08D98CC8[]; @@ -4080,7 +4086,7 @@ extern const u32 gContestConfetti_Pal[]; extern const u32 gUnknown_08C093F0[]; extern const u32 gSubstituteDollTilemap[]; extern const u32 gSubstituteDollGfx[]; -extern const u16 gSubstituteDollPal[]; +extern const u32 gSubstituteDollPal[]; extern const u32 gHealthboxSinglesPlayerGfx[]; extern const u32 gHealthboxSinglesOpponentGfx[]; extern const u32 gHealthboxDoublesPlayerGfx[]; @@ -4979,6 +4985,9 @@ extern const u32 gLinkMiscMenu_Tilemap[]; // Use Pokeblock extern const u8 gPokenavConditionCancel_Gfx[]; extern const u16 gPokenavConditionCancel_Pal[]; +extern const u8 gUsePokeblockUpDown_Gfx[]; +extern const u16 gUsePokeblockUpDown_Pal[]; +extern const u16 gUsePokeblockCondition_Pal[]; // Berry Crush extern const u32 gUnknown_08DE34B8[]; diff --git a/include/link_rfu.h b/include/link_rfu.h index dc5b963d1..d6e1009e1 100644 --- a/include/link_rfu.h +++ b/include/link_rfu.h @@ -275,10 +275,10 @@ void sub_8010FCC(u32 a0, u32 a1, u32 a2); void sub_8011C84(void); void sub_8012188(const u8 *name, struct UnkLinkRfuStruct_02022B14 *structPtr, u8 a2); bool32 sub_8011B90(void); -void sub_800FE50(u16 *a0); +void sub_800FE50(void *a0); bool32 sub_800E540(u16 id, u8 *name); void sub_8011DE0(u32 arg0); -u8 sub_801100C(int a0); +u8 sub_801100C(s32 a0); void sub_800EF7C(void); bool8 sub_800DE7C(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx); bool8 sub_800DF34(struct UnkLinkRfuStruct_02022B14 *buff1, u8 *buff2, u8 idx); diff --git a/include/menu.h b/include/menu.h index 08cad40bd..62e2558dc 100644 --- a/include/menu.h +++ b/include/menu.h @@ -25,7 +25,7 @@ void InitStandardTextBoxWindows(void); void sub_8197200(void); u16 RunTextPrintersAndIsPrinter0Active(void); void sub_81973A4(void); -void DrawDialogueFrame(u8, u8); +void DrawDialogueFrame(u8 windowId, bool8 copyToVram); void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram); u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 fgColor, u8 bgColor, u8 shadowColor); void PrintPlayerNameOnWindow(u8, const u8*, u16, u16); diff --git a/include/menu_specialized.h b/include/menu_specialized.h index 014ee2585..14a246468 100644 --- a/include/menu_specialized.h +++ b/include/menu_specialized.h @@ -34,6 +34,7 @@ void sub_81D1EC0(void); void sub_81D1D04(u8 a0); void sub_81D1ED4(struct UnknownStruct_81D1ED4 *a0); void sub_81D2108(struct UnknownStruct_81D1ED4 *arg0); +void sub_81D21DC(u8 bg); void sub_81D20AC(struct UnknownStruct_81D1ED4 *arg0); void sub_81D2230(struct UnknownStruct_81D1ED4 *arg0); bool8 sub_81D20BC(struct UnknownStruct_81D1ED4 *arg0); diff --git a/include/player_pc.h b/include/player_pc.h index 53bb25c6b..219c11440 100644 --- a/include/player_pc.h +++ b/include/player_pc.h @@ -1,6 +1,8 @@ #ifndef GUARD_PLAYER_PC_H #define GUARD_PLAYER_PC_H +#include "menu.h" + // local task defines #define PAGE_INDEX data[0] #define ITEMS_ABOVE_TOP data[1] diff --git a/include/pokemon.h b/include/pokemon.h index 79a3bc10f..d5459fe76 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -559,7 +559,7 @@ void PlayBattleBGM(void); void PlayMapChosenOrBattleBGM(u16 songId); void sub_806E694(u16 songId); const u32 *GetMonFrontSpritePal(struct Pokemon *mon); -const u32 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality); +const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality); const struct CompressedSpritePalette *GetMonSpritePalStruct(struct Pokemon *mon); const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u16 species, u32 otId , u32 personality); bool32 IsHMMove2(u16 move); diff --git a/include/pokemon_jump.h b/include/pokemon_jump.h index d137c37b2..28b19f9b1 100644 --- a/include/pokemon_jump.h +++ b/include/pokemon_jump.h @@ -3,9 +3,12 @@ #include "main.h" -void sub_802EB24(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4); -bool32 sub_802EB84(void); void sub_802A9A8(u16 monId, MainCallback callback); bool32 sub_802C908(u16 species); +void sub_802C920(void); +void ResetPokeJumpResults(void); +void sub_802E3C4(void); +void sub_802EB24(s16 tileTag, s16 palTag, s16 x, s16 y, u8 subpriority); +bool32 sub_802EB84(void); -#endif //GUARD_POKEMON_JUMP_H +#endif // GUARD_POKEMON_JUMP_H diff --git a/include/pokenav.h b/include/pokenav.h index c840fd494..380e61dda 100644 --- a/include/pokenav.h +++ b/include/pokenav.h @@ -3,8 +3,21 @@ #include "bg.h" #include "main.h" +#include "pokemon_storage_system.h" -typedef u32 (*LoopedTask)(int state); +typedef u32 (*LoopedTask)(s32 state); + +struct PokenavSub18 +{ + u16 unk0; + u16 unk2; + struct PokenavMonList + { + u8 boxId; + u8 monId; + u16 unk6; + } unk4[TOTAL_BOXES_COUNT * IN_BOX_COUNT + PARTY_SIZE]; +}; // Return values of LoopedTask functions. #define LT_INC_AND_PAUSE 0 @@ -43,7 +56,7 @@ enum // pokenav.c void sub_81C7694(u32); -u16 sub_81C76AC(void); +u32 sub_81C76AC(void); void CB2_InitPokeNav(void); u32 CreateLoopedTask(LoopedTask loopedTask, u32 priority); @@ -94,7 +107,7 @@ void sub_81C8234(void); // pokenav_match_call_data.c bool32 sub_81D17E8(u32 idx); -u8 sub_81D16DC(u32 idx); +u8 MatchCallMapSecGetByIndex(u32 idx); bool32 sub_81D1BF8(u32 idx); bool32 MatchCallFlagGetByIndex(u32 idx); u32 MatchCall_GetRematchTableIdx(u32 idx); @@ -111,7 +124,7 @@ void sub_81C7850(u32 a0); u32 sub_81C786C(void); void LoadLeftHeaderGfxForIndex(u32 arg0); void sub_81C7FA0(u32 arg0, bool32 arg1, bool32 arg2); -void sub_81C7AC0(int a0); +void sub_81C7AC0(s32 a0); bool32 sub_81C8010(void); void InitBgTemplates(const struct BgTemplate *templates, int count); bool32 IsPaletteFadeActive(void); @@ -184,4 +197,22 @@ void sub_81CC62C(int); u32 sub_81CC65C(void); void sub_81CC670(void); -#endif //GUARD_POKENAV_H +// pokenav_unk_6.c +bool32 sub_81CD3C4(void); +bool32 sub_81CDD5C(void); +struct UnknownStruct_81D1ED4 *sub_81CDC70(void); +u16 sub_81CDC60(void); +u16 sub_81CDC50(void); +u8 sub_81CDDB0(void); +bool32 sub_81CD548(u8 arg0); +u8 sub_81CDD7C(void); +u8 *sub_81CDD04(u8 id); +u8 *sub_81CDD24(u8 id); +u16 sub_81CDD48(void); +void *sub_81CDCB4(u8 id); +void *sub_81CDCD4(u8 id); + +// pokenav_unk_7.c +u8 sub_81CEF14(void); + +#endif // GUARD_POKENAV_H diff --git a/include/sprite.h b/include/sprite.h index 32bdd9c55..9753837fd 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -275,6 +275,7 @@ void FreeSpriteOamMatrix(struct Sprite *sprite); void DestroySpriteAndFreeResources(struct Sprite *sprite); void sub_800142C(u32 a1, u32 a2, u16 *a3, u16 a4, u32 a5); void AnimateSprite(struct Sprite *sprite); +void sub_8007E18(struct Sprite* sprite, s16 a2, s16 a3); void StartSpriteAnim(struct Sprite *sprite, u8 animNum); void StartSpriteAnimIfDifferent(struct Sprite *sprite, u8 animNum); void SeekSpriteAnim(struct Sprite *sprite, u8 animCmdIndex); diff --git a/include/strings.h b/include/strings.h index e373a5660..97285b051 100644 --- a/include/strings.h +++ b/include/strings.h @@ -485,7 +485,6 @@ extern const u8 gText_CryOf[]; extern const u8 gText_SizeComparedTo[]; extern const u8 gText_PokedexRegistration[]; extern const u8 gText_UnkCtrlF908Clear01[]; -extern const u8 sText_TenDashes2[]; extern const u8 gText_5MarksPokemon[]; extern const u8 gText_UnkHeight[]; extern const u8 gText_UnkWeight[]; @@ -1023,6 +1022,7 @@ extern const u8 gText_PokenavMatchCall_CheckTrainerButtons[]; extern const u8 gText_PokenavRibbons_MonListButtons[]; extern const u8 gText_PokenavRibbons_RibbonListButtons[]; extern const u8 gText_PokenavRibbons_RibbonCheckButtons[]; +extern const u8 gText_Number2[]; extern const u8 gUnknown_085EAD37[]; extern const u8 gUnknown_085EAD41[]; @@ -2708,6 +2708,28 @@ extern const u8 gText_Symbols[]; extern const u8 gText_Register2[]; extern const u8 gText_Exit2[]; +// Dodrio Berry Picking +extern const u8 gText_BerryPickingRecords[]; +extern const u8 gText_BerriesPicked[]; +extern const u8 gText_BerriesInRowFivePlayers[]; +extern const u8 gText_BestScore[]; +extern const u8 gText_1Colon[]; +extern const u8 gText_2Colon[]; +extern const u8 gText_3Colon[]; +extern const u8 gText_4Colon[]; +extern const u8 gText_5Colon[]; +extern const u8 gText_SpacePoints[]; +extern const u8 gText_10P30P50P50P[]; +extern const u8 gText_AnnouncingPrizes[]; +extern const u8 gText_AnnouncingRankings[]; +extern const u8 gText_FirstPlacePrize[]; +extern const u8 gText_CantHoldAnyMore[]; +extern const u8 gText_FilledStorageSpace[]; +extern const u8 gText_BerryPickingResults[]; +extern const u8 gText_WantToPlayAgain[]; +extern const u8 gText_CommunicationStandby3[]; +extern const u8 gText_SomeoneDroppedOut[]; + // Pokemon jump extern const u8 gText_WantToPlayAgain2[]; extern const u8 gText_SomeoneDroppedOut2[]; @@ -2715,6 +2737,12 @@ extern const u8 gText_CommunicationStandby4[]; extern const u8 gText_AwesomeWonF701F700[]; extern const u8 gText_FilledStorageSpace2[]; extern const u8 gText_CantHoldMore[]; +extern const u8 gText_SpacePoints2[]; +extern const u8 gText_SpaceTimes3[]; +extern const u8 gText_PkmnJumpRecords[]; +extern const u8 gText_JumpsInARow[]; +extern const u8 gText_BestScore2[]; +extern const u8 gText_ExcellentsInARow[]; // Pokenav Match Call extern const u8 gText_CallCantBeMadeHere[]; @@ -2723,4 +2751,35 @@ extern const u8 gText_NumberOfBattles[]; extern const u8 gText_Unknown[]; extern const u8 gText_TrainerCloseBy[]; +// pokenav_unk_2 +extern const u8 gUnknown_085EBCC5[]; +extern const u8 gUnknown_085EBCE8[]; +extern const u8 gUnknown_085EBD01[]; +extern const u8 gUnknown_085EBD1C[]; +extern const u8 gUnknown_085EBD34[]; +extern const u8 gUnknown_085EBD83[]; +extern const u8 gUnknown_085EBDA2[]; +extern const u8 gUnknown_085EBDBF[]; +extern const u8 gUnknown_085EBDDB[]; +extern const u8 gUnknown_085EBDEE[]; +extern const u8 gUnknown_085EBE06[]; +extern const u8 gUnknown_085EBE19[]; +extern const u8 gUnknown_085EBE2D[]; +extern const u8 gUnknown_085EBE41[]; + +// pokenav_unk_4 +extern const u8 gUnknown_085EC017[]; +extern const u8 gUnknown_085EC01C[]; +extern const u8 gUnknown_085EC022[]; + +// pokenav_unk_10 +extern const u8 gText_RibbonsF700[]; + +// use_pokeblock +extern const u8 gText_Coolness[]; +extern const u8 gText_Toughness[]; +extern const u8 gText_Smartness[]; +extern const u8 gText_Cuteness[]; +extern const u8 gText_Beauty3[]; + #endif // GUARD_STRINGS_H diff --git a/include/text.h b/include/text.h index eba3d0c4e..d3ff663bb 100644 --- a/include/text.h +++ b/include/text.h @@ -166,7 +166,11 @@ struct TextPrinter void (*callback)(struct TextPrinterTemplate *, u16); // 0x10 - union __attribute__((packed)) { + union +#if !MODERN + __attribute__((packed)) +#endif + { struct TextPrinterSubStruct sub; u8 fields[7]; } subUnion; diff --git a/ld_script.txt b/ld_script.txt index 6a6008f9f..624280f6e 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -47,294 +47,292 @@ SECTIONS { .text : ALIGN(4) { - asm/crt0.o(.text); - src/main.o(.text); - src/alloc.o(.text); - src/dma3_manager.o(.text); - src/gpu_regs.o(.text); - src/bg.o(.text); - src/blit.o(.text); - src/window.o(.text); - src/text.o(.text); - src/sprite.o(.text); - src/string_util.o(.text); - src/link.o(.text); - src/link_rfu.o(.text); - src/union_room.o(.text); - src/mystery_gift.o(.text); - src/union_room_player_avatar.o(.text); - src/union_room_battle.o(.text); - src/mevent2.o(.text); - src/mevent_801BAAC.o(.text); - src/mevent_server.o(.text); - src/mevent_client.o(.text); - src/mevent_server_helpers.o(.text); - src/mevent_news.o(.text); - src/union_room_chat.o(.text); - src/berry_crush.o(.text); - asm/berry_crush.o(.text); - src/berry_powder.o(.text); - src/dodrio_berry_picking.o(.text); - asm/dodrio_berry_picking.o(.text); - src/pokemon_jump.o(.text); - asm/pokemon_jump.o(.text); - src/rtc.o(.text); - src/main_menu.o(.text); - src/battle_controllers.o(.text); - src/decompress.o(.text); - src/rom_8034C54.o(.text); - src/battle_bg.o(.text); - src/battle_main.o(.text); - src/battle_util.o(.text); - src/battle_script_commands.o(.text); - src/battle_util2.o(.text); - src/battle_controller_player.o(.text); - src/battle_gfx_sfx_util.o(.text); - src/battle_controller_opponent.o(.text); - src/battle_ai_switch_items.o(.text); - src/battle_controller_link_opponent.o(.text); - src/pokemon.o(.text); - src/trig.o(.text); - src/random.o(.text); - src/util.o(.text); - src/daycare.o(.text); - src/egg_hatch.o(.text); - src/battle_interface.o(.text); - src/smokescreen.o(.text); - src/pokeball.o(.text); - src/load_save.o(.text); - src/trade.o(.text); - src/berry_blender.o(.text); - src/play_time.o(.text); - src/new_game.o(.text); - src/overworld.o(.text); - src/fieldmap.o(.text); - src/metatile_behavior.o(.text); - src/field_camera.o(.text); - src/field_door.o(.text); - src/field_player_avatar.o(.text); - src/event_object_movement.o(.text); - src/field_message_box.o(.text); - src/event_obj_lock.o(.text); - src/text_window.o(.text); - src/script.o(.text); - src/scrcmd.o(.text); - src/field_control_avatar.o(.text); - src/event_data.o(.text); - src/coord_event_weather.o(.text); - src/field_tasks.o(.text); - src/clock.o(.text); - src/reset_rtc_screen.o(.text); - src/start_menu.o(.text); - src/tileset_anims.o(.text); - src/palette.o(.text); - src/sound.o(.text); - src/battle_anim.o(.text); - src/battle_anim_mons.o(.text); - src/task.o(.text); - src/reshow_battle_screen.o(.text); - src/battle_anim_status_effects.o(.text); - src/title_screen.o(.text); - src/field_weather.o(.text); - src/field_weather_effect.o(.text); - src/field_screen_effect.o(.text); - src/battle_setup.o(.text); - src/cable_club.o(.text); - src/trainer_see.o(.text); - src/wild_encounter.o(.text); - src/field_effect.o(.text); - src/scanline_effect.o(.text); - src/option_menu.o(.text); - src/pokedex.o(.text); - src/trainer_card.o(.text); - src/frontier_pass.o(.text); - src/pokemon_storage_system.o(.text); - src/pokemon_icon.o(.text); - src/script_movement.o(.text); - src/fldeff_cut.o(.text); - src/mail_data.o(.text); - src/map_name_popup.o(.text); - src/item_menu_icons.o(.text); - src/battle_anim_mon_movement.o(.text); - src/item.o(.text); - src/contest.o(.text); - src/shop.o(.text); - src/fldeff_escalator.o(.text); - src/berry.o(.text); - src/script_menu.o(.text); - src/naming_screen.o(.text); - src/money.o(.text); - src/contest_effect.o(.text); - src/record_mixing.o(.text); - src/secret_base.o(.text); - src/tv.o(.text); - src/contest_link_80F57C4.o(.text); - src/script_pokemon_util_80F87D8.o(.text); - src/field_poison.o(.text); - src/pokemon_size_record.o(.text); - src/fldeff_misc.o(.text); - src/field_special_scene.o(.text); - src/rotating_gate.o(.text); - src/safari_zone.o(.text); - src/contest_link_80FC4F4.o(.text); - src/item_use.o(.text); - src/battle_anim_effects_1.o(.text); - src/battle_anim_effects_2.o(.text); - src/water.o(.text); - src/fire.o(.text); - src/electric.o(.text); - src/ice.o(.text); - src/fight.o(.text); - src/poison.o(.text); - src/flying.o(.text); - src/psychic.o(.text); - src/bug.o(.text); - src/rock.o(.text); - src/ghost.o(.text); - src/dragon.o(.text); - src/dark.o(.text); - src/ground.o(.text); - src/normal.o(.text); - src/battle_anim_utility_funcs.o(.text); - src/battle_intro.o(.text); - src/bike.o(.text); - src/easy_chat.o(.text); - src/mon_markings.o(.text); - src/mauville_old_man.o(.text); - src/mail.o(.text); - src/menu_helpers.o(.text); - src/dewford_trend.o(.text); - src/heal_location.o(.text); - src/region_map.o(.text); - src/contest_painting_effects.o(.text); - src/decoration.o(.text); - src/slot_machine.o(.text); - src/contest_painting.o(.text); - src/battle_ai_script_commands.o(.text); - src/trader.o(.text); - src/starter_choose.o(.text); - src/wallclock.o(.text); - src/fldeff_rocksmash.o(.text); - src/fldeff_dig.o(.text); - src/pokeblock.o(.text); - src/fldeff_flash.o(.text); - src/post_battle_event_funcs.o(.text); - src/time_events.o(.text); - src/birch_pc.o(.text); - src/hof_pc.o(.text); - src/field_specials.o(.text); - src/battle_records.o(.text); - src/pokedex_area_screen.o(.text); - src/evolution_scene.o(.text); - src/roulette.o(.text); - src/pokedex_cry_screen.o(.text); - src/coins.o(.text); - src/landmark.o(.text); - src/fldeff_strength.o(.text); - src/battle_transition.o(.text); - src/battle_controller_link_partner.o(.text); - src/battle_message.o(.text); - src/cable_car.o(.text); - src/math_util.o(.text); - src/roulette_util.o(.text); - src/rom_81520A8.o(.text); - src/save.o(.text); - src/mystery_event_script.o(.text); - src/field_effect_helpers.o(.text); - src/contest_ai.o(.text); - src/battle_anim_sound_tasks.o(.text); - src/battle_controller_safari.o(.text); - src/fldeff_sweetscent.o(.text); - src/battle_anim_effects_3.o(.text); - src/move_relearner.o(.text); - src/fldeff_softboiled.o(.text); - src/decoration_inventory.o(.text); - src/roamer.o(.text); - src/battle_tower.o(.text); - src/use_pokeblock.o(.text); - src/battle_controller_wally.o(.text); - src/player_pc.o(.text); - src/intro.o(.text); - src/reset_save_heap.o(.text); - src/field_region_map.o(.text); - src/battle_anim_special.o(.text); - src/hall_of_fame.o(.text); - src/credits.o(.text); - src/lottery_corner.o(.text); - src/diploma.o(.text); - src/berry_tag_screen.o(.text); - src/mystery_event_menu.o(.text); - src/save_failed_screen.o(.text); - src/braille_puzzles.o(.text); - src/pokeblock_feed.o(.text); - src/clear_save_data_screen.o(.text); - src/intro_credits_graphics.o(.text); - src/evolution_graphics.o(.text); - src/bard_music.o(.text); - src/fldeff_teleport.o(.text); - src/battle_tv.o(.text); - src/pokemon_animation.o(.text); - src/recorded_battle.o(.text); - src/battle_controller_recorded_opponent.o(.text); - src/battle_controller_recorded_player.o(.text); - src/trainer_pokemon_sprites.o(.text); - src/lilycove_lady.o(.text); - src/battle_dome.o(.text); - src/battle_palace.o(.text); - src/match_call.o(.text); - src/menu.o(.text); - src/battle_factory_screen.o(.text); - src/apprentice.o(.text); - src/frontier_util.o(.text); - src/battle_arena.o(.text); - src/battle_factory.o(.text); - src/battle_pike.o(.text); - src/mossdeep_gym.o(.text); - src/battle_pyramid.o(.text); - src/item_menu.o(.text); - src/list_menu.o(.text); - src/dynamic_placeholder_text_util.o(.text); - src/save_location.o(.text); - src/item_icon.o(.text); - src/party_menu.o(.text); - src/battle_tent.o(.text); - src/unk_text_util_2.o(.text); - src/multiboot.o(.text); - src/unk_81BAD84.o(.text); - src/battle_controller_player_partner.o(.text); - src/mirage_tower.o(.text); - src/berry_fix_program.o(.text); - src/pokemon_summary_screen.o(.text); - src/unk_pokedex_area_screen_helper.o(.text); - src/battle_pyramid_bag.o(.text); - src/pokenav.o(.text); - src/pokenav_main_menu.o(.text); - src/pokenav_match_call_ui.o(.text); - src/pokenav_unk_1.o(.text); - src/pokenav_unk_2.o(.text); - asm/pokenav_unk_2.o(.text); - src/pokenav_unk_3.o(.text); - src/pokenav_unk_4.o(.text); - src/pokenav_unk_5.o(.text); - asm/pokenav_unk_6.o(.text); - asm/pokenav_unk_7.o(.text); - asm/pokenav_unk_8.o(.text); - asm/pokenav_unk_9.o(.text); - asm/pokenav_unk_10.o(.text); - src/pokenav_unk_10.o(.text); - src/pokenav_match_call_data.o(.text); - src/menu_specialized.o(.text); - src/ereader_helpers.o(.text); - src/faraway_island.o(.text); - src/ereader_screen.o(.text); - src/trainer_hill.o(.text); - src/rayquaza_scene.o(.text); - src/walda_phrase.o(.text); - src/contest_link_81D9DE4.o(.text); - src/gym_leader_rematch.o(.text); - src/unk_transition.o(.text); - src/international_string_util.o(.text); - src/battle_debug.o(.text); + asm/crt0.o(.text*); + src/main.o(.text*); + src/alloc.o(.text*); + src/dma3_manager.o(.text*); + src/gpu_regs.o(.text*); + src/bg.o(.text*); + src/blit.o(.text*); + src/window.o(.text*); + src/text.o(.text*); + src/sprite.o(.text*); + src/string_util.o(.text*); + src/link.o(.text*); + src/link_rfu.o(.text*); + src/union_room.o(.text*); + src/mystery_gift.o(.text*); + src/union_room_player_avatar.o(.text*); + src/union_room_battle.o(.text*); + src/mevent2.o(.text*); + src/mevent_801BAAC.o(.text*); + src/mevent_server.o(.text*); + src/mevent_client.o(.text*); + src/mevent_server_helpers.o(.text*); + src/mevent_news.o(.text*); + src/union_room_chat.o(.text*); + src/berry_crush.o(.text*); + asm/berry_crush.o(.text*); + src/berry_powder.o(.text*); + src/dodrio_berry_picking.o(.text*); + src/pokemon_jump.o(.text*); + src/rtc.o(.text*); + src/main_menu.o(.text*); + src/battle_controllers.o(.text*); + src/decompress.o(.text*); + src/rom_8034C54.o(.text*); + src/battle_bg.o(.text*); + src/battle_main.o(.text*); + src/battle_util.o(.text*); + src/battle_script_commands.o(.text*); + src/battle_util2.o(.text*); + src/battle_controller_player.o(.text*); + src/battle_gfx_sfx_util.o(.text*); + src/battle_controller_opponent.o(.text*); + src/battle_ai_switch_items.o(.text*); + src/battle_controller_link_opponent.o(.text*); + src/pokemon.o(.text*); + src/trig.o(.text*); + src/random.o(.text*); + src/util.o(.text*); + src/daycare.o(.text*); + src/egg_hatch.o(.text*); + src/battle_interface.o(.text*); + src/smokescreen.o(.text*); + src/pokeball.o(.text*); + src/load_save.o(.text*); + src/trade.o(.text*); + src/berry_blender.o(.text*); + src/play_time.o(.text*); + src/new_game.o(.text*); + src/overworld.o(.text*); + src/fieldmap.o(.text*); + src/metatile_behavior.o(.text*); + src/field_camera.o(.text*); + src/field_door.o(.text*); + src/field_player_avatar.o(.text*); + src/event_object_movement.o(.text*); + src/field_message_box.o(.text*); + src/event_obj_lock.o(.text*); + src/text_window.o(.text*); + src/script.o(.text*); + src/scrcmd.o(.text*); + src/field_control_avatar.o(.text*); + src/event_data.o(.text*); + src/coord_event_weather.o(.text*); + src/field_tasks.o(.text*); + src/clock.o(.text*); + src/reset_rtc_screen.o(.text*); + src/start_menu.o(.text*); + src/tileset_anims.o(.text*); + src/palette.o(.text*); + src/sound.o(.text*); + src/battle_anim.o(.text*); + src/battle_anim_mons.o(.text*); + src/task.o(.text*); + src/reshow_battle_screen.o(.text*); + src/battle_anim_status_effects.o(.text*); + src/title_screen.o(.text*); + src/field_weather.o(.text*); + src/field_weather_effect.o(.text*); + src/field_screen_effect.o(.text*); + src/battle_setup.o(.text*); + src/cable_club.o(.text*); + src/trainer_see.o(.text*); + src/wild_encounter.o(.text*); + src/field_effect.o(.text*); + src/scanline_effect.o(.text*); + src/option_menu.o(.text*); + src/pokedex.o(.text*); + src/trainer_card.o(.text*); + src/frontier_pass.o(.text*); + src/pokemon_storage_system.o(.text*); + src/pokemon_icon.o(.text*); + src/script_movement.o(.text*); + src/fldeff_cut.o(.text*); + src/mail_data.o(.text*); + src/map_name_popup.o(.text*); + src/item_menu_icons.o(.text*); + src/battle_anim_mon_movement.o(.text*); + src/item.o(.text*); + src/contest.o(.text*); + src/shop.o(.text*); + src/fldeff_escalator.o(.text*); + src/berry.o(.text*); + src/script_menu.o(.text*); + src/naming_screen.o(.text*); + src/money.o(.text*); + src/contest_effect.o(.text*); + src/record_mixing.o(.text*); + src/secret_base.o(.text*); + src/tv.o(.text*); + src/contest_link_80F57C4.o(.text*); + src/script_pokemon_util_80F87D8.o(.text*); + src/field_poison.o(.text*); + src/pokemon_size_record.o(.text*); + src/fldeff_misc.o(.text*); + src/field_special_scene.o(.text*); + src/rotating_gate.o(.text*); + src/safari_zone.o(.text*); + src/contest_link_80FC4F4.o(.text*); + src/item_use.o(.text*); + src/battle_anim_effects_1.o(.text*); + src/battle_anim_effects_2.o(.text*); + src/water.o(.text*); + src/fire.o(.text*); + src/electric.o(.text*); + src/ice.o(.text*); + src/fight.o(.text*); + src/poison.o(.text*); + src/flying.o(.text*); + src/psychic.o(.text*); + src/bug.o(.text*); + src/rock.o(.text*); + src/ghost.o(.text*); + src/dragon.o(.text*); + src/dark.o(.text*); + src/ground.o(.text*); + src/normal.o(.text*); + src/battle_anim_utility_funcs.o(.text*); + src/battle_intro.o(.text*); + src/bike.o(.text*); + src/easy_chat.o(.text*); + src/mon_markings.o(.text*); + src/mauville_old_man.o(.text*); + src/mail.o(.text*); + src/menu_helpers.o(.text*); + src/dewford_trend.o(.text*); + src/heal_location.o(.text*); + src/region_map.o(.text*); + src/contest_painting_effects.o(.text*); + src/decoration.o(.text*); + src/slot_machine.o(.text*); + src/contest_painting.o(.text*); + src/battle_ai_script_commands.o(.text*); + src/trader.o(.text*); + src/starter_choose.o(.text*); + src/wallclock.o(.text*); + src/fldeff_rocksmash.o(.text*); + src/fldeff_dig.o(.text*); + src/pokeblock.o(.text*); + src/fldeff_flash.o(.text*); + src/post_battle_event_funcs.o(.text*); + src/time_events.o(.text*); + src/birch_pc.o(.text*); + src/hof_pc.o(.text*); + src/field_specials.o(.text*); + src/battle_records.o(.text*); + src/pokedex_area_screen.o(.text*); + src/evolution_scene.o(.text*); + src/roulette.o(.text*); + src/pokedex_cry_screen.o(.text*); + src/coins.o(.text*); + src/landmark.o(.text*); + src/fldeff_strength.o(.text*); + src/battle_transition.o(.text*); + src/battle_controller_link_partner.o(.text*); + src/battle_message.o(.text*); + src/cable_car.o(.text*); + src/math_util.o(.text*); + src/roulette_util.o(.text*); + src/rom_81520A8.o(.text*); + src/save.o(.text*); + src/mystery_event_script.o(.text*); + src/field_effect_helpers.o(.text*); + src/contest_ai.o(.text*); + src/battle_anim_sound_tasks.o(.text*); + src/battle_controller_safari.o(.text*); + src/fldeff_sweetscent.o(.text*); + src/battle_anim_effects_3.o(.text*); + src/move_relearner.o(.text*); + src/fldeff_softboiled.o(.text*); + src/decoration_inventory.o(.text*); + src/roamer.o(.text*); + src/battle_tower.o(.text*); + src/use_pokeblock.o(.text*); + src/battle_controller_wally.o(.text*); + src/player_pc.o(.text*); + src/intro.o(.text*); + src/reset_save_heap.o(.text*); + src/field_region_map.o(.text*); + src/battle_anim_special.o(.text*); + src/hall_of_fame.o(.text*); + src/credits.o(.text*); + src/lottery_corner.o(.text*); + src/diploma.o(.text*); + src/berry_tag_screen.o(.text*); + src/mystery_event_menu.o(.text*); + src/save_failed_screen.o(.text*); + src/braille_puzzles.o(.text*); + src/pokeblock_feed.o(.text*); + src/clear_save_data_screen.o(.text*); + src/intro_credits_graphics.o(.text*); + src/evolution_graphics.o(.text*); + src/bard_music.o(.text*); + src/fldeff_teleport.o(.text*); + src/battle_tv.o(.text*); + src/pokemon_animation.o(.text*); + src/recorded_battle.o(.text*); + src/battle_controller_recorded_opponent.o(.text*); + src/battle_controller_recorded_player.o(.text*); + src/trainer_pokemon_sprites.o(.text*); + src/lilycove_lady.o(.text*); + src/battle_dome.o(.text*); + src/battle_palace.o(.text*); + src/match_call.o(.text*); + src/menu.o(.text*); + src/battle_factory_screen.o(.text*); + src/apprentice.o(.text*); + src/frontier_util.o(.text*); + src/battle_arena.o(.text*); + src/battle_factory.o(.text*); + src/battle_pike.o(.text*); + src/mossdeep_gym.o(.text*); + src/battle_pyramid.o(.text*); + src/item_menu.o(.text*); + src/list_menu.o(.text*); + src/dynamic_placeholder_text_util.o(.text*); + src/save_location.o(.text*); + src/item_icon.o(.text*); + src/party_menu.o(.text*); + src/battle_tent.o(.text*); + src/unk_text_util_2.o(.text*); + src/multiboot.o(.text*); + src/unk_81BAD84.o(.text*); + src/battle_controller_player_partner.o(.text*); + src/mirage_tower.o(.text*); + src/berry_fix_program.o(.text*); + src/pokemon_summary_screen.o(.text*); + src/unk_pokedex_area_screen_helper.o(.text*); + src/battle_pyramid_bag.o(.text*); + src/pokenav.o(.text*); + src/pokenav_main_menu.o(.text*); + src/pokenav_match_call_ui.o(.text*); + src/pokenav_unk_1.o(.text*); + src/pokenav_unk_2.o(.text*); + asm/pokenav_unk_2.o(.text*); + src/pokenav_unk_3.o(.text*); + src/pokenav_unk_4.o(.text*); + src/pokenav_unk_5.o(.text*); + src/pokenav_unk_6.o(.text*); + src/pokenav_unk_7.o(.text*); + src/pokenav_unk_8.o(.text*); + asm/pokenav_unk_8.o(.text*); + asm/pokenav_unk_9.o(.text*); + src/pokenav_unk_10.o(.text*); + src/pokenav_match_call_data.o(.text*); + src/menu_specialized.o(.text*); + src/ereader_helpers.o(.text*); + src/faraway_island.o(.text*); + src/ereader_screen.o(.text*); + src/trainer_hill.o(.text*); + src/rayquaza_scene.o(.text*); + src/walda_phrase.o(.text*); + src/contest_link_81D9DE4.o(.text*); + src/gym_leader_rematch.o(.text*); + src/unk_transition.o(.text*); + src/battle_debug.o(.text*); + src/international_string_util.o(.text*); } =0 script_data : @@ -353,70 +351,71 @@ SECTIONS { lib_text : ALIGN(4) { - asm/libgcnmultiboot.o(.text); - asm/m4a_1.o(.text); - src/m4a.o(.text); - src/agb_flash.o(.text); - src/agb_flash_1m.o(.text); - src/agb_flash_mx.o(.text); - src/siirtc.o(.text); - src/librfu_stwi.o(.text); - src/librfu_intr.o(.text); - asm/librfu_intr.o(.text); - src/librfu_rfu.o(.text); - asm/librfu.o(.text); - asm/libagbsyscall.o(.text); - *libgcc.a:_call_via_rX.o(.text); - *libgcc.a:_divdi3.o(.text); - *libgcc.a:_divsi3.o(.text); - *libgcc.a:_dvmd_tls.o(.text); - *libgcc.a:_fixunsdfsi.o(.text); - *libgcc.a:_fixunssfsi.o(.text); - *libgcc.a:_modsi3.o(.text); - *libgcc.a:_muldi3.o(.text); - *libgcc.a:_udivdi3.o(.text); - *libgcc.a:_udivsi3.o(.text); - *libgcc.a:_umodsi3.o(.text); - *libgcc.a:dp-bit.o(.text); - *libgcc.a:fp-bit.o(.text); - *libgcc.a:_lshrdi3.o(.text); - *libgcc.a:_negdi2.o(.text); - *libc.a:memcpy.o(.text); - *libc.a:memset.o(.text); - *libc.a:strcmp.o(.text); - *libc.a:strcpy.o(.text); - *libc.a:vfprintf.o(.text); - *libc.a:vsprintf.o(.text); - *libc.a:fvwrite.o(.text); - *libc.a:locale.o(.text); - *libc.a:findfp.o(.text); - *libc.a:fflush.o(.text); - *libc.a:wsetup.o(.text); - *libc.a:mbtowc_r.o(.text); - *libc.a:s_isinf.o(.text); - *libc.a:s_isnan.o(.text); - *libc.a:memchr.o(.text); - *libc.a:strlen.o(.text); - *libc.a:dtoa.o(.text); - *libc.a:memmove.o(.text); - *libc.a:stdio.o(.text); - *libc.a:mprec.o(.text); - *libc.a:mallocr.o(.text); - *libc.a:fwalk.o(.text); - *libc.a:freer.o(.text); - *libc.a:makebuf.o(.text); - *libc.a:readr.o(.text); - *libc.a:writer.o(.text); - *libc.a:lseekr.o(.text); - *libc.a:closer.o(.text); - *libc.a:callocr.o(.text); - *libc.a:sbrkr.o(.text); - *libc.a:mlock.o(.text); - *libc.a:fstatr.o(.text); - *libc.a:libcfunc.o(.text); - *libc.a:syscalls.o(.text); - *libc.a:errno.o(.text); - src/libisagbprn.o(.text); + asm/libgcnmultiboot.o(.text*); + asm/m4a_1.o(.text*); + src/m4a.o(.text*); + src/agb_flash.o(.text*); + src/agb_flash_1m.o(.text*); + src/agb_flash_mx.o(.text*); + src/siirtc.o(.text*); + src/librfu_stwi.o(.text*); + src/librfu_intr.o(.text*); + asm/librfu_intr.o(.text*); + src/librfu_rfu.o(.text*); + src/librfu.o(.text*); + asm/librfu.o(.text*); + asm/libagbsyscall.o(.text*); + *libgcc.a:_call_via_rX.o(.text*); + *libgcc.a:_divdi3.o(.text*); + *libgcc.a:_divsi3.o(.text*); + *libgcc.a:_dvmd_tls.o(.text*); + *libgcc.a:_fixunsdfsi.o(.text*); + *libgcc.a:_fixunssfsi.o(.text*); + *libgcc.a:_modsi3.o(.text*); + *libgcc.a:_muldi3.o(.text*); + *libgcc.a:_udivdi3.o(.text*); + *libgcc.a:_udivsi3.o(.text*); + *libgcc.a:_umodsi3.o(.text*); + *libgcc.a:dp-bit.o(.text*); + *libgcc.a:fp-bit.o(.text*); + *libgcc.a:_lshrdi3.o(.text*); + *libgcc.a:_negdi2.o(.text*); + *libc.a:memcpy.o(.text*); + *libc.a:memset.o(.text*); + *libc.a:strcmp.o(.text*); + *libc.a:strcpy.o(.text*); + *libc.a:vfprintf.o(.text*); + *libc.a:vsprintf.o(.text*); + *libc.a:fvwrite.o(.text*); + *libc.a:locale.o(.text*); + *libc.a:findfp.o(.text*); + *libc.a:fflush.o(.text*); + *libc.a:wsetup.o(.text*); + *libc.a:mbtowc_r.o(.text*); + *libc.a:s_isinf.o(.text*); + *libc.a:s_isnan.o(.text*); + *libc.a:memchr.o(.text*); + *libc.a:strlen.o(.text*); + *libc.a:dtoa.o(.text*); + *libc.a:memmove.o(.text*); + *libc.a:stdio.o(.text*); + *libc.a:mprec.o(.text*); + *libc.a:mallocr.o(.text*); + *libc.a:fwalk.o(.text*); + *libc.a:freer.o(.text*); + *libc.a:makebuf.o(.text*); + *libc.a:readr.o(.text*); + *libc.a:writer.o(.text*); + *libc.a:lseekr.o(.text*); + *libc.a:closer.o(.text*); + *libc.a:callocr.o(.text*); + *libc.a:sbrkr.o(.text*); + *libc.a:mlock.o(.text*); + *libc.a:fstatr.o(.text*); + *libc.a:libcfunc.o(.text*); + *libc.a:syscalls.o(.text*); + *libc.a:errno.o(.text*); + src/libisagbprn.o(.text*); } =0 .rodata : @@ -430,7 +429,9 @@ SECTIONS { data/io_reg.o(.rodata); src/string_util.o(.rodata); src/link.o(.rodata); + src/link.o(.rodata.str1.4); src/link_rfu.o(.rodata); + src/link_rfu.o(.rodata.str1.4); src/union_room.o(.rodata); src/mystery_gift.o(.rodata); src/union_room_player_avatar.o(.rodata); @@ -441,14 +442,14 @@ SECTIONS { src/mevent_client.o(.rodata); src/mevent_scripts.o(.rodata); src/union_room_chat.o(.rodata); + src/berry_crush.o(.rodata); data/berry_crush.o(.rodata); data/berry_powder.o(.rodata); src/dodrio_berry_picking.o(.rodata); - data/dodrio_berry_picking.o(.rodata); src/pokemon_jump.o(.rodata); - data/pokemon_jump.o(.rodata); src/rtc.o(.rodata); src/main_menu.o(.rodata); + src/battle_controllers.o(.rodata); src/rom_8034C54.o(.rodata); src/data.o(.rodata); src/battle_bg.o(.rodata); @@ -458,6 +459,7 @@ SECTIONS { src/battle_controller_player.o(.rodata); data/smokescreen.o(.rodata); src/battle_controller_opponent.o(.rodata); + src/battle_ai_switch_items.o(.rodata); src/battle_controller_link_opponent.o(.rodata); src/pokemon.o(.rodata); src/trig.o(.rodata); @@ -480,6 +482,7 @@ SECTIONS { src/event_object_movement.o(.rodata); src/text_window.o(.rodata); src/scrcmd.o(.rodata); + src/field_control_avatar.o(.rodata); src/coord_event_weather.o(.rodata); src/field_tasks.o(.rodata); src/reset_rtc_screen.o(.rodata); @@ -490,6 +493,7 @@ SECTIONS { src/battle_anim.o(.rodata); src/battle_anim_mons.o(.rodata); data/map_events.o(.rodata); + src/reshow_battle_screen.o(.rodata); src/battle_anim_status_effects.o(.rodata); src/title_screen.o(.rodata); src/field_weather.o(.rodata); @@ -500,6 +504,7 @@ SECTIONS { src/trainer_see.o(.rodata); src/wild_encounter.o(.rodata); src/field_effect.o(.rodata); + src/scanline_effect.o(.rodata); src/option_menu.o(.rodata); src/pokedex.o(.rodata); src/trainer_card.o(.rodata); @@ -522,12 +527,14 @@ SECTIONS { src/record_mixing.o(.rodata); src/secret_base.o(.rodata); src/tv.o(.rodata); + src/contest_link_80F57C4.o(.rodata); data/contest_link_80F57C4.o(.rodata); src/script_pokemon_util_80F87D8.o(.rodata); src/pokemon_size_record.o(.rodata) src/fldeff_misc.o(.rodata); src/field_special_scene.o(.rodata); src/rotating_gate.o(.rodata); + src/contest_link_80FC4F4.o(.rodata); src/item_use.o(.rodata); src/battle_anim_effects_1.o(.rodata); src/battle_anim_effects_2.o(.rodata); @@ -556,6 +563,7 @@ SECTIONS { src/menu_helpers.o(.rodata); src/heal_location.o(.rodata); src/region_map.o(.rodata); + src/contest_painting_effects.o(.rodata); data/contest_painting_effects.o(.rodata); src/decoration.o(.rodata); src/slot_machine.o(.rodata); @@ -582,13 +590,13 @@ SECTIONS { src/save.o(.rodata); src/field_effect_helpers.o(.rodata); src/contest_ai.o(.rodata); + src/battle_anim_sound_tasks.o(.rodata); src/battle_controller_safari.o(.rodata); src/battle_anim_effects_3.o(.rodata); src/move_relearner.o(.rodata); src/roamer.o(.rodata); src/battle_tower.o(.rodata); src/use_pokeblock.o(.rodata); - data/use_pokeblock.o(.rodata); src/battle_controller_wally.o(.rodata); src/player_pc.o(.rodata); src/intro.o(.rodata); @@ -624,6 +632,7 @@ SECTIONS { src/battle_arena.o(.rodata); src/battle_factory.o(.rodata); src/battle_pike.o(.rodata); + src/mossdeep_gym.o(.rodata); data/mossdeep_gym.o(.rodata); src/battle_pyramid.o(.rodata); src/item_menu.o(.rodata); @@ -633,6 +642,7 @@ SECTIONS { src/party_menu.o(.rodata); src/battle_tent.o(.rodata); src/unk_text_util_2.o(.rodata); + src/multiboot.o(.rodata); src/unk_81BAD84.o(.rodata); src/battle_controller_player_partner.o(.rodata); src/mirage_tower.o(.rodata); @@ -644,25 +654,33 @@ SECTIONS { src/pokenav_main_menu.o(.rodata); src/pokenav_match_call_ui.o(.rodata); src/pokenav_unk_1.o(.rodata); - data/pokenav.o(.rodata); + src/pokenav_unk_2.o(.rodata); + src/pokenav_unk_3.o(.rodata); + src/pokenav_unk_4.o(.rodata); + src/pokenav_unk_5.o(.rodata); + src/pokenav_unk_7.o(.rodata); + src/pokenav_unk_8.o(.rodata); + src/pokenav_unk_9.o(.rodata); src/pokenav_unk_10.o(.rodata); src/pokenav_match_call_data.o(.rodata); src/menu_specialized.o(.rodata); + src/ereader_helpers.o(.rodata); data/ereader_helpers.o(.rodata); src/faraway_island.o(.rodata); + src/ereader_screen.o(.rodata); data/ereader_screen.o(.rodata); src/trainer_hill.o(.rodata); src/rayquaza_scene.o(.rodata); src/walda_phrase.o(.rodata); src/gym_leader_rematch.o(.rodata); src/unk_transition.o(.rodata); + src/battle_debug.o(.rodata); data/text_input_strings.o(.rodata); data/fonts.o(.rodata); src/mystery_event_msg.o(.rodata); data/mystery_event_msg.o(.rodata); src/m4a_tables.o(.rodata); data/sound_data.o(.rodata); - src/battle_debug.o(.rodata); } =0 song_data : @@ -1203,6 +1221,7 @@ SECTIONS { lib_rodata : SUBALIGN(4) { + src/m4a.o(.rodata); src/agb_flash.o(.rodata); src/agb_flash_1m.o(.rodata); src/agb_flash_mx.o(.rodata); diff --git a/ld_script_modern.txt b/ld_script_modern.txt new file mode 100644 index 000000000..98ef16b17 --- /dev/null +++ b/ld_script_modern.txt @@ -0,0 +1,156 @@ +ENTRY(Start) + +gNumMusicPlayers = 4; +gMaxLines = 0; + +SECTIONS { + . = 0x2000000; + + ewram (NOLOAD) : + ALIGN(4) + { + gHeap = .; + + . = 0x1C000; + + src/*.o(ewram_data); + + . = 0x40000; +} + + . = 0x3000000; + + iwram (NOLOAD) : + ALIGN(4) + { + /* .bss starts at 0x3000000 */ + src/*.o(.bss); + asm/m4a_1.o(.bss); + + /* .bss.code starts at 0x3001AA8 */ + src/m4a.o(.bss.code); + + /* COMMON starts at 0x30022A8 */ + src/*.o(COMMON); + *libc.a:sbrkr.o(COMMON); + end = .; + . = 0x8000; + } + + . = 0x8000000; + + .text : + ALIGN(4) + { + asm/crt0.o(.text); + src/*.o(.text); + asm/*.o(.text); + } =0 + + script_data : + ALIGN(4) + { + data/*.o(script_data); + } =0 + + lib_text : + ALIGN(4) + { + asm/libgcnmultiboot.o(.text); + asm/m4a_1.o(.text); + src/m4a.o(.text); + src/agb_flash.o(.text); + src/agb_flash_1m.o(.text); + src/agb_flash_mx.o(.text); + src/siirtc.o(.text); + src/librfu_stwi.o(.text); + src/librfu_intr.o(.text); + asm/librfu_intr.o(.text); + src/librfu_rfu.o(.text); + asm/librfu.o(.text); + asm/libagbsyscall.o(.text); + *libgcc.a:*.o(.text*); + *libc.a:*.o(.text*); + src/libisagbprn.o(.text); + } =0 + + .rodata : + ALIGN(4) + { + src/*.o(.rodata*); + data/*.o(.rodata*); + } =0 + + song_data : + ALIGN(4) + { + sound/songs/*.o(.rodata); + } =0 + + lib_rodata : + SUBALIGN(4) + { + src/m4a.o(.rodata); + src/agb_flash.o(.rodata); + src/agb_flash_1m.o(.rodata); + src/agb_flash_mx.o(.rodata); + src/agb_flash_le.o(.rodata); + src/siirtc.o(.rodata); + data/librfu_rodata.o(.rodata); + *libgcc.a:*.o(.rodata*); + *libc.a:*.o(.rodata*); + *libc.a:*.o(.data*); + src/libisagbprn.o(.rodata); + } =0 + + other_data : + ALIGN(4) + { + data/unknown_serial_data.o(.rodata); + data/multiboot_berry_glitch_fix.o(.rodata); + data/multiboot_pokemon_colosseum.o(.rodata); + } =0 + + anim_mon_front_pic_data : + ALIGN(4) + { + src/anim_mon_front_pics.o(.rodata); + } =0 + + gfx_data : + ALIGN(4) + { + src/graphics.o(.rodata); + } =0 + + /* DWARF debug sections. + Symbols in the DWARF debugging sections are relative to the beginning + of the section so we begin them at 0. */ + + /* DWARF 1 */ + .debug 0 : { *(.debug) } + .line 0 : { *(.line) } + + /* GNU DWARF 1 extensions */ + .debug_srcinfo 0 : { *(.debug_srcinfo) } + .debug_sfnames 0 : { *(.debug_sfnames) } + + /* DWARF 1.1 and DWARF 2 */ + .debug_aranges 0 : { *(.debug_aranges) } + .debug_pubnames 0 : { *(.debug_pubnames) } + + /* DWARF 2 */ + .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + + /* Discard everything not specifically mentioned above. */ + /DISCARD/ : + { + *(*); + } +} diff --git a/src/battle_anim_effects_1.c b/src/battle_anim_effects_1.c index 7b0cc45c5..421f49de1 100644 --- a/src/battle_anim_effects_1.c +++ b/src/battle_anim_effects_1.c @@ -6338,21 +6338,19 @@ static void sub_8102D8C(s16 a, s16 b, s16* c, s16* d, s8 e) static void sub_8102DE4(struct Sprite* sprite) { - int b; - s16 a; - int c; + s16 y, yDelta; u8 index; + sprite->data[0]++; - b = sprite->data[0] * 5 - ((sprite->data[0] * 5 / 256) << 8); + yDelta = sprite->data[0] * 5 - ((sprite->data[0] * 5 / 256) << 8); sprite->data[4] += sprite->data[6]; sprite->data[5] += sprite->data[7]; sprite->pos1.x = sprite->data[4] >> 4; sprite->pos1.y = sprite->data[5] >> 4; - sprite->pos2.y = Sin(b, 15); - a = (u16)sprite->pos1.y; - c = (u16)sprite->pos1.x; + sprite->pos2.y = Sin(yDelta, 15); - if ((u32)((c + 16) << 16) > (0x110) << 16 || a < -16 || a > 0x80) + y = sprite->pos1.y; + if (sprite->pos1.x < -16 || sprite->pos1.x > 256 || y < -16 || y > 128) { DestroySpriteAndMatrix(sprite); } @@ -6373,12 +6371,8 @@ static void sub_8102DE4(struct Sprite* sprite) void sub_8102EB0(struct Sprite* sprite) { - int a; if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT) - { - a = gBattleAnimArgs[1]; - (u16)gBattleAnimArgs[1] = -a; - } + gBattleAnimArgs[1] *= -1; sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2) + gBattleAnimArgs[1]; sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3) + gBattleAnimArgs[2]; @@ -6564,8 +6558,8 @@ static void sub_8103300(struct Sprite* sprite) static void sub_8103320(struct Sprite* sprite) { - s16 temp; - s16 temp2; + s16 x1, x2; + sprite->data[1] += 4; if (sprite->data[1] > 254) { @@ -6587,20 +6581,21 @@ static void sub_8103320(struct Sprite* sprite) if (sprite->data[1] > 0x9F) sprite->subpriority = sprite->data[2]; - temp = gSineTable[sprite->data[1]]; - sprite->pos2.x = (temp2 = temp >> 3) + (temp2 >> 1); + x1 = gSineTable[sprite->data[1]]; + x2 = x1 >> 3; + sprite->pos2.x = (x1 >> 3) + (x2 >> 1); } void sub_8103390(struct Sprite* sprite) { - u8 bank; + u8 battler; if (gBattleAnimArgs[0] == 0) - bank = gBattleAnimAttacker; + battler = gBattleAnimAttacker; else - bank = gBattleAnimTarget; + battler = gBattleAnimTarget; - sub_810310C(bank, sprite); - if (GetBattlerSide(bank) == B_SIDE_PLAYER) + sub_810310C(battler, sprite); + if (GetBattlerSide(battler) == B_SIDE_PLAYER) { StartSpriteAnim(sprite, 0); sprite->data[0] = 2; diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 4e21be72c..21902855f 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -2548,13 +2548,10 @@ void sub_815BE04(struct Sprite *sprite) static void sub_815BF44(struct Sprite *sprite) { - int var0; - s8 var1; - - var0 = (u16)sprite->data[2] + (u16)sprite->data[3]; - var1 = var0 >> 8; - sprite->pos2.y -= var1; - sprite->data[3] = var0 & 0xFF; + s16 delta = sprite->data[3] + sprite->data[2]; + sprite->pos2.y -= delta >> 8; + sprite->data[3] += sprite->data[2]; + sprite->data[3] &= 0xFF; if (sprite->data[4] == 0 && sprite->pos2.y < -8) { gSprites[sprite->data[6]].invisible = 0; @@ -2587,19 +2584,12 @@ static void sub_815BFF4(struct Sprite *sprite) static void sub_815C050(struct Sprite *sprite) { - u16 d2; - register u16 d3 asm("r1"); - int var0; - s8 var1; - if (!sprite->invisible) { - d2 = sprite->data[2]; - d3 = sprite->data[3]; - var0 = d2 + d3; - var1 = var0 >> 8; - sprite->pos2.y -= var1; - sprite->data[3] = var0 & 0xFF; + s16 delta = sprite->data[3] + sprite->data[2]; + sprite->pos2.y -= delta >> 8; + sprite->data[3] += sprite->data[2]; + sprite->data[3] &= 0xFF; if (--sprite->data[1] == -1) { sprite->invisible = 1; diff --git a/src/battle_anim_mons.c b/src/battle_anim_mons.c index c6058204d..a667daecf 100644 --- a/src/battle_anim_mons.c +++ b/src/battle_anim_mons.c @@ -2037,7 +2037,7 @@ u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority gMonSpritesGfxPtr->field_17C = AllocZeroed(0x2000); if (!isBackpic) { - LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20); + LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20); if (a10 == 1 || sub_80688F8(5, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != 0) LoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->field_17C, @@ -2053,7 +2053,7 @@ u8 sub_80A8394(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority } else { - LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20); + LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), (palette * 0x10) + 0x100, 0x20); if (a10 == 1 || sub_80688F8(5, battlerId) == 1 || gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies != 0) LoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], gMonSpritesGfxPtr->field_17C, diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 55e9df9d2..859cccddf 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -830,15 +830,11 @@ static void Task_HandleSendLinkBuffersData(u8 taskId) } } -// fix me void sub_8033648(void) { u8 i; s32 j; - u16 r6; u8 *recvBuffer; - u8 *dest; - u8 *src; if (gReceivedRemoteLinkPlayers != 0 && (gBattleTypeFlags & BATTLE_TYPE_20)) { @@ -849,25 +845,24 @@ void sub_8033648(void) { ResetBlockReceivedFlag(i); recvBuffer = (u8 *)gBlockRecvBuffer[i]; - #ifndef NONMATCHING - asm(""); - recvBuffer = (u8 *)&gBlockRecvBuffer[i]; - #endif - r6 = gBlockRecvBuffer[i][2]; - - if (gTasks[sLinkReceiveTaskId].data[14] + 9 + r6 > 0x1000) { - gTasks[sLinkReceiveTaskId].data[12] = gTasks[sLinkReceiveTaskId].data[14]; - gTasks[sLinkReceiveTaskId].data[14] = 0; + u8 *dest, *src; + u16 r6 = gBlockRecvBuffer[i][2]; + + if (gTasks[sLinkReceiveTaskId].data[14] + 9 + r6 > 0x1000) + { + gTasks[sLinkReceiveTaskId].data[12] = gTasks[sLinkReceiveTaskId].data[14]; + gTasks[sLinkReceiveTaskId].data[14] = 0; + } + + dest = &gLinkBattleRecvBuffer[gTasks[sLinkReceiveTaskId].data[14]]; + src = recvBuffer; + + for (j = 0; j < r6 + 8; j++) + dest[j] = src[j]; + + gTasks[sLinkReceiveTaskId].data[14] = gTasks[sLinkReceiveTaskId].data[14] + r6 + 8; } - - dest = &gLinkBattleRecvBuffer[gTasks[sLinkReceiveTaskId].data[14]]; - src = recvBuffer; - - for (j = 0; j < r6 + 8; j++) - dest[j] = src[j]; - - gTasks[sLinkReceiveTaskId].data[14] = gTasks[sLinkReceiveTaskId].data[14] + r6 + 8; } } } diff --git a/src/battle_dome.c b/src/battle_dome.c index 9f9bc0174..2cb300ec6 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -1024,13 +1024,13 @@ static const union AnimCmd gUnknown_0860D020[] = static const union AnimCmd gUnknown_0860D028[] = { - ANIMCMD_FRAME(18, 129, .vFlip = TRUE), + ANIMCMD_FRAME(18, 1, .vFlip = TRUE), ANIMCMD_END, }; static const union AnimCmd gUnknown_0860D030[] = { - ANIMCMD_FRAME(16, 65, .hFlip = TRUE), + ANIMCMD_FRAME(16, 1, .hFlip = TRUE), ANIMCMD_END, }; diff --git a/src/battle_factory.c b/src/battle_factory.c index 1a150db1e..6c249bccc 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -16,7 +16,7 @@ #include "constants/moves.h" // IWRAM bss -static IWRAM_DATA bool8 sPerformedRentalSwap; +static bool8 sPerformedRentalSwap; // This file's functions. static void InitFactoryChallenge(void); diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 280b65dc8..f56442432 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -227,9 +227,9 @@ static EWRAM_DATA u8 *sSwapMenuTilemapBuffer = NULL; static EWRAM_DATA u8 *sSwapMonCardBgTilemapBuffer = NULL; // IWRAM bss -static IWRAM_DATA struct FactorySelectMonsStruct *sFactorySelectScreen; -static IWRAM_DATA void (*sSwap_CurrentTableFunc)(u8 taskId); -static IWRAM_DATA struct FactorySwapMonsStruct *sFactorySwapScreen; +static struct FactorySelectMonsStruct *sFactorySelectScreen; +static void (*sSwap_CurrentTableFunc)(u8 taskId); +static struct FactorySwapMonsStruct *sFactorySwapScreen; // IWRAM common u8 (*gUnknown_030062E8)(void); diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 5cb15671d..e690c3ced 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -552,7 +552,7 @@ static void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battlerId, bool32 op if (gBattleSpritesDataPtr->battlerData[battlerId].transformSpecies == SPECIES_NONE) lzPaletteData = GetMonFrontSpritePal(mon); else - lzPaletteData = GetFrontSpritePalFromSpeciesAndPersonality(species, otId, monsPersonality); + lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(species, otId, monsPersonality); LZDecompressWram(lzPaletteData, gDecompressionBuffer); LoadPalette(gDecompressionBuffer, paletteOffset, 0x20); @@ -873,7 +873,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform dst = (void *)(VRAM + 0x10000 + gSprites[gBattlerSpriteIds[battlerAtk]].oam.tileNum * 32); DmaCopy32(3, src, dst, 0x800); paletteOffset = 0x100 + battlerAtk * 16; - lzPaletteData = GetFrontSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); + lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); LZDecompressWram(lzPaletteData, gDecompressionBuffer); LoadPalette(gDecompressionBuffer, paletteOffset, 32); @@ -903,10 +903,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite) { - u8 position; - s32 i; - u32 var; - const void *substitutePal; + s32 i, position, palOffset; if (!loadMonSprite) { @@ -922,19 +919,16 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite) else LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[position]); - i = 1; - var = battlerId * 16; - substitutePal = gSubstituteDollPal; - for (; i < 4; i++) + for (i = 1; i < 4; i++) { - register void *dmaSrc asm("r0") = gMonSpritesGfxPtr->sprites[position]; - void *dmaDst = (i * 0x800) + dmaSrc; - u32 dmaSize = 0x800; - DmaCopy32(3, dmaSrc, dmaDst, dmaSize); - i++;i--; + u8 (*ptr)[4][0x800] = gMonSpritesGfxPtr->sprites[position]; + ptr++;ptr--; // Needed to match. + + DmaCopy32Defvars(3, (*ptr)[0], (*ptr)[i], 0x800); } - LoadCompressedPalette(substitutePal, 0x100 + var, 32); + palOffset = (battlerId * 16) + 0x100; + LoadCompressedPalette(gSubstituteDollPal, palOffset, 32); } else { diff --git a/src/battle_main.c b/src/battle_main.c index 1569f3a3a..969ae5d8c 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -73,6 +73,9 @@ extern const u8 *const gBattlescriptsForUsingItem[]; extern const u8 *const gBattlescriptsForSafariActions[]; // this file's functions +#if !defined(NONMATCHING) && MODERN +#define static +#endif static void CB2_InitBattleInternal(void); static void CB2_PreInitMultiBattle(void); static void CB2_PreInitIngamePlayerPartnerBattle(void); diff --git a/src/battle_pike.c b/src/battle_pike.c index 7fdb0a07c..8846e2d1a 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -53,11 +53,11 @@ struct PikeWildMon }; // IWRAM bss -static IWRAM_DATA u8 sRoomType; -static IWRAM_DATA u8 sStatusMon; -static IWRAM_DATA bool8 sUnknown_0300128E; -static IWRAM_DATA u32 sStatusFlags; -static IWRAM_DATA u8 sNpcId; +static u8 sRoomType; +static u8 sStatusMon; +static bool8 sUnknown_0300128E; +static u32 sStatusFlags; +static u8 sNpcId; // This file's functions. static void SetRoomType(void); diff --git a/src/battle_tent.c b/src/battle_tent.c index 85194417f..34e3e9628 100644 --- a/src/battle_tent.c +++ b/src/battle_tent.c @@ -44,7 +44,7 @@ static void sub_81BA040(void); static void sub_81B9EC0(void); // IWRAM bss -static IWRAM_DATA u16 sRandMonSetId; +static u16 sRandMonSetId; // const rom data void static (*const gUnknown_086160B4[])(void) = diff --git a/src/battle_transition.c b/src/battle_transition.c index 7edb1bd93..3e86fcf51 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -262,10 +262,10 @@ static bool8 sub_814842C(struct Sprite *sprite); static bool8 sub_8148458(struct Sprite *sprite); // iwram bss vars -IWRAM_DATA static s16 sUnusedRectangularSpiralVar; -IWRAM_DATA static u8 sTestingTransitionId; -IWRAM_DATA static u8 sTestingTransitionState; -IWRAM_DATA static struct StructRectangularSpiral sRectangularSpiralTransition[4]; +static s16 sUnusedRectangularSpiralVar; +static u8 sTestingTransitionId; +static u8 sTestingTransitionState; +static struct StructRectangularSpiral sRectangularSpiralTransition[4]; // ewram vars EWRAM_DATA static struct TransitionData *sTransitionStructPtr = NULL; diff --git a/src/berry_blender.c b/src/berry_blender.c index d6a7879f4..03764b2f8 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -194,10 +194,10 @@ EWRAM_DATA static s32 sUnknown_020322BC[5] = {0}; EWRAM_DATA static u32 sUnknown_020322D0 = 0; // IWRAM bss -IWRAM_DATA static s16 sUnknown_03000DE8[8]; -IWRAM_DATA static s16 sUnknown_03000DF8[6]; -IWRAM_DATA static s16 sUnknown_03000E04; -IWRAM_DATA static s16 sUnknown_03000E06; +static s16 sUnknown_03000DE8[8]; +static s16 sUnknown_03000DF8[6]; +static s16 sUnknown_03000E04; +static s16 sUnknown_03000E06; // IWRAM common u8 gInGameOpponentsNo; diff --git a/src/bg.c b/src/bg.c index 1826f9a28..1678f4023 100644 --- a/src/bg.c +++ b/src/bg.c @@ -37,9 +37,9 @@ struct BgConfig2 s32 bg_y; }; -static IWRAM_DATA struct BgControl sGpuBgConfigs; -static IWRAM_DATA struct BgConfig2 sGpuBgConfigs2[4]; -static IWRAM_DATA u32 sDmaBusyBitfield[4]; +static struct BgControl sGpuBgConfigs; +static struct BgConfig2 sGpuBgConfigs2[4]; +static u32 sDmaBusyBitfield[4]; u32 gUnneededFireRedVariable; @@ -220,7 +220,7 @@ static void ShowBgInternal(u8 bg) (sGpuBgConfigs.configs[bg].wraparound << 13) | (sGpuBgConfigs.configs[bg].screenSize << 14); - SetGpuReg((bg << 1) + 0x8, value); + SetGpuReg((bg << 1) + REG_OFFSET_BG0CNT, value); sGpuBgConfigs.bgVisibilityAndMode |= 1 << (bg + 8); sGpuBgConfigs.bgVisibilityAndMode &= DISPCNT_ALL_BG_AND_MODE_BITS; @@ -914,7 +914,6 @@ void CopyBgTilemapBufferToVram(u8 bg) void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 width, u8 height) { - const void *srcCopy; u16 destX16; u16 destY16; u16 mode; @@ -924,27 +923,31 @@ void CopyToBgTilemapBufferRect(u8 bg, const void* src, u8 destX, u8 destY, u8 wi switch (GetBgType(bg)) { case 0: - srcCopy = src; + { + const u16 * srcCopy = src; for (destY16 = destY; destY16 < (destY + height); destY16++) { for (destX16 = destX; destX16 < (destX + width); destX16++) { - ((u16*)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *((u16*)srcCopy)++; + ((u16*)sGpuBgConfigs2[bg].tilemap)[((destY16 * 0x20) + destX16)] = *srcCopy++; } } break; + } case 1: - srcCopy = src; + { + const u8 * srcCopy = src; mode = GetBgMetricAffineMode(bg, 0x1); for (destY16 = destY; destY16 < (destY + height); destY16++) { for (destX16 = destX; destX16 < (destX + width); destX16++) { - ((u8*)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *((u8*)srcCopy)++; + ((u8*)sGpuBgConfigs2[bg].tilemap)[((destY16 * mode) + destX16)] = *srcCopy++; } } break; } + } } } diff --git a/src/cable_car.c b/src/cable_car.c index d44c9a241..adeee2647 100644 --- a/src/cable_car.c +++ b/src/cable_car.c @@ -245,7 +245,7 @@ static void CableCarMainCallback_Setup(void) { u16 imebak; u8 i = 0; - int sizeOut = 0; + u32 sizeOut = 0; switch (gMain.state) { diff --git a/src/contest.c b/src/contest.c index eb3252f72..662a27060 100644 --- a/src/contest.c +++ b/src/contest.c @@ -269,8 +269,6 @@ extern const u8 gText_Contest_Fear[]; extern const u8 gText_BDot[]; extern const u8 gText_CDot[]; extern const u8 *const gUnknown_08587E10[]; -extern const struct SpriteTemplate gSpriteTemplate_8587AD0; -extern const struct SpriteTemplate gSpriteTemplate_8587B18[]; extern void (*const gContestEffectFuncs[])(void); static const u8 gUnknown_08587A6C[] = @@ -1268,7 +1266,7 @@ static void sub_80D8108(u8 taskId) gTasks[taskId].data[0]++; break; case 1: - (s16)gBattle_BG1_Y += 7; + *(s16*)&gBattle_BG1_Y += 7; if ((s16)gBattle_BG1_Y <= 160) break; gTasks[taskId].data[0]++; @@ -2975,7 +2973,7 @@ static u8 sub_80DB174(u16 species, u32 otId, u32 personality, u32 index) else HandleLoadSpecialPokePic_DontHandleDeoxys(gMonBackPicTable + species, gMonSpritesGfxPtr->sprites[0], species, personality); - LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x120, 0x20); + LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x120, 0x20); SetMultiuseSpriteTemplateToPokemon(species, 0); spriteId = CreateSprite(&gMultiuseSpriteTemplate, 0x70, GetBattlerSpriteFinal_Y(2, species, FALSE), 30); diff --git a/src/contest_link_80F57C4.c b/src/contest_link_80F57C4.c index bae7859b5..a0a29f0ad 100644 --- a/src/contest_link_80F57C4.c +++ b/src/contest_link_80F57C4.c @@ -71,15 +71,10 @@ struct ContestLinkUnk14 u8 unk12; }; -struct ContestLinkUnk4 -{ - struct ContestLinkUnk14 unk0[4]; -}; - struct ContestLink80F57C4 { struct ContestLinkUnk0 *unk0; - struct ContestLinkUnk4 *unk4; + struct ContestLinkUnk14 (*unk4)[4]; u8 *unk8; u8 *unkC[4]; u8 *unk1C; @@ -205,9 +200,7 @@ void sub_80F57C4(void) void sub_80F591C(void) { int i, j; - s8 var0; - s8 var1; - int var2; + s8 var0, var1; u16 tile1, tile2; LZDecompressVram(gUnknown_08C19588, (void *)BG_CHAR_ADDR(0)); @@ -228,11 +221,7 @@ void sub_80F591C(void) if (j < var0) tile1 += 2; - var2 = var1; - if (var1 < 0) - var2 = -var2; - - if (j < var2) + if (j < abs(var1)) { tile2 = 0x60A4; if (var1 < 0) @@ -719,7 +708,7 @@ static void sub_80F6404(u8 taskId) if (top > 80) top = 80; - gBattle_WIN0V = (top << 8) | (160 - top);; + gBattle_WIN0V = (top << 8) | (160 - top); if (top == 80) gTasks[taskId].data[0]++; } @@ -737,8 +726,7 @@ static void sub_80F6404(u8 taskId) static void sub_80F66B4(u8 taskId) { - int i; - u16 nationalDexNum; + int i, nationalDexNum; if (gMain.newKeys & A_BUTTON) { @@ -859,13 +847,13 @@ static void sub_80F68F0(u8 taskId) void sub_80F69B8(u16 species, u8 monIndex, u8 srcOffset, u8 useDmaNow, u32 personality) { - u8 frameNum; const u8 *iconPtr; - u16 var0; - u16 var1; + u16 var0, var1, frameNum; - u8 *contestPlayerMonIndex = &gContestPlayerMonIndex; // fake match - frameNum = (monIndex == *contestPlayerMonIndex) ? 1 : 0; + if (monIndex == gContestPlayerMonIndex) + frameNum = 1; + else + frameNum = 0; iconPtr = GetMonIconPtr(species, personality, frameNum); iconPtr += srcOffset * 0x200 + 0x80; @@ -892,13 +880,12 @@ static void LoadAllContestMonIcons(u8 srcOffset, u8 useDmaNow) static void sub_80F6A9C(void) { - int i; - register u16 species asm("r0"); + int i, species; for (i = 0; i < 4; i++) { - species = GetIconSpecies(gContestMons[i].species, 0); - LoadPalette(gMonIconPalettes[gMonIconPaletteIndices[species]], i * 0x10 + 0xA0, 0x20); + species = gContestMons[i].species; + LoadPalette(gMonIconPalettes[gMonIconPaletteIndices[GetIconSpecies(species, 0)]], i * 0x10 + 0xA0, 0x20); } } @@ -1335,11 +1322,11 @@ static void sub_80F6F40(struct Sprite *sprite) static void sub_80F6F68(struct Sprite *sprite) { int i; - s16 var0; - var0 = (u16)sprite->data[7] + (u16)sprite->data[6]; - sprite->pos1.x -= var0 >> 8; - sprite->data[7] = (sprite->data[6] + sprite->data[7]) & 0xFF; + s16 delta = sprite->data[7] + sprite->data[6]; + sprite->pos1.x -= delta >> 8; + sprite->data[7] += sprite->data[6]; + sprite->data[7] &= 0xFF; if (sprite->pos1.x < sprite->data[4]) sprite->pos1.x = sprite->data[4]; @@ -1366,11 +1353,12 @@ static void sub_80F6FDC(struct Sprite *sprite) static void sub_80F7014(struct Sprite *sprite) { int i; - s16 var0; + s16 delta; - var0 = (u16)sprite->data[7] + (u16)sprite->data[6]; - sprite->pos1.x -= var0 >> 8; - sprite->data[7] = (sprite->data[6] + sprite->data[7]) & 0xFF; + delta = sprite->data[7] + sprite->data[6]; + sprite->pos1.x -= delta >> 8; + sprite->data[7] += sprite->data[6]; + sprite->data[7] &= 0xFF; for (i = 0; i < 3; i++) { struct Sprite *sprite2 = &gSprites[sprite->data[i]]; @@ -1487,14 +1475,11 @@ static void sub_80F71C8(void) CopyToBgTilemapBufferRect_ChangePalette(2, gUnknown_0203A034->unkC[2], 0, 0, 32, 4, palette); } -// fakematching? u8 sub_80F7310(u8 monIndex, u8 arg1) { - u32 var0; - u32 var1; + u32 var0 = gContestMonConditions[monIndex] << 16; + u32 var1 = var0 / 0x3F; - var0 = gContestMonConditions[monIndex] << 16; - var1 = var0 / 0x3F; if (var1 & 0xFFFF) var1 += 0x10000; @@ -1510,8 +1495,7 @@ u8 sub_80F7310(u8 monIndex, u8 arg1) s8 sub_80F7364(u8 arg0, u8 arg1) { - u32 r4; - u32 r2; + u32 r4, r2; s16 val; s8 ret; @@ -1607,9 +1591,10 @@ static void sub_80F75A8(struct Sprite *sprite) } else { - s16 delta = (u16)sprite->data[1] + 0x600; + s16 delta = sprite->data[1] + 0x600; sprite->pos1.x -= delta >> 8; - sprite->data[1] = (sprite->data[1] + 0x600) & 0xFF; + sprite->data[1] += 0x600; + sprite->data[1] &= 0xFF; if (sprite->pos1.x < 120) sprite->pos1.x = 120; @@ -1624,9 +1609,10 @@ static void sub_80F75A8(struct Sprite *sprite) static void sub_80F7620(struct Sprite *sprite) { - s16 delta = (u16)sprite->data[1] + 0x600; + s16 delta = sprite->data[1] + 0x600; sprite->pos1.x -= delta >> 8; - sprite->data[1] = (sprite->data[1] + 0x600) & 0xFF; + sprite->data[1] += + 0x600; + sprite->data[1] &= 0xFF; if (sprite->pos1.x < -32) { sprite->callback = SpriteCallbackDummy; @@ -1657,14 +1643,15 @@ static void sub_80F7670(u8 taskId) void sub_80F7768(struct Sprite *sprite) { - register s16 var0 asm("r1"); + s16 delta; sprite->data[3] += sprite->data[0]; sprite->pos2.x = Sin(sprite->data[3] >> 8, sprite->data[1]); - var0 = sprite->data[4] + sprite->data[2]; - sprite->pos1.x += var0 >> 8; - var0 = var0 & 0xFF; - sprite->data[4] = var0; + delta = sprite->data[4] + sprite->data[2]; + sprite->pos1.x += delta >> 8; + sprite->data[4] += sprite->data[2]; + sprite->data[4] &= 0xff; + sprite->pos1.y++; if (gUnknown_0203A034->unk0->unk9) sprite->invisible = 1; @@ -1695,705 +1682,145 @@ static void sub_80F7824(u8 taskId) } } -// static void sub_80F7880(void) -// { -// int i; -// int var0; -// int var1; -// int var2; -// int var3; -// u32 var4; -// int var5; -// int var6; -// s16 var7; -// s16 var8; -// s16 r2; - -// r2 = gUnknown_02039F08[0]; -// for (i = 1; i < 4; i++) -// { -// if (r2 < gUnknown_02039F08[i]) -// r2 = gUnknown_02039F08[i]; -// } - -// if (r2 < 0) -// { -// r2 = gUnknown_02039F08[0]; -// for (i = 1; i < 4; i++) -// { -// if (r2 > gUnknown_02039F08[i]) -// r2 = gUnknown_02039F08[i]; -// } -// } - -// // _080F78E4 -// for (i = 0; i < 4; i++) -// { -// var0 = gContestMonConditions[i] * 1000; -// var1 = r2; -// if (r2 < 0) -// var1 = -var1; - -// var2 = var0 / var1; -// if (var2 % 10 > 4) -// var2 += 10; - -// gUnknown_0203A034->unk4->unk0[i].unk0 = var2 / 10; -// var3 = gUnknown_02039F18[i]; -// if (var3 < 0) -// var3 = -var3; - -// var0 = var3 * 1000; -// var1 = r2; -// if (r2 < 0) -// var1 = -var1; - -// var2 = var0 / var1; -// if (var2 % 10 > 4) -// var2 += 10; - -// // _080F7966 -// gUnknown_0203A034->unk4->unk0[i].unk4 = var2 / 10; -// if (gUnknown_02039F18[i] < 0) -// gUnknown_0203A034->unk4->unk0[i].unk10 = 1; - -// var4 = gUnknown_0203A034->unk4->unk0[i].unk0 * 22528 / 100; -// if ((var4 & 0xFF) > 0x7F) -// var4 += 0x100; - -// gUnknown_0203A034->unk4->unk0[i].unk8 = var4 >> 8; -// var4 = gUnknown_0203A034->unk4->unk0[i].unk4 * 22528 / 100; -// if ((var4 & 0xFF) > 0x7F) -// var4 += 0x100; - -// gUnknown_0203A034->unk4->unk0[i].unkC = var4 >> 8; -// gUnknown_0203A034->unk4->unk0[i].unk11 = sub_80F7310(i, 1); -// var5 = sub_80F7364(i, 1); -// if (var5 < 0) -// var5 = -var5; - -// gUnknown_0203A034->unk4->unk0[i].unk12 = var5; -// if (gContestFinalStandings[i]) -// { -// var7 = gUnknown_0203A034->unk4->unk0[i].unk8; -// var8 = gUnknown_0203A034->unk4->unk0[i].unkC; -// if (gUnknown_0203A034->unk4->unk0[i].unk10) -// var8 = -var8; - -// if (var7 + var8 == 88) -// { -// if (var8 > 0) -// gUnknown_0203A034->unk4->unk0[i].unkC--; -// else if (var7 > 0) -// gUnknown_0203A034->unk4->unk0[i].unk8--; -// } -// } -// } -// } - -NAKED static void sub_80F7880(void) { - asm_unified("\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0x4\n\ - ldr r0, =gUnknown_02039F08\n\ - ldrh r2, [r0]\n\ - adds r4, r0, 0\n\ - adds r3, r4, 0x2\n\ - movs r0, 0x2\n\ - mov r8, r0\n\ -_080F7898:\n\ - lsls r0, r2, 16\n\ - asrs r0, 16\n\ - movs r5, 0\n\ - ldrsh r1, [r3, r5]\n\ - cmp r0, r1\n\ - bge _080F78A6\n\ - ldrh r2, [r3]\n\ -_080F78A6:\n\ - adds r3, 0x2\n\ - movs r0, 0x1\n\ - negs r0, r0\n\ - add r8, r0\n\ - mov r1, r8\n\ - cmp r1, 0\n\ - bge _080F7898\n\ - lsls r0, r2, 16\n\ - str r0, [sp]\n\ - cmp r0, 0\n\ - bge _080F78E4\n\ - ldrh r2, [r4]\n\ - adds r3, r4, 0x2\n\ - movs r4, 0x2\n\ - mov r8, r4\n\ -_080F78C4:\n\ - lsls r0, r2, 16\n\ - asrs r0, 16\n\ - movs r5, 0\n\ - ldrsh r1, [r3, r5]\n\ - cmp r0, r1\n\ - ble _080F78D2\n\ - ldrh r2, [r3]\n\ -_080F78D2:\n\ - adds r3, 0x2\n\ - movs r0, 0x1\n\ - negs r0, r0\n\ - add r8, r0\n\ - lsls r1, r2, 16\n\ - str r1, [sp]\n\ - mov r4, r8\n\ - cmp r4, 0\n\ - bge _080F78C4\n\ -_080F78E4:\n\ - movs r5, 0\n\ - mov r8, r5\n\ - mov r10, r5\n\ -_080F78EA:\n\ - ldr r0, =gContestMonConditions\n\ - mov r1, r8\n\ - lsls r7, r1, 1\n\ - adds r0, r7, r0\n\ - movs r2, 0\n\ - ldrsh r1, [r0, r2]\n\ - lsls r0, r1, 5\n\ - subs r0, r1\n\ - lsls r0, 2\n\ - adds r0, r1\n\ - lsls r0, 3\n\ - ldr r4, [sp]\n\ - asrs r5, r4, 16\n\ - adds r1, r5, 0\n\ - cmp r5, 0\n\ - bge _080F790C\n\ - negs r1, r5\n\ -_080F790C:\n\ - bl __divsi3\n\ - adds r4, r0, 0\n\ - movs r1, 0xA\n\ - bl __modsi3\n\ - cmp r0, 0x4\n\ - ble _080F791E\n\ - adds r4, 0xA\n\ -_080F791E:\n\ - ldr r0, =gUnknown_0203A034\n\ - mov r9, r0\n\ - ldr r0, [r0]\n\ - ldr r0, [r0, 0x4]\n\ - mov r1, r10\n\ - adds r6, r1, r0\n\ - adds r0, r4, 0\n\ - movs r1, 0xA\n\ - bl __divsi3\n\ - str r0, [r6]\n\ - ldr r0, =gUnknown_02039F18\n\ - adds r7, r0\n\ - movs r2, 0\n\ - ldrsh r1, [r7, r2]\n\ - cmp r1, 0\n\ - bge _080F7942\n\ - negs r1, r1\n\ -_080F7942:\n\ - lsls r0, r1, 5\n\ - subs r0, r1\n\ - lsls r0, 2\n\ - adds r0, r1\n\ - lsls r0, 3\n\ - adds r1, r5, 0\n\ - cmp r1, 0\n\ - bge _080F7954\n\ - negs r1, r1\n\ -_080F7954:\n\ - bl __divsi3\n\ - adds r4, r0, 0\n\ - movs r1, 0xA\n\ - bl __modsi3\n\ - cmp r0, 0x4\n\ - ble _080F7966\n\ - adds r4, 0xA\n\ -_080F7966:\n\ - adds r0, r4, 0\n\ - movs r1, 0xA\n\ - bl __divsi3\n\ - str r0, [r6, 0x4]\n\ - movs r4, 0\n\ - ldrsh r0, [r7, r4]\n\ - cmp r0, 0\n\ - bge _080F797C\n\ - movs r0, 0x1\n\ - strb r0, [r6, 0x10]\n\ -_080F797C:\n\ - mov r5, r9\n\ - ldr r0, [r5]\n\ - ldr r0, [r0, 0x4]\n\ - mov r1, r10\n\ - adds r4, r1, r0\n\ - ldr r1, [r4]\n\ - lsls r0, r1, 1\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - subs r0, r1\n\ - lsls r0, 11\n\ - movs r1, 0x64\n\ - bl __divsi3\n\ - adds r1, r0, 0\n\ - movs r5, 0xFF\n\ - ands r0, r5\n\ - cmp r0, 0x7F\n\ - bls _080F79A8\n\ - movs r2, 0x80\n\ - lsls r2, 1\n\ - adds r1, r2\n\ -_080F79A8:\n\ - lsrs r0, r1, 8\n\ - str r0, [r4, 0x8]\n\ - ldr r1, [r4, 0x4]\n\ - lsls r0, r1, 1\n\ - adds r0, r1\n\ - lsls r0, 2\n\ - subs r0, r1\n\ - lsls r0, 11\n\ - movs r1, 0x64\n\ - bl __divsi3\n\ - adds r1, r0, 0\n\ - ands r0, r5\n\ - cmp r0, 0x7F\n\ - bls _080F79CC\n\ - movs r5, 0x80\n\ - lsls r5, 1\n\ - adds r1, r5\n\ -_080F79CC:\n\ - lsrs r0, r1, 8\n\ - str r0, [r4, 0xC]\n\ - mov r0, r8\n\ - lsls r4, r0, 24\n\ - lsrs r4, 24\n\ - adds r0, r4, 0\n\ - movs r1, 0x1\n\ - bl sub_80F7310\n\ - mov r2, r9\n\ - ldr r1, [r2]\n\ - ldr r1, [r1, 0x4]\n\ - add r1, r10\n\ - strb r0, [r1, 0x11]\n\ - adds r0, r4, 0\n\ - movs r1, 0x1\n\ - bl sub_80F7364\n\ - mov r4, r9\n\ - ldr r1, [r4]\n\ - ldr r1, [r1, 0x4]\n\ - add r1, r10\n\ - lsls r0, 24\n\ - asrs r0, 24\n\ - cmp r0, 0\n\ - bge _080F7A02\n\ - negs r0, r0\n\ -_080F7A02:\n\ - strb r0, [r1, 0x12]\n\ - ldr r0, =gContestFinalStandings\n\ - add r0, r8\n\ - ldrb r0, [r0]\n\ - cmp r0, 0\n\ - beq _080F7A60\n\ - mov r5, r9\n\ - ldr r0, [r5]\n\ - ldr r0, [r0, 0x4]\n\ - mov r2, r10\n\ - adds r1, r2, r0\n\ - ldr r5, [r1, 0x8]\n\ - ldrh r3, [r1, 0x8]\n\ - ldr r4, [r1, 0xC]\n\ - ldrh r2, [r1, 0xC]\n\ - ldrb r0, [r1, 0x10]\n\ - cmp r0, 0\n\ - beq _080F7A2C\n\ - lsls r0, r2, 16\n\ - negs r0, r0\n\ - lsrs r2, r0, 16\n\ -_080F7A2C:\n\ - lsls r0, r3, 16\n\ - asrs r3, r0, 16\n\ - lsls r0, r2, 16\n\ - asrs r2, r0, 16\n\ - adds r0, r3, r2\n\ - cmp r0, 0x58\n\ - bne _080F7A60\n\ - cmp r2, 0\n\ - ble _080F7A58\n\ - subs r0, r4, 0x1\n\ - str r0, [r1, 0xC]\n\ - b _080F7A60\n\ - .pool\n\ -_080F7A58:\n\ - cmp r3, 0\n\ - ble _080F7A60\n\ - subs r0, r5, 0x1\n\ - str r0, [r1, 0x8]\n\ -_080F7A60:\n\ - movs r4, 0x14\n\ - add r10, r4\n\ - movs r5, 0x1\n\ - add r8, r5\n\ - mov r0, r8\n\ - cmp r0, 0x3\n\ - bgt _080F7A70\n\ - b _080F78EA\n\ -_080F7A70:\n\ - add sp, 0x4\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0"); + int i, r4; + u32 r1; + s16 r2; + s8 var; + + r2 = gUnknown_02039F08[0]; + for (i = 1; i < 4; i++) + { + if (r2 < gUnknown_02039F08[i]) + r2 = gUnknown_02039F08[i]; + } + + if (r2 < 0) + { + r2 = gUnknown_02039F08[0]; + for (i = 1; i < 4; i++) + { + if (r2 > gUnknown_02039F08[i]) + r2 = gUnknown_02039F08[i]; + } + } + + for (i = 0; i < 4; i++) + { + r4 = (gContestMonConditions[i] * 1000) / abs(r2); + if (r4 % 10 > 4) + r4 += 10; + (*gUnknown_0203A034->unk4)[i].unk0 = r4 / 10; + + r4 = (abs(gUnknown_02039F18[i]) * 1000) / abs(r2); + if (r4 % 10 > 4) + r4 += 10; + (*gUnknown_0203A034->unk4)[i].unk4 = r4 / 10; + + if (gUnknown_02039F18[i] < 0) + (*gUnknown_0203A034->unk4)[i].unk10 = 1; + + r1 = ((*gUnknown_0203A034->unk4)[i].unk0 * 22528) / 100; + if ((r1 & 0xFF) > 0x7F) + r1 += 0x100; + (*gUnknown_0203A034->unk4)[i].unk8 = r1 >> 8; + + r1 = ((*gUnknown_0203A034->unk4)[i].unk4 * 22528) / 100; + if ((r1 & 0xFF) > 0x7F) + r1 += 0x100; + (*gUnknown_0203A034->unk4)[i].unkC = r1 >> 8; + + (*gUnknown_0203A034->unk4)[i].unk11 = sub_80F7310(i, 1); + var = sub_80F7364(i, 1); + (*gUnknown_0203A034->unk4)[i].unk12 = abs(var); + + if (gContestFinalStandings[i]) + { + s16 var1 = (*gUnknown_0203A034->unk4)[i].unk8; + s16 var2 = (*gUnknown_0203A034->unk4)[i].unkC; + + if ((*gUnknown_0203A034->unk4)[i].unk10) + var2 *= -1; + + if (var1 + var2 == 88) + { + if (var2 > 0) + (*gUnknown_0203A034->unk4)[i].unkC--; + else if (var1 > 0) + (*gUnknown_0203A034->unk4)[i].unk8--; + } + } + } } -// static void sub_80F7A80(u8 arg0, u8 arg1) -// { -// int i; -// u8 taskId; -// u8 sp8, spC; - -// sp8 = 0; -// spC = 0; -// if (!arg0) -// { -// u32 var0; -// for (i = 0; i < 4; i++) -// { -// int var1 = gUnknown_0203A034->unk4->unk0[i].unk11; -// if (arg1 < var1) -// { -// int x = var1 + 19; -// x -= arg1; -// x--; -// FillBgTilemapBufferRect_Palette0(1, 0x60B3, x, i * 3 + 5, 1, 1); -// taskId = CreateTask(sub_80F7CA8, 10); -// var0 = ((gUnknown_0203A034->unk4->unk0[i].unk8 << 16) / gUnknown_0203A034->unk4->unk0[i].unk11) * (arg1 + 1); -// var0 &= 0xFFFF; -// if (var0 > 0x7FFF) -// var0 += 0x10000; - -// gTasks[taskId].data[0] = i; -// gTasks[taskId].data[1] = var0 >> 16; -// gUnknown_0203A034->unk0->unk14++; -// sp8++; -// } -// } -// } -// else -// { -// u32 var0; -// for (i = 0; i < 4; i++) -// { -// int tile; -// s8 var1 = gUnknown_0203A034->unk4->unk0[i].unk12; -// tile = gUnknown_0203A034->unk4->unk0[i].unk10 ? 0x60A5 : 0x60A3; -// if (arg1 < var1) -// { -// int thing = ((s8)arg1 - 19); -// int x = var1 - thing; -// x--; -// FillBgTilemapBufferRect_Palette0(1, tile, x, i * 3 + 6, 1, 1); -// taskId = CreateTask(sub_80F7CA8, 10); -// var0 = ((gUnknown_0203A034->unk4->unk0[i].unkC << 16) / gUnknown_0203A034->unk4->unk0[i].unk12) * (arg1 + 1); -// var0 &= 0xFFFF; -// if (var0 > 0x7FFF) -// var0 += 0x10000; - -// gTasks[taskId].data[0] = i; -// if (gUnknown_0203A034->unk4->unk0[i].unk10) -// { -// gTasks[taskId].data[2] = 1; -// spC++; -// } -// else -// { -// sp8++; -// } - -// if (gUnknown_0203A034->unk4->unk0[i].unk10) -// gTasks[taskId].data[1] = gUnknown_0203A034->unk4->unk0[i].unk8 - (var0 >> 16); -// else -// gTasks[taskId].data[1] = gUnknown_0203A034->unk4->unk0[i].unk8 + (var0 >> 16); - -// gUnknown_0203A034->unk0->unk14++; -// } -// } -// } - -// if (spC) -// PlaySE(SE_PIN); - -// if (sp8) -// PlaySE(SE_BAN); -// } - -NAKED static void sub_80F7A80(u8 arg0, u8 arg1) { - asm_unified("\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0x14\n\ - lsls r0, 24\n\ - lsls r1, 24\n\ - lsrs r1, 24\n\ - mov r8, r1\n\ - movs r1, 0\n\ - str r1, [sp, 0x8]\n\ - movs r3, 0\n\ - str r3, [sp, 0xC]\n\ - cmp r0, 0\n\ - bne _080F7B5C\n\ - mov r9, r3\n\ - ldr r4, =gUnknown_0203A034\n\ - mov r10, r4\n\ - movs r7, 0xA0\n\ - lsls r7, 19\n\ - movs r6, 0\n\ -_080F7AAC:\n\ - mov r1, r10\n\ - ldr r0, [r1]\n\ - ldr r0, [r0, 0x4]\n\ - adds r0, r6, r0\n\ - ldrb r2, [r0, 0x11]\n\ - cmp r8, r2\n\ - bcs _080F7B2E\n\ - adds r2, 0x13\n\ - mov r3, r8\n\ - subs r2, r3\n\ - subs r2, 0x1\n\ - lsls r2, 24\n\ - lsrs r2, 24\n\ - lsrs r3, r7, 24\n\ - movs r0, 0x1\n\ - str r0, [sp]\n\ - str r0, [sp, 0x4]\n\ - ldr r1, =0x000060b3\n\ - bl FillBgTilemapBufferRect_Palette0\n\ - ldr r0, =sub_80F7CA8\n\ - movs r1, 0xA\n\ - bl CreateTask\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - mov r0, r10\n\ - ldr r4, [r0]\n\ - ldr r1, [r4, 0x4]\n\ - adds r1, r6, r1\n\ - ldr r0, [r1, 0x8]\n\ - lsls r0, 16\n\ - ldrb r1, [r1, 0x11]\n\ - bl __udivsi3\n\ - mov r1, r8\n\ - adds r1, 0x1\n\ - adds r3, r0, 0\n\ - muls r3, r1\n\ - ldr r0, =0x0000ffff\n\ - ands r0, r3\n\ - ldr r1, =0x00007fff\n\ - cmp r0, r1\n\ - bls _080F7B0A\n\ - movs r1, 0x80\n\ - lsls r1, 9\n\ - adds r3, r1\n\ -_080F7B0A:\n\ - ldr r1, =gTasks\n\ - lsls r0, r5, 2\n\ - adds r0, r5\n\ - lsls r0, 3\n\ - adds r0, r1\n\ - mov r1, r9\n\ - strh r1, [r0, 0x8]\n\ - lsrs r1, r3, 16\n\ - strh r1, [r0, 0xA]\n\ - ldr r1, [r4]\n\ - ldrb r0, [r1, 0x14]\n\ - adds r0, 0x1\n\ - strb r0, [r1, 0x14]\n\ - ldr r0, [sp, 0x8]\n\ - adds r0, 0x1\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - str r0, [sp, 0x8]\n\ -_080F7B2E:\n\ - movs r3, 0xC0\n\ - lsls r3, 18\n\ - adds r7, r3\n\ - adds r6, 0x14\n\ - movs r4, 0x1\n\ - add r9, r4\n\ - mov r0, r9\n\ - cmp r0, 0x3\n\ - ble _080F7AAC\n\ - b _080F7C7E\n\ - .pool\n\ -_080F7B5C:\n\ - movs r1, 0\n\ - mov r9, r1\n\ - mov r10, r1\n\ - movs r3, 0xC0\n\ - lsls r3, 19\n\ - str r3, [sp, 0x10]\n\ -_080F7B68:\n\ - ldr r4, =gUnknown_0203A034\n\ - ldr r0, [r4]\n\ - ldr r0, [r0, 0x4]\n\ - add r0, r10\n\ - ldrb r2, [r0, 0x12]\n\ - ldrb r0, [r0, 0x10]\n\ - ldr r1, =0x000060a3\n\ - cmp r0, 0\n\ - beq _080F7B7C\n\ - adds r1, 0x2\n\ -_080F7B7C:\n\ - lsls r0, r2, 24\n\ - asrs r0, 24\n\ - cmp r8, r0\n\ - bge _080F7C64\n\ - mov r3, r8\n\ - lsls r2, r3, 24\n\ - asrs r2, 24\n\ - subs r2, 0x13\n\ - subs r2, r0, r2\n\ - subs r2, 0x1\n\ - lsls r2, 24\n\ - lsrs r2, 24\n\ - ldr r4, [sp, 0x10]\n\ - lsrs r3, r4, 24\n\ - movs r7, 0x1\n\ - str r7, [sp]\n\ - str r7, [sp, 0x4]\n\ - movs r0, 0x1\n\ - bl FillBgTilemapBufferRect_Palette0\n\ - ldr r0, =sub_80F7CA8\n\ - movs r1, 0xA\n\ - bl CreateTask\n\ - lsls r0, 24\n\ - lsrs r5, r0, 24\n\ - ldr r0, =gUnknown_0203A034\n\ - ldr r6, [r0]\n\ - ldr r1, [r6, 0x4]\n\ - add r1, r10\n\ - ldr r0, [r1, 0xC]\n\ - lsls r0, 16\n\ - ldrb r1, [r1, 0x12]\n\ - bl __udivsi3\n\ - mov r1, r8\n\ - adds r1, 0x1\n\ - adds r3, r0, 0\n\ - muls r3, r1\n\ - ldr r0, =0x0000ffff\n\ - ands r0, r3\n\ - ldr r1, =0x00007fff\n\ - cmp r0, r1\n\ - bls _080F7BDA\n\ - movs r1, 0x80\n\ - lsls r1, 9\n\ - adds r3, r1\n\ -_080F7BDA:\n\ - ldr r1, =gTasks\n\ - lsls r2, r5, 2\n\ - adds r0, r2, r5\n\ - lsls r0, 3\n\ - adds r4, r0, r1\n\ - mov r0, r9\n\ - strh r0, [r4, 0x8]\n\ - ldr r0, [r6, 0x4]\n\ - add r0, r10\n\ - ldrb r0, [r0, 0x10]\n\ - adds r6, r1, 0\n\ - cmp r0, 0\n\ - beq _080F7C1C\n\ - strh r7, [r4, 0xC]\n\ - ldr r0, [sp, 0xC]\n\ - adds r0, 0x1\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - str r0, [sp, 0xC]\n\ - b _080F7C26\n\ - .pool\n\ -_080F7C1C:\n\ - ldr r0, [sp, 0x8]\n\ - adds r0, 0x1\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - str r0, [sp, 0x8]\n\ -_080F7C26:\n\ - ldr r1, =gUnknown_0203A034\n\ - ldr r0, [r1]\n\ - ldr r0, [r0, 0x4]\n\ - mov r4, r10\n\ - adds r1, r4, r0\n\ - ldrb r0, [r1, 0x10]\n\ - ldr r4, =gUnknown_0203A034\n\ - cmp r0, 0\n\ - beq _080F7C4C\n\ - adds r0, r2, r5\n\ - lsls r0, 3\n\ - adds r0, r6\n\ - lsrs r2, r3, 16\n\ - ldr r1, [r1, 0x8]\n\ - subs r1, r2\n\ - b _080F7C58\n\ - .pool\n\ -_080F7C4C:\n\ - adds r0, r2, r5\n\ - lsls r0, 3\n\ - adds r0, r6\n\ - lsrs r2, r3, 16\n\ - ldr r1, [r1, 0x8]\n\ - adds r1, r2\n\ -_080F7C58:\n\ - strh r1, [r0, 0xA]\n\ - ldr r0, [r4]\n\ - ldr r1, [r0]\n\ - ldrb r0, [r1, 0x14]\n\ - adds r0, 0x1\n\ - strb r0, [r1, 0x14]\n\ -_080F7C64:\n\ - movs r0, 0x14\n\ - add r10, r0\n\ - ldr r1, [sp, 0x10]\n\ - movs r3, 0xC0\n\ - lsls r3, 18\n\ - adds r1, r3\n\ - str r1, [sp, 0x10]\n\ - movs r4, 0x1\n\ - add r9, r4\n\ - mov r0, r9\n\ - cmp r0, 0x3\n\ - bgt _080F7C7E\n\ - b _080F7B68\n\ -_080F7C7E:\n\ - ldr r1, [sp, 0xC]\n\ - cmp r1, 0\n\ - beq _080F7C8A\n\ - movs r0, 0x16\n\ - bl PlaySE\n\ -_080F7C8A:\n\ - ldr r3, [sp, 0x8]\n\ - cmp r3, 0\n\ - beq _080F7C96\n\ - movs r0, 0x15\n\ - bl PlaySE\n\ -_080F7C96:\n\ - add sp, 0x14\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0"); + int i, taskId; + u32 var0; + u8 sp8 = 0, spC = 0; + + if (!arg0) + { + for (i = 0; i < 4; i++) + { + u8 unk = (*gUnknown_0203A034->unk4)[i].unk11; + if (arg1 < unk) + { + FillBgTilemapBufferRect_Palette0(1, 0x60B3, ((19 + unk) - arg1) - 1, i * 3 + 5, 1, 1); + taskId = CreateTask(sub_80F7CA8, 10); + + var0 = (((*gUnknown_0203A034->unk4)[i].unk8 << 16) / (*gUnknown_0203A034->unk4)[i].unk11) * (arg1 + 1); + if ((var0 & 0xFFFF) > 0x7FFF) + var0 += 0x10000; + + gTasks[taskId].data[0] = i; + gTasks[taskId].data[1] = var0 >> 16; + gUnknown_0203A034->unk0->unk14++; + sp8++; + } + } + } + else + { + for (i = 0; i < 4; i++) + { + s8 unk = (*gUnknown_0203A034->unk4)[i].unk12; + u32 tile = (*gUnknown_0203A034->unk4)[i].unk10 ? 0x60A5 : 0x60A3; + if (arg1 < unk) + { + FillBgTilemapBufferRect_Palette0(1, tile, ((19 + unk) - arg1) - 1, i * 3 + 6, 1, 1); + taskId = CreateTask(sub_80F7CA8, 10); + + var0 = (((*gUnknown_0203A034->unk4)[i].unkC << 16) / (*gUnknown_0203A034->unk4)[i].unk12) * (arg1 + 1); + if ((var0 & 0xFFFF) > 0x7FFF) + var0 += 0x10000; + + gTasks[taskId].data[0] = i; + if ((*gUnknown_0203A034->unk4)[i].unk10) + { + gTasks[taskId].data[2] = 1; + spC++; + } + else + { + sp8++; + } + + if ((*gUnknown_0203A034->unk4)[i].unk10) + gTasks[taskId].data[1] = -(var0 >> 16) + (*gUnknown_0203A034->unk4)[i].unk8 ; + else + gTasks[taskId].data[1] = (var0 >> 16) + (*gUnknown_0203A034->unk4)[i].unk8; + + gUnknown_0203A034->unk0->unk14++; + } + } + } + + if (spC) + PlaySE(SE_BOO); + if (sp8) + PlaySE(SE_PIN); } void sub_80F7CA8(u8 taskId) @@ -2624,8 +2051,7 @@ void sub_80F8290(void) void sub_80F82B4(void) { - u8 i; - u8 count; + u8 i, count; for (i = 0, count = 0; i < 4; i++) { diff --git a/src/contest_painting.c b/src/contest_painting.c index 257bde445..66127cbbc 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -28,11 +28,11 @@ struct ContestWinner *gUnknown_030061C0; u16 *gContestPaintingMonPalette; // IWRAM bss -IWRAM_DATA u8 gContestPaintingState; -IWRAM_DATA u16 gContestPaintingMosaicVal; -IWRAM_DATA u16 gContestPaintingFadeCounter; -IWRAM_DATA bool8 gUnknown_030011F6; -IWRAM_DATA u8 gContestPaintingWindowId; +static u8 gContestPaintingState; +static u16 gContestPaintingMosaicVal; +static u16 gContestPaintingFadeCounter; +static bool8 gUnknown_030011F6; +static u8 gContestPaintingWindowId; static void ShowContestPainting(void); static void HoldContestPainting(void); @@ -362,7 +362,7 @@ static void VBlankCB_ContestPainting(void) void sub_81302E8(u16 species, u8 arg1) { - const void *pal = GetFrontSpritePalFromSpeciesAndPersonality(species, gUnknown_030061C0->trainerId, gUnknown_030061C0->personality); + const void *pal = GetMonSpritePalFromSpeciesAndPersonality(species, gUnknown_030061C0->trainerId, gUnknown_030061C0->personality); LZDecompressVram(pal, gContestPaintingMonPalette); if (!arg1) { @@ -684,7 +684,7 @@ static void sub_8130760(u8 contestResult) gUnknown_030061A0.var_16 = 2; gUnknown_030061A0.var_0 = contestResult; - gUnknown_030061A0.var_10 = 0x6010000; + gUnknown_030061A0.var_10 = OBJ_VRAM0; sub_8124F2C(&gUnknown_030061A0); sub_81261A4(&gUnknown_030061A0); diff --git a/src/data/region_map/city_map_entries.h b/src/data/region_map/city_map_entries.h new file mode 100644 index 000000000..7b8361a7c --- /dev/null +++ b/src/data/region_map/city_map_entries.h @@ -0,0 +1,113 @@ +const struct CityMapEntry gPokenavCityMaps[] = +{ + { + .mapSecId = 0, + .index = 0, + .tilemap = gPokenavCityMap_Littleroot_0, + }, + { + .mapSecId = 1, + .index = 0, + .tilemap = gPokenavCityMap_Oldale_0, + }, + { + .mapSecId = 2, + .index = 0, + .tilemap = gPokenavCityMap_Dewford_0, + }, + { + .mapSecId = 3, + .index = 0, + .tilemap = gPokenavCityMap_Lavarige_0, + }, + { + .mapSecId = 4, + .index = 0, + .tilemap = gPokenavCityMap_Fallarbor_0, + }, + { + .mapSecId = 5, + .index = 0, + .tilemap = gPokenavCityMap_Verdanturf_0, + }, + { + .mapSecId = 6, + .index = 0, + .tilemap = gPokenavCityMap_Pacifidlog_0, + }, + { + .mapSecId = 7, + .index = 0, + .tilemap = gPokenavCityMap_Petalburg_0, + }, + { + .mapSecId = 8, + .index = 0, + .tilemap = gPokenavCityMap_Slateport_0, + }, + { + .mapSecId = 8, + .index = 1, + .tilemap = gPokenavCityMap_Slateport_1, + }, + { + .mapSecId = 9, + .index = 0, + .tilemap = gPokenavCityMap_Mauville_0, + }, + { + .mapSecId = 9, + .index = 1, + .tilemap = gPokenavCityMap_Mauville_1, + }, + { + .mapSecId = 10, + .index = 0, + .tilemap = gPokenavCityMap_Rustboro_0, + }, + { + .mapSecId = 10, + .index = 1, + .tilemap = gPokenavCityMap_Rustboro_1, + }, + { + .mapSecId = 11, + .index = 0, + .tilemap = gPokenavCityMap_Fortree_0, + }, + { + .mapSecId = 12, + .index = 0, + .tilemap = gPokenavCityMap_Lilycove_0, + }, + { + .mapSecId = 12, + .index = 1, + .tilemap = gPokenavCityMap_Lilycove_1, + }, + { + .mapSecId = 13, + .index = 0, + .tilemap = gPokenavCityMap_Mossdeep_0, + }, + { + .mapSecId = 13, + .index = 1, + .tilemap = gPokenavCityMap_Mossdeep_1, + }, + { + .mapSecId = 14, + .index = 0, + .tilemap = gPokenavCityMap_Sootopolis_0, + }, + { + .mapSecId = 15, + .index = 0, + .tilemap = gPokenavCityMap_EverGrande_0, + }, + { + .mapSecId = 15, + .index = 1, + .tilemap = gPokenavCityMap_EverGrande_1, + }, +}; diff --git a/src/data/region_map/city_map_tilemaps.h b/src/data/region_map/city_map_tilemaps.h new file mode 100644 index 000000000..8a8a931f9 --- /dev/null +++ b/src/data/region_map/city_map_tilemaps.h @@ -0,0 +1,22 @@ +const u32 gPokenavCityMap_Lavarige_0[] = INCBIN_U32("graphics/pokenav/city_maps/lavaridge_0.bin.lz"); +const u32 gPokenavCityMap_Fallarbor_0[] = INCBIN_U32("graphics/pokenav/city_maps/fallarbor_0.bin.lz"); +const u32 gPokenavCityMap_Fortree_0[] = INCBIN_U32("graphics/pokenav/city_maps/fortree_0.bin.lz"); +const u32 gPokenavCityMap_Slateport_0[] = INCBIN_U32("graphics/pokenav/city_maps/slateport_0.bin.lz"); +const u32 gPokenavCityMap_Slateport_1[] = INCBIN_U32("graphics/pokenav/city_maps/slateport_1.bin.lz"); +const u32 gPokenavCityMap_Rustboro_0[] = INCBIN_U32("graphics/pokenav/city_maps/rustboro_0.bin.lz"); +const u32 gPokenavCityMap_Rustboro_1[] = INCBIN_U32("graphics/pokenav/city_maps/rustboro_1.bin.lz"); +const u32 gPokenavCityMap_Pacifidlog_0[] = INCBIN_U32("graphics/pokenav/city_maps/pacifidlog_0.bin.lz"); +const u32 gPokenavCityMap_Mauville_1[] = INCBIN_U32("graphics/pokenav/city_maps/mauville_1.bin.lz"); +const u32 gPokenavCityMap_Mauville_0[] = INCBIN_U32("graphics/pokenav/city_maps/mauville_0.bin.lz"); +const u32 gPokenavCityMap_Oldale_0[] = INCBIN_U32("graphics/pokenav/city_maps/oldale_0.bin.lz"); +const u32 gPokenavCityMap_Lilycove_1[] = INCBIN_U32("graphics/pokenav/city_maps/lilycove_1.bin.lz"); +const u32 gPokenavCityMap_Lilycove_0[] = INCBIN_U32("graphics/pokenav/city_maps/lilycove_0.bin.lz"); +const u32 gPokenavCityMap_Littleroot_0[] = INCBIN_U32("graphics/pokenav/city_maps/littleroot_0.bin.lz"); +const u32 gPokenavCityMap_Dewford_0[] = INCBIN_U32("graphics/pokenav/city_maps/dewford_0.bin.lz"); +const u32 gPokenavCityMap_Sootopolis_0[] = INCBIN_U32("graphics/pokenav/city_maps/sootopolis_0.bin.lz"); +const u32 gPokenavCityMap_EverGrande_0[] = INCBIN_U32("graphics/pokenav/city_maps/ever_grande_0.bin.lz"); +const u32 gPokenavCityMap_EverGrande_1[] = INCBIN_U32("graphics/pokenav/city_maps/ever_grande_1.bin.lz"); +const u32 gPokenavCityMap_Verdanturf_0[] = INCBIN_U32("graphics/pokenav/city_maps/verdanturf_0.bin.lz"); +const u32 gPokenavCityMap_Mossdeep_1[] = INCBIN_U32("graphics/pokenav/city_maps/mossdeep_1.bin.lz"); +const u32 gPokenavCityMap_Mossdeep_0[] = INCBIN_U32("graphics/pokenav/city_maps/mossdeep_0.bin.lz"); +const u32 gPokenavCityMap_Petalburg_0[] = INCBIN_U32("graphics/pokenav/city_maps/petalburg_0.bin.lz"); diff --git a/src/data/text/gift_ribbon_descriptions.h b/src/data/text/gift_ribbon_descriptions.h new file mode 100644 index 000000000..ea108be18 --- /dev/null +++ b/src/data/text/gift_ribbon_descriptions.h @@ -0,0 +1,115 @@ +const u8 gGiftRibbonDescriptionPart1_2003RegionalTourney[] = _("2003 REGIONAL TOURNEY"); +const u8 gGiftRibbonDescriptionPart2_Champion[] = _("CHAMPION RIBBON"); +const u8 gGiftRibbonDescriptionPart1_2003NationalTourney[] = _("2003 NATIONAL TOURNEY"); +const u8 gGiftRibbonDescriptionPart1_2003GlobalCup[] = _("2003 GLOBAL CUP"); +const u8 gGiftRibbonDescriptionPart2_RunnerUp[] = _("Runner-up RIBBON"); +const u8 gGiftRibbonDescriptionPart2_Semifinalist[] = _("Semifinalist RIBBON"); +const u8 gGiftRibbonDescriptionPart1_2004RegionalTourney[] = _("2004 REGIONAL TOURNEY"); +const u8 gGiftRibbonDescriptionPart1_2004NationalTourney[] = _("2004 NATIONAL TOURNEY"); +const u8 gGiftRibbonDescriptionPart1_2004GlobalCup[] = _("2004 GLOBAL CUP"); +const u8 gGiftRibbonDescriptionPart1_2005RegionalTourney[] = _("2005 REGIONAL TOURNEY"); +const u8 gGiftRibbonDescriptionPart1_2005NationalTourney[] = _("2005 NATIONAL TOURNEY"); +const u8 gGiftRibbonDescriptionPart1_2005GlobalCup[] = _("2005 GLOBAL CUP"); +const u8 gGiftRibbonDescriptionPart1_PokemonBattleCup[] = _("POKéMON BATTLE CUP"); +const u8 gGiftRibbonDescriptionPart2_Participation[] = _("Participation RIBBON"); +const u8 gGiftRibbonDescriptionPart1_PokemonLeague[] = _("POKéMON LEAGUE"); +const u8 gGiftRibbonDescriptionPart1_AdvanceCup[] = _("ADVANCE CUP"); +const u8 gGiftRibbonDescriptionPart1_PokemonTournament[] = _("POKéMON Tournament"); +const u8 gGiftRibbonDescriptionPart2_Participation2[] = _("Participation RIBBON"); +const u8 gGiftRibbonDescriptionPart1_PokemonEvent[] = _("POKéMON Event"); +const u8 gGiftRibbonDescriptionPart1_PokemonFestival[] = _("POKéMON Festival"); +const u8 gGiftRibbonDescriptionPart1_DifficultyClearing[] = _("Difficulty-clearing"); +const u8 gGiftRibbonDescriptionPart2_Commemorative[] = _("Commemorative RIBBON"); +const u8 gGiftRibbonDescriptionPart1_ClearingAllChallenges[] = _("RIBBON awarded for"); +const u8 gGiftRibbonDescriptionPart2_ClearingAllChallenges[] = _("clearing all challenges."); +const u8 gGiftRibbonDescriptionPart1_100StraightWin[] = _("100-straight Win"); +const u8 gGiftRibbonDescriptionPart1_DarknessTower[] = _("DARKNESS TOWER Clear"); +const u8 gGiftRibbonDescriptionPart1_RedTower[] = _("RED TOWER Clear"); +const u8 gGiftRibbonDescriptionPart1_BlackironTower[] = _("BLACKIRON TOWER Clear"); +const u8 gGiftRibbonDescriptionPart1_FinalTower[] = _("FINAL TOWER Clear"); +const u8 gGiftRibbonDescriptionPart1_LegendMaking[] = _("Legend-making"); +const u8 gGiftRibbonDescriptionPart1_PokemonCenterTokyo[] = _("POKéMON CENTER TOKYO"); +const u8 gGiftRibbonDescriptionPart1_PokemonCenterOsaka[] = _("POKéMON CENTER OSAKA"); +const u8 gGiftRibbonDescriptionPart1_PokemonCenterNagoya[] = _("POKéMON CENTER NAGOYA"); +const u8 gGiftRibbonDescriptionPart1_PokemonCenterNY[] = _("POKéMON CENTER NY"); +const u8 gGiftRibbonDescriptionPart1_SummerHolidays[] = _("Summer Holidays RIBBON"); +const u8 gGiftRibbonDescriptionPart2_EmptyString[] = _(""); +const u8 gGiftRibbonDescriptionPart1_WinterHolidays[] = _("Winter Holidays RIBBON"); +const u8 gGiftRibbonDescriptionPart1_SpringHolidays[] = _("Spring Holidays RIBBON"); +const u8 gGiftRibbonDescriptionPart1_Evergreen[] = _("Evergreen RIBBON"); +const u8 gGiftRibbonDescriptionPart1_SpecialHoliday[] = _("Special Holiday RIBBON"); +const u8 gGiftRibbonDescriptionPart1_HardWorker[] = _("Hard Worker RIBBON"); +const u8 gGiftRibbonDescriptionPart1_LotsOfFriends[] = _("Lots of Friends RIBBON"); +const u8 gGiftRibbonDescriptionPart1_FullOfEnergy[] = _("Full of Energy RIBBON"); +const u8 gGiftRibbonDescriptionPart1_LovedPokemon[] = _("A commemorative RIBBON"); +const u8 gGiftRibbonDescriptionPart2_LovedPokemon[] = _("for a loved POKéMON."); +const u8 gGiftRibbonDescriptionPart1_LoveForPokemon[] = _("RIBBON that shows"); +const u8 gGiftRibbonDescriptionPart2_LoveForPokemon[] = _("love for POKéMON."); + +const u8 *const gGiftRibbonDescriptionPointers[][2] = +{ + {gGiftRibbonDescriptionPart1_2003RegionalTourney, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_2003NationalTourney, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_2003GlobalCup, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_2003RegionalTourney, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_2003NationalTourney, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_2003GlobalCup, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_2003RegionalTourney, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_2003NationalTourney, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_2003GlobalCup, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_2004RegionalTourney, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_2004NationalTourney, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_2004GlobalCup, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_2004RegionalTourney, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_2004NationalTourney, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_2004GlobalCup, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_2004RegionalTourney, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_2004NationalTourney, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_2004GlobalCup, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_2005RegionalTourney, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_2005NationalTourney, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_2005GlobalCup, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_2005RegionalTourney, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_2005NationalTourney, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_2005GlobalCup, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_2005RegionalTourney, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_2005NationalTourney, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_2005GlobalCup, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_PokemonBattleCup, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_PokemonBattleCup, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_PokemonBattleCup, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_PokemonBattleCup, gGiftRibbonDescriptionPart2_Participation}, + {gGiftRibbonDescriptionPart1_PokemonLeague, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_PokemonLeague, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_PokemonLeague, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_PokemonLeague, gGiftRibbonDescriptionPart2_Participation}, + {gGiftRibbonDescriptionPart1_AdvanceCup, gGiftRibbonDescriptionPart2_Champion}, + {gGiftRibbonDescriptionPart1_AdvanceCup, gGiftRibbonDescriptionPart2_RunnerUp}, + {gGiftRibbonDescriptionPart1_AdvanceCup, gGiftRibbonDescriptionPart2_Semifinalist}, + {gGiftRibbonDescriptionPart1_AdvanceCup, gGiftRibbonDescriptionPart2_Participation}, + {gGiftRibbonDescriptionPart1_PokemonTournament, gGiftRibbonDescriptionPart2_Participation2}, + {gGiftRibbonDescriptionPart1_PokemonEvent, gGiftRibbonDescriptionPart2_Participation2}, + {gGiftRibbonDescriptionPart1_PokemonFestival, gGiftRibbonDescriptionPart2_Participation2}, + {gGiftRibbonDescriptionPart1_DifficultyClearing, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_ClearingAllChallenges, gGiftRibbonDescriptionPart2_ClearingAllChallenges}, + {gGiftRibbonDescriptionPart1_100StraightWin, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_DarknessTower, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_RedTower, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_BlackironTower, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_FinalTower, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_LegendMaking, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_PokemonCenterTokyo, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_PokemonCenterOsaka, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_PokemonCenterNagoya, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_PokemonCenterNY, gGiftRibbonDescriptionPart2_Commemorative}, + {gGiftRibbonDescriptionPart1_SummerHolidays, gGiftRibbonDescriptionPart2_EmptyString}, + {gGiftRibbonDescriptionPart1_WinterHolidays, gGiftRibbonDescriptionPart2_EmptyString}, + {gGiftRibbonDescriptionPart1_SpringHolidays, gGiftRibbonDescriptionPart2_EmptyString}, + {gGiftRibbonDescriptionPart1_Evergreen, gGiftRibbonDescriptionPart2_EmptyString}, + {gGiftRibbonDescriptionPart1_SpecialHoliday, gGiftRibbonDescriptionPart2_EmptyString}, + {gGiftRibbonDescriptionPart1_HardWorker, gGiftRibbonDescriptionPart2_EmptyString}, + {gGiftRibbonDescriptionPart1_LotsOfFriends, gGiftRibbonDescriptionPart2_EmptyString}, + {gGiftRibbonDescriptionPart1_FullOfEnergy, gGiftRibbonDescriptionPart2_EmptyString}, + {gGiftRibbonDescriptionPart1_LovedPokemon, gGiftRibbonDescriptionPart2_LovedPokemon}, + {gGiftRibbonDescriptionPart1_LoveForPokemon, gGiftRibbonDescriptionPart2_LoveForPokemon} +}; diff --git a/src/data/text/match_call_messages.h b/src/data/text/match_call_messages.h new file mode 100644 index 000000000..c3015b5a7 --- /dev/null +++ b/src/data/text/match_call_messages.h @@ -0,0 +1,476 @@ +#define MCFLAVOR(name) {gMatchCallFlavorText_##name##_Strategy, \ + gMatchCallFlavorText_##name##_Pokemon, \ + gMatchCallFlavorText_##name##_Intro1, \ + gMatchCallFlavorText_##name##_Intro2} + +const u8 gMatchCallFlavorText_AromaLady_Rose_Strategy[] = _("Becalm fighting emotions."); +const u8 gMatchCallFlavorText_AromaLady_Rose_Pokemon[] = _("Fragrant GRASS POKéMON."); +const u8 gMatchCallFlavorText_AromaLady_Rose_Intro1[] = _("Soothing aromas make the"); +const u8 gMatchCallFlavorText_AromaLady_Rose_Intro2[] = _("body and mind healthy."); + +const u8 gMatchCallFlavorText_RuinManiac_Andres_Strategy[] = _("I'm not very good at this."); +const u8 gMatchCallFlavorText_RuinManiac_Andres_Pokemon[] = _("Ruin-exploration partners."); +const u8 gMatchCallFlavorText_RuinManiac_Andres_Intro1[] = _("I am searching for undersea"); +const u8 gMatchCallFlavorText_RuinManiac_Andres_Intro2[] = _("ruins and relics."); + +const u8 gMatchCallFlavorText_RuinManiac_Dusty_Strategy[] = _("Overwhelm with power!"); +const u8 gMatchCallFlavorText_RuinManiac_Dusty_Pokemon[] = _("Craggy ROCK POKéMON."); +const u8 gMatchCallFlavorText_RuinManiac_Dusty_Intro1[] = _("In search of ancient lore,"); +const u8 gMatchCallFlavorText_RuinManiac_Dusty_Intro2[] = _("I travel the world."); + +const u8 gMatchCallFlavorText_Tuber_Lola_Strategy[] = _("I'm going to try hard!"); +const u8 gMatchCallFlavorText_Tuber_Lola_Pokemon[] = _("Good swimmer POKéMON."); +const u8 gMatchCallFlavorText_Tuber_Lola_Intro1[] = _("I wish I could swim without"); +const u8 gMatchCallFlavorText_Tuber_Lola_Intro2[] = _("using an inner tube."); + +const u8 gMatchCallFlavorText_Tuber_Ricky_Strategy[] = _("I don't know. I'll try hard."); +const u8 gMatchCallFlavorText_Tuber_Ricky_Pokemon[] = _("WATER POKéMON are buddies."); +const u8 gMatchCallFlavorText_Tuber_Ricky_Intro1[] = _("It's not like I can't swim."); +const u8 gMatchCallFlavorText_Tuber_Ricky_Intro2[] = _("I just like my inner tube."); + +const u8 gMatchCallFlavorText_SisAndBro_LilaAndRoy_Strategy[] = _("We split our duties."); +const u8 gMatchCallFlavorText_SisAndBro_LilaAndRoy_Pokemon[] = _("We like friendly POKéMON."); +const u8 gMatchCallFlavorText_SisAndBro_LilaAndRoy_Intro1[] = _("We enjoy POKéMON together"); +const u8 gMatchCallFlavorText_SisAndBro_LilaAndRoy_Intro2[] = _("as sister and brother."); + +const u8 gMatchCallFlavorText_Cooltrainer_Cristin_Strategy[] = _("I finish with power moves!"); +const u8 gMatchCallFlavorText_Cooltrainer_Cristin_Pokemon[] = _("A mix of different types."); +const u8 gMatchCallFlavorText_Cooltrainer_Cristin_Intro1[] = _("I aim to become the ultimate"); +const u8 gMatchCallFlavorText_Cooltrainer_Cristin_Intro2[] = _("TRAINER!"); + +const u8 gMatchCallFlavorText_Cooltrainer_Brooke_Strategy[] = _("Exploit the foe's weakness."); +const u8 gMatchCallFlavorText_Cooltrainer_Brooke_Pokemon[] = _("Balance is crucial."); +const u8 gMatchCallFlavorText_Cooltrainer_Brooke_Intro1[] = _("My goal is to become the"); +const u8 gMatchCallFlavorText_Cooltrainer_Brooke_Intro2[] = _("POKéMON CHAMPION."); + +const u8 gMatchCallFlavorText_Cooltrainer_Wilton_Strategy[] = _("Upset the opponent."); +const u8 gMatchCallFlavorText_Cooltrainer_Wilton_Pokemon[] = _("Type doesn't matter."); +const u8 gMatchCallFlavorText_Cooltrainer_Wilton_Intro1[] = _("I'm a top student at the"); +const u8 gMatchCallFlavorText_Cooltrainer_Wilton_Intro2[] = _("TRAINER'S SCHOOL."); + +const u8 gMatchCallFlavorText_HexManiac_Valerie_Strategy[] = _("Slow, steady suffering."); +const u8 gMatchCallFlavorText_HexManiac_Valerie_Pokemon[] = _("Scary to meet at night."); +const u8 gMatchCallFlavorText_HexManiac_Valerie_Intro1[] = _("I see things that others"); +const u8 gMatchCallFlavorText_HexManiac_Valerie_Intro2[] = _("can't see..."); + +const u8 gMatchCallFlavorText_Lady_Cindy_Strategy[] = _("Anything to win."); +const u8 gMatchCallFlavorText_Lady_Cindy_Pokemon[] = _("Gorgeous type!"); +const u8 gMatchCallFlavorText_Lady_Cindy_Intro1[] = _("I have a pool specially for"); +const u8 gMatchCallFlavorText_Lady_Cindy_Intro2[] = _("my POKéMON at home."); + +const u8 gMatchCallFlavorText_Beauty_Thalia_Strategy[] = _("You'll fall under my spell!"); +const u8 gMatchCallFlavorText_Beauty_Thalia_Pokemon[] = _("Mature WATER type."); +const u8 gMatchCallFlavorText_Beauty_Thalia_Intro1[] = _("I dream of cruising around"); +const u8 gMatchCallFlavorText_Beauty_Thalia_Intro2[] = _("the world on a luxury liner."); + +const u8 gMatchCallFlavorText_Beauty_Jessica_Strategy[] = _("I'll lead you astray."); +const u8 gMatchCallFlavorText_Beauty_Jessica_Pokemon[] = _("Cute, of course."); +const u8 gMatchCallFlavorText_Beauty_Jessica_Intro1[] = _("I love the SAFARI ZONE."); +const u8 gMatchCallFlavorText_Beauty_Jessica_Intro2[] = _("I seem to end up there."); + +const u8 gMatchCallFlavorText_RichBoy_Winston_Strategy[] = _("Strategy? Who needs it?"); +const u8 gMatchCallFlavorText_RichBoy_Winston_Pokemon[] = _("I spent big money on it!"); +const u8 gMatchCallFlavorText_RichBoy_Winston_Intro1[] = _("I, being rich, sleep in a"); +const u8 gMatchCallFlavorText_RichBoy_Winston_Intro2[] = _("custom POKéMON bed."); + +const u8 gMatchCallFlavorText_PokeManiac_Steve_Strategy[] = _("Wrestle down with power."); +const u8 gMatchCallFlavorText_PokeManiac_Steve_Pokemon[] = _("Took all night to catch."); +const u8 gMatchCallFlavorText_PokeManiac_Steve_Intro1[] = _("Big, burly, and buff"); +const u8 gMatchCallFlavorText_PokeManiac_Steve_Intro2[] = _("POKéMON are the best..."); + +const u8 gMatchCallFlavorText_Swimmer_Tony_Strategy[] = _("Ram at full speed!"); +const u8 gMatchCallFlavorText_Swimmer_Tony_Pokemon[] = _("Funky WATER type!"); +const u8 gMatchCallFlavorText_Swimmer_Tony_Intro1[] = _("If I can't be out swimming,"); +const u8 gMatchCallFlavorText_Swimmer_Tony_Intro2[] = _("I'll be pumping weights."); + +const u8 gMatchCallFlavorText_BlackBelt_Nob_Strategy[] = _("Grand slam pummeling!"); +const u8 gMatchCallFlavorText_BlackBelt_Nob_Pokemon[] = _("FIGHTING type."); +const u8 gMatchCallFlavorText_BlackBelt_Nob_Intro1[] = _("Not to brag, but I can bust"); +const u8 gMatchCallFlavorText_BlackBelt_Nob_Intro2[] = _("ten roof tiles!"); + +const u8 gMatchCallFlavorText_BlackBelt_Koji_Strategy[] = _("Witness karate power!"); +const u8 gMatchCallFlavorText_BlackBelt_Koji_Pokemon[] = _("My partners in training!"); +const u8 gMatchCallFlavorText_BlackBelt_Koji_Intro1[] = _("Let us discuss matters of"); +const u8 gMatchCallFlavorText_BlackBelt_Koji_Intro2[] = _("the world with bare fists!"); + +const u8 gMatchCallFlavorText_Guitarist_Fernando_Strategy[] = _("Rock to stunning sounds!"); +const u8 gMatchCallFlavorText_Guitarist_Fernando_Pokemon[] = _("Electric-and-sound combo!"); +const u8 gMatchCallFlavorText_Guitarist_Fernando_Intro1[] = _("My compositions will shock"); +const u8 gMatchCallFlavorText_Guitarist_Fernando_Intro2[] = _("you and stun you!"); + +const u8 gMatchCallFlavorText_Guitarist_Dalton_Strategy[] = _("I'll electrify you!"); +const u8 gMatchCallFlavorText_Guitarist_Dalton_Pokemon[] = _("They're ELECTRIC!"); +const u8 gMatchCallFlavorText_Guitarist_Dalton_Intro1[] = _("I want to make people cry"); +const u8 gMatchCallFlavorText_Guitarist_Dalton_Intro2[] = _("with songs from my heart."); + +const u8 gMatchCallFlavorText_Kindler_Bernie_Strategy[] = _("Burn it all down!"); +const u8 gMatchCallFlavorText_Kindler_Bernie_Pokemon[] = _("Burn-inducing POKéMON."); +const u8 gMatchCallFlavorText_Kindler_Bernie_Intro1[] = _("When you light a campfire,"); +const u8 gMatchCallFlavorText_Kindler_Bernie_Intro2[] = _("be sure there's some water."); + +const u8 gMatchCallFlavorText_Camper_Ethan_Strategy[] = _("Hang in and be tenacious!"); +const u8 gMatchCallFlavorText_Camper_Ethan_Pokemon[] = _("I'll raise any POKéMON."); +const u8 gMatchCallFlavorText_Camper_Ethan_Intro1[] = _("POKéMON raised in the wild"); +const u8 gMatchCallFlavorText_Camper_Ethan_Intro2[] = _("grow strong!"); + +const u8 gMatchCallFlavorText_OldCouple_JohnAndJay_Strategy[] = _("Our love lets us prevail."); +const u8 gMatchCallFlavorText_OldCouple_JohnAndJay_Pokemon[] = _("We've had them for years."); +const u8 gMatchCallFlavorText_OldCouple_JohnAndJay_Intro1[] = _("Married 50 years, we've"); +const u8 gMatchCallFlavorText_OldCouple_JohnAndJay_Intro2[] = _("devotedly raised POKéMON."); + +const u8 gMatchCallFlavorText_BugManiac_Jeffrey_Strategy[] = _("Attack in waves!"); +const u8 gMatchCallFlavorText_BugManiac_Jeffrey_Pokemon[] = _("BUG POKéMON are cool."); +const u8 gMatchCallFlavorText_BugManiac_Jeffrey_Intro1[] = _("I go into the forest every"); +const u8 gMatchCallFlavorText_BugManiac_Jeffrey_Intro2[] = _("day to catch BUG POKéMON."); + +const u8 gMatchCallFlavorText_Psychic_Cameron_Strategy[] = _("Daze and confuse!"); +const u8 gMatchCallFlavorText_Psychic_Cameron_Pokemon[] = _("Ones with weird powers."); +const u8 gMatchCallFlavorText_Psychic_Cameron_Intro1[] = _("I can see through exactly"); +const u8 gMatchCallFlavorText_Psychic_Cameron_Intro2[] = _("what you're thinking!"); + +const u8 gMatchCallFlavorText_Psychic_Jacki_Strategy[] = _("Battle at full power."); +const u8 gMatchCallFlavorText_Psychic_Jacki_Pokemon[] = _("POKéMON of many mysteries."); +const u8 gMatchCallFlavorText_Psychic_Jacki_Intro1[] = _("When we spoke, I was really"); +const u8 gMatchCallFlavorText_Psychic_Jacki_Intro2[] = _("using telepathy."); + +const u8 gMatchCallFlavorText_Gentleman_Walter_Strategy[] = _("Calm and collected."); +const u8 gMatchCallFlavorText_Gentleman_Walter_Pokemon[] = _("POKéMON of distinction."); +const u8 gMatchCallFlavorText_Gentleman_Walter_Intro1[] = _("We enjoy a spot of tea"); +const u8 gMatchCallFlavorText_Gentleman_Walter_Intro2[] = _("every day. It's imported."); + +const u8 gMatchCallFlavorText_SchoolKid_Karen_Strategy[] = _("I use my head to battle."); +const u8 gMatchCallFlavorText_SchoolKid_Karen_Pokemon[] = _("I love any kind of POKéMON!"); +const u8 gMatchCallFlavorText_SchoolKid_Karen_Intro1[] = _("My daddy gives me spending"); +const u8 gMatchCallFlavorText_SchoolKid_Karen_Intro2[] = _("money if I ace a test."); + +const u8 gMatchCallFlavorText_SchoolKid_Jerry_Strategy[] = _("My knowledge rules!"); +const u8 gMatchCallFlavorText_SchoolKid_Jerry_Pokemon[] = _("Any smart POKéMON!"); +const u8 gMatchCallFlavorText_SchoolKid_Jerry_Intro1[] = _("I want to be a POKéMON"); +const u8 gMatchCallFlavorText_SchoolKid_Jerry_Intro2[] = _("researcher in the future."); + +const u8 gMatchCallFlavorText_SrAndJr_AnnaAndMeg_Strategy[] = _("We talk it over first."); +const u8 gMatchCallFlavorText_SrAndJr_AnnaAndMeg_Pokemon[] = _("POKéMON that we both like."); +const u8 gMatchCallFlavorText_SrAndJr_AnnaAndMeg_Intro1[] = _("We're senior and junior"); +const u8 gMatchCallFlavorText_SrAndJr_AnnaAndMeg_Intro2[] = _("students into POKéMON!"); + +const u8 gMatchCallFlavorText_Pokefan_Isabel_Strategy[] = _("Go for it, my dears!"); +const u8 gMatchCallFlavorText_Pokefan_Isabel_Pokemon[] = _("I have no likes or dislikes."); +const u8 gMatchCallFlavorText_Pokefan_Isabel_Intro1[] = _("While out shopping for"); +const u8 gMatchCallFlavorText_Pokefan_Isabel_Intro2[] = _("supper, I battle too."); + +const u8 gMatchCallFlavorText_Pokefan_Miguel_Strategy[] = _("I battle with love!"); +const u8 gMatchCallFlavorText_Pokefan_Miguel_Pokemon[] = _("A POKéMON raised with love!"); +const u8 gMatchCallFlavorText_Pokefan_Miguel_Intro1[] = _("It's important to build"); +const u8 gMatchCallFlavorText_Pokefan_Miguel_Intro2[] = _("trust with your POKéMON."); + +const u8 gMatchCallFlavorText_Expert_Timothy_Strategy[] = _("I see through your moves!"); +const u8 gMatchCallFlavorText_Expert_Timothy_Pokemon[] = _("The essence of FIGHTING."); +const u8 gMatchCallFlavorText_Expert_Timothy_Intro1[] = _("I'm not ready to give way"); +const u8 gMatchCallFlavorText_Expert_Timothy_Intro2[] = _("to the young yet!"); + +const u8 gMatchCallFlavorText_Expert_Shelby_Strategy[] = _("Attack while defending."); +const u8 gMatchCallFlavorText_Expert_Shelby_Pokemon[] = _("The FIGHTING type."); +const u8 gMatchCallFlavorText_Expert_Shelby_Intro1[] = _("Being old, I have my own"); +const u8 gMatchCallFlavorText_Expert_Shelby_Intro2[] = _("style of battling."); + +const u8 gMatchCallFlavorText_Youngster_Calvin_Strategy[] = _("I do what I can."); +const u8 gMatchCallFlavorText_Youngster_Calvin_Pokemon[] = _("I use different types."); +const u8 gMatchCallFlavorText_Youngster_Calvin_Intro1[] = _("I'm going to keep working"); +const u8 gMatchCallFlavorText_Youngster_Calvin_Intro2[] = _("until I beat a GYM LEADER."); + +const u8 gMatchCallFlavorText_Fisherman_Elliot_Strategy[] = _("I battle patiently."); +const u8 gMatchCallFlavorText_Fisherman_Elliot_Pokemon[] = _("WATER POKéMON to battle!"); +const u8 gMatchCallFlavorText_Fisherman_Elliot_Intro1[] = _("I'm the world's only guy to"); +const u8 gMatchCallFlavorText_Fisherman_Elliot_Intro2[] = _("catch a huge POKéMON!"); + +const u8 gMatchCallFlavorText_Triathlete_Isaiah_Strategy[] = _("Exploit the environment!"); +const u8 gMatchCallFlavorText_Triathlete_Isaiah_Pokemon[] = _("All hail the WATER type!"); +const u8 gMatchCallFlavorText_Triathlete_Isaiah_Intro1[] = _("I won't be beaten by some"); +const u8 gMatchCallFlavorText_Triathlete_Isaiah_Intro2[] = _("beach bum SWIMMER!"); + +const u8 gMatchCallFlavorText_Triathlete_Maria_Strategy[] = _("Speed above all!"); +const u8 gMatchCallFlavorText_Triathlete_Maria_Pokemon[] = _("I use a speedy POKéMON."); +const u8 gMatchCallFlavorText_Triathlete_Maria_Intro1[] = _("A marathon is a challenge"); +const u8 gMatchCallFlavorText_Triathlete_Maria_Intro2[] = _("against your own self."); + +const u8 gMatchCallFlavorText_Triathlete_Abigail_Strategy[] = _("Defense is crucial."); +const u8 gMatchCallFlavorText_Triathlete_Abigail_Pokemon[] = _("My POKéMON is solid."); +const u8 gMatchCallFlavorText_Triathlete_Abigail_Intro1[] = _("I started this for dieting,"); +const u8 gMatchCallFlavorText_Triathlete_Abigail_Intro2[] = _("but I got right into it."); + +const u8 gMatchCallFlavorText_Triathlete_Dylan_Strategy[] = _("Strike before stricken!"); +const u8 gMatchCallFlavorText_Triathlete_Dylan_Pokemon[] = _("A fast-running POKéMON!"); +const u8 gMatchCallFlavorText_Triathlete_Dylan_Intro1[] = _("If you ran and ran, you'd"); +const u8 gMatchCallFlavorText_Triathlete_Dylan_Intro2[] = _("become one with the wind."); + +const u8 gMatchCallFlavorText_Triathlete_Katelyn_Strategy[] = _("All-out offensive!"); +const u8 gMatchCallFlavorText_Triathlete_Katelyn_Pokemon[] = _("WATER POKéMON rule!"); +const u8 gMatchCallFlavorText_Triathlete_Katelyn_Intro1[] = _("I must swim over 6 miles"); +const u8 gMatchCallFlavorText_Triathlete_Katelyn_Intro2[] = _("every day."); + +const u8 gMatchCallFlavorText_Triathlete_Benjamin_Strategy[] = _("Push and push again!"); +const u8 gMatchCallFlavorText_Triathlete_Benjamin_Pokemon[] = _("The strength of STEEL."); +const u8 gMatchCallFlavorText_Triathlete_Benjamin_Intro1[] = _("If you're sweating, get"); +const u8 gMatchCallFlavorText_Triathlete_Benjamin_Intro2[] = _("fluids into you regularly."); + +const u8 gMatchCallFlavorText_Triathlete_Pablo_Strategy[] = _("Draw the power of WATER."); +const u8 gMatchCallFlavorText_Triathlete_Pablo_Pokemon[] = _("Toughened WATER POKéMON."); +const u8 gMatchCallFlavorText_Triathlete_Pablo_Intro1[] = _("Training POKéMON is good,"); +const u8 gMatchCallFlavorText_Triathlete_Pablo_Intro2[] = _("but don't neglect yourself."); + +const u8 gMatchCallFlavorText_DragonTamer_Nicolas_Strategy[] = _("It's about POKéMON power!"); +const u8 gMatchCallFlavorText_DragonTamer_Nicolas_Pokemon[] = _("See the power of DRAGONS!"); +const u8 gMatchCallFlavorText_DragonTamer_Nicolas_Intro1[] = _("I'll become legendary as the"); +const u8 gMatchCallFlavorText_DragonTamer_Nicolas_Intro2[] = _("strongest one day!"); + +const u8 gMatchCallFlavorText_BirdKeeper_Robert_Strategy[] = _("I'll show you my technique!"); +const u8 gMatchCallFlavorText_BirdKeeper_Robert_Pokemon[] = _("Elegantly wheeling BIRDS."); +const u8 gMatchCallFlavorText_BirdKeeper_Robert_Intro1[] = _("My BIRD POKéMON, deliver my"); +const u8 gMatchCallFlavorText_BirdKeeper_Robert_Intro2[] = _("love to that girl!"); + +const u8 gMatchCallFlavorText_NinjaBoy_Lao_Strategy[] = _("You'll suffer from poison!"); +const u8 gMatchCallFlavorText_NinjaBoy_Lao_Pokemon[] = _("Poisonous POKéMON."); +const u8 gMatchCallFlavorText_NinjaBoy_Lao_Intro1[] = _("I undertake training so"); +const u8 gMatchCallFlavorText_NinjaBoy_Lao_Intro2[] = _("that I may become a ninja."); + +const u8 gMatchCallFlavorText_BattleGirl_Cyndy_Strategy[] = _("The first strike wins!"); +const u8 gMatchCallFlavorText_BattleGirl_Cyndy_Pokemon[] = _("Speedy FIGHTING type."); +const u8 gMatchCallFlavorText_BattleGirl_Cyndy_Intro1[] = _("If my POKéMON lose,"); +const u8 gMatchCallFlavorText_BattleGirl_Cyndy_Intro2[] = _("I'll carry on the fight!"); + +const u8 gMatchCallFlavorText_ParasolLady_Madeline_Strategy[] = _("Go, go, my POKéMON!"); +const u8 gMatchCallFlavorText_ParasolLady_Madeline_Pokemon[] = _("I'll raise anything."); +const u8 gMatchCallFlavorText_ParasolLady_Madeline_Intro1[] = _("UV rays are your skin's"); +const u8 gMatchCallFlavorText_ParasolLady_Madeline_Intro2[] = _("enemy. Get protected."); + +const u8 gMatchCallFlavorText_Swimmer_Jenny_Strategy[] = _("No mercy!"); +const u8 gMatchCallFlavorText_Swimmer_Jenny_Pokemon[] = _("Cute WATER POKéMON."); +const u8 gMatchCallFlavorText_Swimmer_Jenny_Intro1[] = _("I have too many fans."); +const u8 gMatchCallFlavorText_Swimmer_Jenny_Intro2[] = _("I was interviewed on TV."); + +const u8 gMatchCallFlavorText_Picnicker_Diana_Strategy[] = _("I think about this & that."); +const u8 gMatchCallFlavorText_Picnicker_Diana_Pokemon[] = _("I like all POKéMON."); +const u8 gMatchCallFlavorText_Picnicker_Diana_Intro1[] = _("What lies beyond that"); +const u8 gMatchCallFlavorText_Picnicker_Diana_Intro2[] = _("yonder hill?"); + +const u8 gMatchCallFlavorText_Twins_AmyAndLiv_Strategy[] = _("We battle together!"); +const u8 gMatchCallFlavorText_Twins_AmyAndLiv_Pokemon[] = _("We train together!"); +const u8 gMatchCallFlavorText_Twins_AmyAndLiv_Intro1[] = _("We like the same POKéMON,"); +const u8 gMatchCallFlavorText_Twins_AmyAndLiv_Intro2[] = _("but different desserts."); + +const u8 gMatchCallFlavorText_Sailor_Ernest_Strategy[] = _("I force things with power!"); +const u8 gMatchCallFlavorText_Sailor_Ernest_Pokemon[] = _("WATER and FIGHTING types."); +const u8 gMatchCallFlavorText_Sailor_Ernest_Intro1[] = _("Seamen are rough spirits!"); +const u8 gMatchCallFlavorText_Sailor_Ernest_Intro2[] = _("Any complaints?"); + +const u8 gMatchCallFlavorText_Sailor_Cory_Strategy[] = _("Up for a fight anytime!"); +const u8 gMatchCallFlavorText_Sailor_Cory_Pokemon[] = _("WATER POKéMON are my faves!"); +const u8 gMatchCallFlavorText_Sailor_Cory_Intro1[] = _("If you want to shout loud,"); +const u8 gMatchCallFlavorText_Sailor_Cory_Intro2[] = _("suck in air with your belly!"); + +const u8 gMatchCallFlavorText_Collector_Edwin_Strategy[] = _("Protect POKéMON from harm."); +const u8 gMatchCallFlavorText_Collector_Edwin_Pokemon[] = _("I love rare POKéMON."); +const u8 gMatchCallFlavorText_Collector_Edwin_Intro1[] = _("I want to collect all the"); +const u8 gMatchCallFlavorText_Collector_Edwin_Intro2[] = _("world's rare POKéMON."); + +const u8 gMatchCallFlavorText_PkmnBreeder_Lydia_Strategy[] = _("I count on power."); +const u8 gMatchCallFlavorText_PkmnBreeder_Lydia_Pokemon[] = _("POKéMON are my children."); +const u8 gMatchCallFlavorText_PkmnBreeder_Lydia_Intro1[] = _("It takes knowledge and"); +const u8 gMatchCallFlavorText_PkmnBreeder_Lydia_Intro2[] = _("love to raise POKéMON."); + +const u8 gMatchCallFlavorText_PkmnBreeder_Isaac_Strategy[] = _("Full-on attack!"); +const u8 gMatchCallFlavorText_PkmnBreeder_Isaac_Pokemon[] = _("Anything. I'll raise it."); +const u8 gMatchCallFlavorText_PkmnBreeder_Isaac_Intro1[] = _("I give them {POKEBLOCK}S for"); +const u8 gMatchCallFlavorText_PkmnBreeder_Isaac_Intro2[] = _("going after CONTEST titles."); + +const u8 gMatchCallFlavorText_PkmnBreeder_Gabrielle_Strategy[] = _("I raise POKéMON with care."); +const u8 gMatchCallFlavorText_PkmnBreeder_Gabrielle_Pokemon[] = _("Fun-to-raise POKéMON."); +const u8 gMatchCallFlavorText_PkmnBreeder_Gabrielle_Intro1[] = _("Treat every POKéMON you"); +const u8 gMatchCallFlavorText_PkmnBreeder_Gabrielle_Intro2[] = _("meet with respect."); + +const u8 gMatchCallFlavorText_PkmnRanger_Catherine_Strategy[] = _("I believe in my POKéMON."); +const u8 gMatchCallFlavorText_PkmnRanger_Catherine_Pokemon[] = _("I like strong POKéMON."); +const u8 gMatchCallFlavorText_PkmnRanger_Catherine_Intro1[] = _("I'm training for rescue"); +const u8 gMatchCallFlavorText_PkmnRanger_Catherine_Intro2[] = _("work with my POKéMON."); + +const u8 gMatchCallFlavorText_PkmnRanger_Jackson_Strategy[] = _("Attack in waves!"); +const u8 gMatchCallFlavorText_PkmnRanger_Jackson_Pokemon[] = _("I use different types."); +const u8 gMatchCallFlavorText_PkmnRanger_Jackson_Intro1[] = _("Those who destroy nature"); +const u8 gMatchCallFlavorText_PkmnRanger_Jackson_Intro2[] = _("must never be forgiven!"); + +const u8 gMatchCallFlavorText_Lass_Haley_Strategy[] = _("I'll show you some guts!"); +const u8 gMatchCallFlavorText_Lass_Haley_Pokemon[] = _("Cute POKéMON are my faves!"); +const u8 gMatchCallFlavorText_Lass_Haley_Intro1[] = _("After a battle, I always"); +const u8 gMatchCallFlavorText_Lass_Haley_Intro2[] = _("bathe with my POKéMON."); + +const u8 gMatchCallFlavorText_BugCatcher_James_Strategy[] = _("Lightning-fast attack!"); +const u8 gMatchCallFlavorText_BugCatcher_James_Pokemon[] = _("BUG POKéMON are number 1!"); +const u8 gMatchCallFlavorText_BugCatcher_James_Intro1[] = _("If you want to catch BUG"); +const u8 gMatchCallFlavorText_BugCatcher_James_Intro2[] = _("POKéMON, wake up early."); + +const u8 gMatchCallFlavorText_Hiker_Trent_Strategy[] = _("I battle with power."); +const u8 gMatchCallFlavorText_Hiker_Trent_Pokemon[] = _("Hard-bodied POKéMON."); +const u8 gMatchCallFlavorText_Hiker_Trent_Intro1[] = _("I've been planning a month"); +const u8 gMatchCallFlavorText_Hiker_Trent_Intro2[] = _("for today's hike."); + +const u8 gMatchCallFlavorText_Hiker_Sawyer_Strategy[] = _("I like it hot!"); +const u8 gMatchCallFlavorText_Hiker_Sawyer_Pokemon[] = _("Hot POKéMON!"); +const u8 gMatchCallFlavorText_Hiker_Sawyer_Intro1[] = _("As much as I love POKéMON,"); +const u8 gMatchCallFlavorText_Hiker_Sawyer_Intro2[] = _("I surely like hiking!"); + +const u8 gMatchCallFlavorText_YoungCouple_LoisAndHal_Strategy[] = _("Lovey-dovey strategy!"); +const u8 gMatchCallFlavorText_YoungCouple_LoisAndHal_Pokemon[] = _("Lovey-dovey POKéMON!"); +const u8 gMatchCallFlavorText_YoungCouple_LoisAndHal_Intro1[] = _("We're lovey-dovey!"); +const u8 gMatchCallFlavorText_YoungCouple_LoisAndHal_Intro2[] = _("Forever lovey-dovey!"); + +const u8 gMatchCallFlavorText_PkmnTrainer_Wally_Strategy[] = _("We let it all hang out."); +const u8 gMatchCallFlavorText_PkmnTrainer_Wally_Pokemon[] = _("The 1st POKéMON I caught."); +const u8 gMatchCallFlavorText_PkmnTrainer_Wally_Intro1[] = _("POKéMON and I have grown"); +const u8 gMatchCallFlavorText_PkmnTrainer_Wally_Intro2[] = _("stronger together."); + +const u8 gMatchCallFlavorText_RockinWhiz_Roxanne_Strategy[] = _("ROCK-type power attack."); +const u8 gMatchCallFlavorText_RockinWhiz_Roxanne_Pokemon[] = _("I prefer rock-hard POKéMON."); +const u8 gMatchCallFlavorText_RockinWhiz_Roxanne_Intro1[] = _("A LEADER of a big GYM bears"); +const u8 gMatchCallFlavorText_RockinWhiz_Roxanne_Intro2[] = _("a lot of responsibility."); + +const u8 gMatchCallFlavorText_TheBigHit_Brawly_Strategy[] = _("Direct physical action!"); +const u8 gMatchCallFlavorText_TheBigHit_Brawly_Pokemon[] = _("FIGHTING POKéMON rule!"); +const u8 gMatchCallFlavorText_TheBigHit_Brawly_Intro1[] = _("The world awaits me as the"); +const u8 gMatchCallFlavorText_TheBigHit_Brawly_Intro2[] = _("next big wave!"); + +const u8 gMatchCallFlavorText_SwellShock_Wattson_Strategy[] = _("I choose to electrify."); +const u8 gMatchCallFlavorText_SwellShock_Wattson_Pokemon[] = _("Get shocked by electricity!"); +const u8 gMatchCallFlavorText_SwellShock_Wattson_Intro1[] = _("One must never throw a"); +const u8 gMatchCallFlavorText_SwellShock_Wattson_Intro2[] = _("match. Even I must not."); + +const u8 gMatchCallFlavorText_PassionBurn_Flannery_Strategy[] = _("Battle aggressively."); +const u8 gMatchCallFlavorText_PassionBurn_Flannery_Pokemon[] = _("Burn with passion!"); +const u8 gMatchCallFlavorText_PassionBurn_Flannery_Intro1[] = _("Completely wash away daily"); +const u8 gMatchCallFlavorText_PassionBurn_Flannery_Intro2[] = _("fatigue in hot springs!"); + +const u8 gMatchCallFlavorText_ReliableOne_Dad_Strategy[] = _("I flexibly adapt my style."); +const u8 gMatchCallFlavorText_ReliableOne_Dad_Pokemon[] = _("Grown in a balanced manner."); +const u8 gMatchCallFlavorText_ReliableOne_Dad_Intro1[] = _("I walk the 30 minutes from"); +const u8 gMatchCallFlavorText_ReliableOne_Dad_Intro2[] = _("home to here every day."); + +const u8 gMatchCallFlavorText_SkyTamer_Winona_Strategy[] = _("I take advantage of speed."); +const u8 gMatchCallFlavorText_SkyTamer_Winona_Pokemon[] = _("Graceful sky dancers."); +const u8 gMatchCallFlavorText_SkyTamer_Winona_Intro1[] = _("The ultimate would be to"); +const u8 gMatchCallFlavorText_SkyTamer_Winona_Intro2[] = _("live as one with nature."); + +const u8 gMatchCallFlavorText_MysticDuo_TateAndLiza_Strategy[] = _("We battle in cooperation."); +const u8 gMatchCallFlavorText_MysticDuo_TateAndLiza_Pokemon[] = _("Always friendly POKéMON."); +const u8 gMatchCallFlavorText_MysticDuo_TateAndLiza_Intro1[] = _("Papa has trouble telling"); +const u8 gMatchCallFlavorText_MysticDuo_TateAndLiza_Intro2[] = _("the two of us apart!"); + +const u8 gMatchCallFlavorText_DandyCharm_Juan_Strategy[] = _("I use splendid waterpower."); +const u8 gMatchCallFlavorText_DandyCharm_Juan_Pokemon[] = _("POKéMON of elegance!"); +const u8 gMatchCallFlavorText_DandyCharm_Juan_Intro1[] = _("The adulation of beautiful"); +const u8 gMatchCallFlavorText_DandyCharm_Juan_Intro2[] = _("ladies fills me with energy!"); + +const u8 gMatchCallFlavorText_EliteFour_Sidney_Strategy[] = _("Offense over defense!"); +const u8 gMatchCallFlavorText_EliteFour_Sidney_Pokemon[] = _("The DARK side's beauties."); +const u8 gMatchCallFlavorText_EliteFour_Sidney_Intro1[] = _("They said I was a punk, but"); +const u8 gMatchCallFlavorText_EliteFour_Sidney_Intro2[] = _("I'm one of the ELITE FOUR!"); + +const u8 gMatchCallFlavorText_EliteFour_Phoebe_Strategy[] = _("Confuse and confound."); +const u8 gMatchCallFlavorText_EliteFour_Phoebe_Pokemon[] = _("There's nothing definite."); +const u8 gMatchCallFlavorText_EliteFour_Phoebe_Intro1[] = _("I wonder how my grandma at"); +const u8 gMatchCallFlavorText_EliteFour_Phoebe_Intro2[] = _("MT. PYRE is doing?"); + +const u8 gMatchCallFlavorText_EliteFour_Glacia_Strategy[] = _("I use items for help."); +const u8 gMatchCallFlavorText_EliteFour_Glacia_Pokemon[] = _("Flaming passion in icy cold!"); +const u8 gMatchCallFlavorText_EliteFour_Glacia_Intro1[] = _("The ICE type can be better"); +const u8 gMatchCallFlavorText_EliteFour_Glacia_Intro2[] = _("trained in this hot land."); + +const u8 gMatchCallFlavorText_EliteFour_Drake_Strategy[] = _("Harness strong abilities."); +const u8 gMatchCallFlavorText_EliteFour_Drake_Pokemon[] = _("The raw power of DRAGONS!"); +const u8 gMatchCallFlavorText_EliteFour_Drake_Intro1[] = _("I dedicate myself to the"); +const u8 gMatchCallFlavorText_EliteFour_Drake_Intro2[] = _("POKéMON that saved me."); + +const u8 gMatchCallFlavorText_Champion_Wallace_Strategy[] = _("Dignity and respect."); +const u8 gMatchCallFlavorText_Champion_Wallace_Pokemon[] = _("I prefer POKéMON of grace."); +const u8 gMatchCallFlavorText_Champion_Wallace_Intro1[] = _("I represent beauty as"); +const u8 gMatchCallFlavorText_Champion_Wallace_Intro2[] = _("well as intelligence."); + +const u8 *const gMatchCallMessages[][4] = +{ + [REMATCH_ROSE] = MCFLAVOR(AromaLady_Rose), + [REMATCH_ANDRES] = MCFLAVOR(RuinManiac_Andres), + [REMATCH_DUSTY] = MCFLAVOR(RuinManiac_Dusty), + [REMATCH_LOLA] = MCFLAVOR(Tuber_Lola), + [REMATCH_RICKY] = MCFLAVOR(Tuber_Ricky), + [REMATCH_LILA_AND_ROY] = MCFLAVOR(SisAndBro_LilaAndRoy), + [REMATCH_CRISTIN] = MCFLAVOR(Cooltrainer_Cristin), + [REMATCH_BROOKE] = MCFLAVOR(Cooltrainer_Brooke), + [REMATCH_WILTON] = MCFLAVOR(Cooltrainer_Wilton), + [REMATCH_VALERIE] = MCFLAVOR(HexManiac_Valerie), + [REMATCH_CINDY] = MCFLAVOR(Lady_Cindy), + [REMATCH_THALIA] = MCFLAVOR(Beauty_Thalia), + [REMATCH_JESSICA] = MCFLAVOR(Beauty_Jessica), + [REMATCH_WINSTON] = MCFLAVOR(RichBoy_Winston), + [REMATCH_STEVE] = MCFLAVOR(PokeManiac_Steve), + [REMATCH_TONY] = MCFLAVOR(Swimmer_Tony), + [REMATCH_NOB] = MCFLAVOR(BlackBelt_Nob), + [REMATCH_KOJI] = MCFLAVOR(BlackBelt_Koji), + [REMATCH_FERNANDO] = MCFLAVOR(Guitarist_Fernando), + [REMATCH_DALTON] = MCFLAVOR(Guitarist_Dalton), + [REMATCH_BERNIE] = MCFLAVOR(Kindler_Bernie), + [REMATCH_ETHAN] = MCFLAVOR(Camper_Ethan), + [REMATCH_JOHN_AND_JAY] = MCFLAVOR(OldCouple_JohnAndJay), + [REMATCH_JEFFREY] = MCFLAVOR(BugManiac_Jeffrey), + [REMATCH_CAMERON] = MCFLAVOR(Psychic_Cameron), + [REMATCH_JACKI] = MCFLAVOR(Psychic_Jacki), + [REMATCH_WALTER] = MCFLAVOR(Gentleman_Walter), + [REMATCH_KAREN] = MCFLAVOR(SchoolKid_Karen), + [REMATCH_JERRY] = MCFLAVOR(SchoolKid_Jerry), + [REMATCH_ANNA_AND_MEG] = MCFLAVOR(SrAndJr_AnnaAndMeg), + [REMATCH_ISABEL] = MCFLAVOR(Pokefan_Isabel), + [REMATCH_MIGUEL] = MCFLAVOR(Pokefan_Miguel), + [REMATCH_TIMOTHY] = MCFLAVOR(Expert_Timothy), + [REMATCH_SHELBY] = MCFLAVOR(Expert_Shelby), + [REMATCH_CALVIN] = MCFLAVOR(Youngster_Calvin), + [REMATCH_ELLIOT] = MCFLAVOR(Fisherman_Elliot), + [REMATCH_ISAIAH] = MCFLAVOR(Triathlete_Isaiah), + [REMATCH_MARIA] = MCFLAVOR(Triathlete_Maria), + [REMATCH_ABIGAIL] = MCFLAVOR(Triathlete_Abigail), + [REMATCH_DYLAN] = MCFLAVOR(Triathlete_Dylan), + [REMATCH_KATELYN] = MCFLAVOR(Triathlete_Katelyn), + [REMATCH_BENJAMIN] = MCFLAVOR(Triathlete_Benjamin), + [REMATCH_PABLO] = MCFLAVOR(Triathlete_Pablo), + [REMATCH_NICOLAS] = MCFLAVOR(DragonTamer_Nicolas), + [REMATCH_ROBERT] = MCFLAVOR(BirdKeeper_Robert), + [REMATCH_LAO] = MCFLAVOR(NinjaBoy_Lao), + [REMATCH_CYNDY] = MCFLAVOR(BattleGirl_Cyndy), + [REMATCH_MADELINE] = MCFLAVOR(ParasolLady_Madeline), + [REMATCH_JENNY] = MCFLAVOR(Swimmer_Jenny), + [REMATCH_DIANA] = MCFLAVOR(Picnicker_Diana), + [REMATCH_AMY_AND_LIV] = MCFLAVOR(Twins_AmyAndLiv), + [REMATCH_ERNEST] = MCFLAVOR(Sailor_Ernest), + [REMATCH_CORY] = MCFLAVOR(Sailor_Cory), + [REMATCH_EDWIN] = MCFLAVOR(Collector_Edwin), + [REMATCH_LYDIA] = MCFLAVOR(PkmnBreeder_Lydia), + [REMATCH_ISAAC] = MCFLAVOR(PkmnBreeder_Isaac), + [REMATCH_GABRIELLE] = MCFLAVOR(PkmnBreeder_Gabrielle), + [REMATCH_CATHERINE] = MCFLAVOR(PkmnRanger_Catherine), + [REMATCH_JACKSON] = MCFLAVOR(PkmnRanger_Jackson), + [REMATCH_HALEY] = MCFLAVOR(Lass_Haley), + [REMATCH_JAMES] = MCFLAVOR(BugCatcher_James), + [REMATCH_TRENT] = MCFLAVOR(Hiker_Trent), + [REMATCH_SAWYER] = MCFLAVOR(Hiker_Sawyer), + [REMATCH_KIRA_AND_DAN] = MCFLAVOR(YoungCouple_LoisAndHal), + [REMATCH_WALLY_3] = MCFLAVOR(PkmnTrainer_Wally), + [REMATCH_ROXANNE] = MCFLAVOR(RockinWhiz_Roxanne), + [REMATCH_BRAWLY] = MCFLAVOR(TheBigHit_Brawly), + [REMATCH_WATTSON] = MCFLAVOR(SwellShock_Wattson), + [REMATCH_FLANNERY] = MCFLAVOR(PassionBurn_Flannery), + [REMATCH_NORMAN] = MCFLAVOR(ReliableOne_Dad), + [REMATCH_WINONA] = MCFLAVOR(SkyTamer_Winona), + [REMATCH_TATE_AND_LIZA] = MCFLAVOR(MysticDuo_TateAndLiza), + [REMATCH_JUAN] = MCFLAVOR(DandyCharm_Juan), + [REMATCH_SIDNEY] = MCFLAVOR(EliteFour_Sidney), + [REMATCH_PHOEBE] = MCFLAVOR(EliteFour_Phoebe), + [REMATCH_GLACIA] = MCFLAVOR(EliteFour_Glacia), + [REMATCH_DRAKE] = MCFLAVOR(EliteFour_Drake), + [REMATCH_WALLACE] = MCFLAVOR(Champion_Wallace), +}; diff --git a/src/data/text/ribbon_descriptions.h b/src/data/text/ribbon_descriptions.h new file mode 100644 index 000000000..f455a7771 --- /dev/null +++ b/src/data/text/ribbon_descriptions.h @@ -0,0 +1,48 @@ +const u8 gRibbonDescriptionPart1_Champion[] = _("CHAMPION-beating, HALL"); +const u8 gRibbonDescriptionPart2_Champion[] = _("OF FAME Member RIBBON"); +const u8 gRibbonDescriptionPart1_CoolContest[] = _("COOL CONTEST"); +const u8 gRibbonDescriptionPart1_BeautyContest[] = _("BEAUTY CONTEST"); +const u8 gRibbonDescriptionPart1_CuteContest[] = _("CUTE CONTEST"); +const u8 gRibbonDescriptionPart1_SmartContest[] = _("SMART CONTEST"); +const u8 gRibbonDescriptionPart1_ToughContest[] = _("TOUGH CONTEST"); +const u8 gRibbonDescriptionPart2_NormalRank[] = _("Normal Rank winner!"); +const u8 gRibbonDescriptionPart2_SuperRank[] = _("Super Rank winner!"); +const u8 gRibbonDescriptionPart2_HyperRank[] = _("Hyper Rank winner!"); +const u8 gRibbonDescriptionPart2_MasterRank[] = _("Master Rank winner!"); +const u8 gRibbonDescriptionPart1_Winning[] = _("For clearing LV50"); +const u8 gRibbonDescriptionPart2_Winning[] = _("at the BATTLE TOWER."); +const u8 gRibbonDescriptionPart1_Victory[] = _("For clearing Open Level"); +const u8 gRibbonDescriptionPart2_Victory[] = _("at the BATTLE TOWER."); +const u8 gRibbonDescriptionPart1_Artist[] = _("RIBBON for being chosen"); +const u8 gRibbonDescriptionPart2_Artist[] = _("as a super sketch model."); +const u8 gRibbonDescriptionPart1_Effort[] = _("RIBBON awarded for"); +const u8 gRibbonDescriptionPart2_Effort[] = _("being a hard worker."); + +const u8 *const gRibbonDescriptionPointers[][2] = +{ + {gRibbonDescriptionPart1_Champion, gRibbonDescriptionPart2_Champion}, + {gRibbonDescriptionPart1_CoolContest, gRibbonDescriptionPart2_NormalRank}, + {gRibbonDescriptionPart1_CoolContest, gRibbonDescriptionPart2_SuperRank}, + {gRibbonDescriptionPart1_CoolContest, gRibbonDescriptionPart2_HyperRank}, + {gRibbonDescriptionPart1_CoolContest, gRibbonDescriptionPart2_MasterRank}, + {gRibbonDescriptionPart1_BeautyContest, gRibbonDescriptionPart2_NormalRank}, + {gRibbonDescriptionPart1_BeautyContest, gRibbonDescriptionPart2_SuperRank}, + {gRibbonDescriptionPart1_BeautyContest, gRibbonDescriptionPart2_HyperRank}, + {gRibbonDescriptionPart1_BeautyContest, gRibbonDescriptionPart2_MasterRank}, + {gRibbonDescriptionPart1_CuteContest, gRibbonDescriptionPart2_NormalRank}, + {gRibbonDescriptionPart1_CuteContest, gRibbonDescriptionPart2_SuperRank}, + {gRibbonDescriptionPart1_CuteContest, gRibbonDescriptionPart2_HyperRank}, + {gRibbonDescriptionPart1_CuteContest, gRibbonDescriptionPart2_MasterRank}, + {gRibbonDescriptionPart1_SmartContest, gRibbonDescriptionPart2_NormalRank}, + {gRibbonDescriptionPart1_SmartContest, gRibbonDescriptionPart2_SuperRank}, + {gRibbonDescriptionPart1_SmartContest, gRibbonDescriptionPart2_HyperRank}, + {gRibbonDescriptionPart1_SmartContest, gRibbonDescriptionPart2_MasterRank}, + {gRibbonDescriptionPart1_ToughContest, gRibbonDescriptionPart2_NormalRank}, + {gRibbonDescriptionPart1_ToughContest, gRibbonDescriptionPart2_SuperRank}, + {gRibbonDescriptionPart1_ToughContest, gRibbonDescriptionPart2_HyperRank}, + {gRibbonDescriptionPart1_ToughContest, gRibbonDescriptionPart2_MasterRank}, + {gRibbonDescriptionPart1_Winning, gRibbonDescriptionPart2_Winning}, + {gRibbonDescriptionPart1_Victory, gRibbonDescriptionPart2_Victory}, + {gRibbonDescriptionPart1_Artist, gRibbonDescriptionPart2_Artist}, + {gRibbonDescriptionPart1_Effort, gRibbonDescriptionPart2_Effort}, +}; diff --git a/src/dma3_manager.c b/src/dma3_manager.c index 51fa7072d..43744883f 100644 --- a/src/dma3_manager.c +++ b/src/dma3_manager.c @@ -8,7 +8,7 @@ #define DMA_REQUEST_COPY16 3 #define DMA_REQUEST_FILL16 4 -IWRAM_DATA struct +BSS_DATA struct { const u8 *src; u8 *dest; @@ -17,7 +17,7 @@ IWRAM_DATA struct u32 value; } gDma3Requests[MAX_DMA_REQUESTS]; -static bool8 gDma3ManagerLocked; +static volatile bool8 gDma3ManagerLocked; static u8 gDma3RequestCursor; void ClearDma3Requests(void) diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 29bc1f1d5..714b10ef6 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -1,249 +1,456 @@ #include "global.h" #include "alloc.h" -#include "palette.h" -#include "window.h" #include "bg.h" +#include "dodrio_berry_picking.h" +#include "dynamic_placeholder_text_util.h" +#include "event_data.h" #include "gpu_regs.h" -#include "random.h" +#include "international_string_util.h" +#include "item.h" #include "link.h" #include "link_rfu.h" -#include "task.h" -#include "main.h" -#include "constants/songs.h" -#include "sound.h" #include "m4a.h" +#include "main.h" +#include "palette.h" #include "pokemon_jump.h" +#include "random.h" +#include "save.h" +#include "script.h" +#include "sound.h" +#include "string_util.h" +#include "strings.h" +#include "task.h" +#include "text_window.h" +#include "window.h" +#include "constants/items.h" +#include "constants/songs.h" +#include "constants/species.h" -struct DodrioBerryPickingSubstruct_0160 +struct DodrioSubstruct_0160 { - /*0x0000 : 0x0160*/ u8 filler_000[12]; - /*0x000C : 0x016C*/ u8 unk_00C; - /*0x000D : 0x016D*/ u8 filler_00D[0x3000 - 0xd]; - /*0x3000 : 0x3160*/ u32 unk_3000; - /*0x3004 : 0x3164*/ u8 filler_3004[16]; - /*0x3014 : 0x3174*/ u8 unk_3014; - /*0x3015 : 0x3175*/ u8 filler_3015[0x318C - 0x3175]; + /*0x0000 : 0x3000*/ u16 ALIGNED(4) tilemapBuffers[3][BG_SCREEN_SIZE]; + /*0x3000 : 0x3160*/ bool32 finished; + /*0x3004 : 0x3164*/ u8 ALIGNED(4) unk3004; + /*0x3008 : 0x3168*/ u8 ALIGNED(4) unk3008[10]; + /*0x3014 : 0x3174*/ u8 ALIGNED(4) state; + /*0x3018 : 0x3178*/ u8 ALIGNED(4) unk3018; + /*0x301C : 0x317C*/ u16 ALIGNED(4) unk301C; + /*0x3020 : 0x3180*/ u8 ALIGNED(4) unk3020; + /*0x3024 : 0x3184*/ u8 ALIGNED(4) unk3024; + /*0x3024 : 0x3184*/ void (*unk3028)(void); }; // size = 0x302C -struct DodrioBerryPickingStruct_2022CF4 +struct DodrioStruct_2022CF4 { - u8 filler_00[0x40]; + u8 filler_00[0xc]; + u8 unkC[10]; + s16 unk16[10]; + u16 unk2A[10]; + u16 unk3E; }; // size = 0x40 -struct DodrioBerryPickingSubstruct_31A0_14 +struct DodrioSubstruct_31A0_14 { - u8 unk_0[11]; - u8 unk_B[11]; + u8 unk0[11]; + u8 unkB[11]; }; -struct DodrioBerryPickingSubstruct_31A0 +struct DodrioSubstruct_31A0_2C { - u8 unk_00[0x10]; - u32 unk_10; - struct DodrioBerryPickingSubstruct_31A0_14 unk_14; - u8 unk_2C; - u8 filler_2D[3]; - u8 unk_30; - u8 filler_31[3]; - u8 unk_34; - u8 filler_35[7]; + u8 unk0; + u8 ALIGNED(4) unk4; + u8 ALIGNED(4) unk8; +}; + +struct DodrioSubstruct_31A0 +{ + u8 name[0x10]; + u32 unk10; + struct DodrioSubstruct_31A0_14 unk14; + struct DodrioSubstruct_31A0_2C unk2C; + u8 filler_35[4]; }; // size = 0x3C -struct DodrioBerryPickingSubstruct_318C +struct DodrioSubstruct_318C { bool8 isShiny; }; -struct DodrioBerryPickingStruct +struct DodrioSubstruct_3308 +{ + u8 unk0; + u32 unk4; +}; + +struct DodrioStruct { /*0x0000*/ void (*savedCallback)(void); - /*0x0004*/ u8 unk_0004; - /*0x0005*/ u8 filler_0005[3]; - /*0x0008*/ u8 unk_0008; - /*0x0009*/ u8 filler_0009[3]; - /*0x000C*/ u8 unk_000C; - /*0x000D*/ u8 filler_000D[3]; - /*0x0010*/ u8 unk_0010; - /*0x0011*/ u8 filler_0011[3]; - /*0x0014*/ u8 unk_0014; - /*0x0015*/ u8 filler_0015[3]; - /*0x0018*/ u8 unk_0018; - /*0x0019*/ u8 filler_0019[3]; - /*0x001C*/ u8 unk_001C; - /*0x001D*/ u8 filler_001D[3]; - /*0x0020*/ u8 unk_0020; - /*0x0021*/ u8 filler_0021[3]; - /*0x0024*/ u8 unk_0024; - /*0x0025*/ u8 filler_0025[3]; - /*0x0028*/ u8 multiplayerId; + /*0x0004*/ u8 ALIGNED(4) unk04; + /*0x0008*/ u8 ALIGNED(4) unk08; + /*0x000C*/ u8 ALIGNED(4) unk0C; + /*0x0010*/ u8 ALIGNED(4) unk10; + /*0x0014*/ u8 ALIGNED(4) unk14; + /*0x0018*/ u8 ALIGNED(4) unk18; + /*0x001C*/ u8 ALIGNED(4) unk1C; + /*0x0020*/ u8 ALIGNED(4) unk20; + /*0x0024*/ u8 ALIGNED(4) unk24; + /*0x0028*/ u8 ALIGNED(4) multiplayerId; /*0x0029*/ u8 filler_0029[7]; - /*0x0030*/ u8 unk_0030; - /*0x0031*/ u8 filler_0031[3]; - /*0x0034*/ u8 unk_0034[5]; - /*0x0039*/ u8 filler_0039[3]; - /*0x003C*/ u8 unk_003C; - /*0x003D*/ u8 filler_003D[3]; - /*0x0040*/ u8 unk_0040; - /*0x0041*/ u8 filler_0041[3]; - /*0x0044*/ u8 unk_0044; - /*0x0045*/ u8 filler_0045[3]; - /*0x0048*/ u8 unk_0048; - // align 1 - /*0x004A*/ u16 unk_004A[5][6]; - /*0x0086*/ u16 unk_0086[5]; - /*0x0090*/ u8 unk_0090[5]; - /*0x0095*/ u8 filler_0095[3]; - /*0x0098*/ u8 unk_0098[4]; - /*0x009C*/ u8 unk_009C[12]; - /*0x00A8*/ u8 unk_00A8[5]; - /*0x00AD*/ u8 filler_00AD[3]; - /*0x00B0*/ u8 unk_00B0[5]; - /*0x00B5*/ u8 filler_00B5[3]; - /*0x00B8*/ u8 unk_00B8[5]; - /*0x00BD*/ u8 filler_00BD[7]; - /*0x00C4*/ u8 unk_00C4[11]; - /*0x00CF*/ u8 filler_00CF[1]; - /*0x00D0*/ u8 unk_00D0[11]; - /*0x00DB*/ u8 filler_00DB[1]; - /*0x00DC*/ u8 unk_00DC[11]; - /*0x00E7*/ u8 filler_0xE7[1]; - /*0x00E8*/ u8 unk_00E8[5]; - /*0x00ED*/ u8 filler_00ED[7]; - /*0x00F4*/ u8 unk_00F4[11][2]; - /*0x010A*/ u8 filler_010A[2]; - /*0x010C*/ u8 unk_010C[5]; - /*0x0111*/ u8 filler_0111[3]; - /*0x0114*/ u16 unk_0114; - // align 2 - /*0x0118*/ u32 unk_0118; - /*0x011C*/ u32 unk_011C; - /*0x0120*/ u32 unk_0120; - /*0x0124*/ u8 unk_0124; - /*0x0125*/ u8 filler_0125[3]; - /*0x0128*/ u8 unk_0128; - // align 2 - /*0x012C*/ u32 unk_012C; - /*0x0130*/ u32 unk_0130[5]; - /*0x0144*/ u8 unk_0144; - /*0x0145*/ u8 filler_0145[3]; - /*0x0148*/ u8 unk_0148[11]; - /*0x0153*/ u8 filler_0153[1]; - /*0x0154*/ u8 unk_0154; - /*0x0155*/ u8 filler_0155[11]; - /*0x0160*/ struct DodrioBerryPickingSubstruct_0160 unk_0160; - /*0x318C*/ struct DodrioBerryPickingSubstruct_318C unk_318C[5]; - /*0x31A0*/ struct DodrioBerryPickingSubstruct_31A0 unk_31A0[5]; - /*0x32CC*/ struct DodrioBerryPickingSubstruct_31A0 unk_32CC; - /*0x3308*/ u8 unk_3308[0x3330 - 0x3308]; + /*0x0030*/ u8 ALIGNED(4) unk30; + /*0x0034*/ u8 ALIGNED(4) unk34[5]; + /*0x003C*/ u8 ALIGNED(4) unk3C; + /*0x0040*/ u8 ALIGNED(4) unk40; + /*0x0044*/ u8 ALIGNED(4) unk44; + /*0x0048*/ u8 ALIGNED(4) unk48; + /*0x004A*/ u16 unk4A[5][6]; + /*0x0086*/ u16 unk86[5]; + /*0x0090*/ u8 ALIGNED(4) unk90[5]; + /*0x0098*/ u8 ALIGNED(4) unk98[4]; + /*0x009C*/ u8 ALIGNED(4) unk9C[11]; + /*0x00A8*/ u8 ALIGNED(4) unkA8[5]; + /*0x00B0*/ u8 ALIGNED(4) unkB0[5]; + /*0x00B8*/ u8 ALIGNED(4) unkB8[11]; + /*0x00C4*/ u8 ALIGNED(4) unkC4[11]; + /*0x00D0*/ u8 ALIGNED(4) unkD0[11]; + /*0x00DC*/ u8 ALIGNED(4) unkDC[11]; + /*0x00E8*/ u8 ALIGNED(4) unkE8[11]; + /*0x00F4*/ u8 ALIGNED(4) unkF4[11][2]; + /*0x010C*/ u8 ALIGNED(4) unk10C[5]; + /*0x0112*/ u16 unk112; + /*0x0114*/ u16 unk114; + /*0x0118*/ u32 unk118; + /*0x011C*/ u32 unk11C; + /*0x0120*/ u32 unk120; + /*0x0124*/ u8 ALIGNED(4) unk124; + /*0x0128*/ u8 ALIGNED(4) unk128; + /*0x012C*/ u32 unk12C; + /*0x0130*/ u32 unk130[5]; + /*0x0144*/ u8 ALIGNED(4) unk144; + /*0x0148*/ u8 ALIGNED(4) unk148[11]; + /*0x0154*/ u8 ALIGNED(4) unk154; + /*0x0158*/ u8 ALIGNED(4) unk158[5]; + /*0x0160*/ struct DodrioSubstruct_0160 unk160; + /*0x318C*/ struct DodrioSubstruct_318C unk318C[5]; + /*0x31A0*/ struct DodrioSubstruct_31A0 unk31A0[5]; + /*0x32CC*/ struct DodrioSubstruct_31A0 unk32CC; + /*0x3308*/ struct DodrioSubstruct_3308 unk3308[5]; }; // size = 0x3330 -EWRAM_DATA struct DodrioBerryPickingStruct * gUnknown_02022C98 = NULL; -EWRAM_DATA u16 * gUnknown_02022C9C[5] = {NULL}; -EWRAM_DATA u16 * gUnknown_02022CB0[2] = {NULL}; -EWRAM_DATA u16 * gUnknown_02022CB8[11] = {NULL}; -EWRAM_DATA u16 * gUnknown_02022CE4[4] = {NULL}; -EWRAM_DATA struct DodrioBerryPickingStruct_2022CF4 * gUnknown_02022CF4 = NULL; -EWRAM_DATA struct DodrioBerryPickingSubstruct_0160 * gUnknown_02022CF8 = NULL; +EWRAM_DATA static struct DodrioStruct * gUnknown_02022C98 = NULL; +EWRAM_DATA static u16 *gUnknown_02022C9C[5] = {NULL}; +EWRAM_DATA static u16 *gUnknown_02022CB0[2] = {NULL}; +EWRAM_DATA static u16 *gUnknown_02022CB8[11] = {NULL}; +EWRAM_DATA static u16 *gUnknown_02022CE4[4] = {NULL}; +EWRAM_DATA static struct DodrioStruct_2022CF4 *gUnknown_02022CF4 = NULL; +EWRAM_DATA static struct DodrioSubstruct_0160 *gUnknown_02022CF8 = NULL; -IWRAM_DATA bool32 gUnknown_03000DB0; +static bool32 gUnknown_03000DB0; -void sub_8024A1C(void); -void sub_8024A30(struct DodrioBerryPickingStruct *); -void sub_8024BC8(u8 taskId); -void sub_8024DBC(void); -void sub_8024E00(void); -void sub_8024E38(void); -void sub_8024F10(void); -void sub_8024F38(void); -void sub_8024FFC(void); -void sub_80250D4(void); -void sub_8025158(void); -void sub_8025198(void); -void sub_8025230(void); -void sub_8025324(void); -void sub_8025470(void); -void sub_8025644(void); -void sub_80256AC(void); -void sub_8025758(void); -void sub_802589C(u8 taskId); -void sub_8025910(u8 taskId); -void sub_8025D04(void); -void sub_8025D50(void); -void sub_8025E0C(void); -void sub_8025ED8(void); -void sub_8025F48(void); -void sub_8026044(void); -void sub_80261CC(void); -void sub_80261E4(void); -void sub_80261F8(struct DodrioBerryPickingSubstruct_318C *, struct Pokemon *); -void sub_802620C(TaskFunc, u8); -void sub_802621C(TaskFunc); -void sub_8026240(u8); -bool32 sub_8026264(void); -void sub_80262C0(void); -u32 sub_8026634(u8, u8, u8); -void sub_802671C(void); -void sub_8026AF4(void); -void sub_8026B28(void); -void sub_8026B5C(u8, u8*, u8*); -u32 sub_8026BB8(void); -void sub_8026C28(void); -bool32 sub_8026C50(void); -bool32 sub_8026C90(void); -void sub_8026D1C(u8); -u8 sub_8026D8C(u8); -u8 sub_8026DB0(u8, u8); -void sub_8026F1C(u8, u8, u8); -void sub_8027234(u8); -void sub_80272A4(void); -void sub_80272E8(void); -void sub_80273F0(void); -void sub_802749C(void); -u8 sub_8027518(u8); -void sub_8027554(void); -void sub_8027608(void); -u32 sub_8027748(void); -void sub_8027DD0(u8); -u32 sub_8027E30(struct DodrioBerryPickingSubstruct_31A0 *, u8 *, u8 *, u8 *, u8 *, u8 *, u8, u32, u32); -u32 sub_8028164(u32 unused, struct DodrioBerryPickingSubstruct_31A0 *, u8 *, u8 *, u8 *, u8 *, u8 *, u8 *, u32 *, u32 *); -void sub_80282EC(u8); -u32 sub_8028318(u8, u8 *); -void sub_8028350(u8); -bool32 sub_8028374(u8); -void sub_80283A8(void); -void sub_8028408(struct DodrioBerryPickingSubstruct_318C *, u8, u8, u8); -void sub_80284CC(u8); -void sub_8028504(u8); -void sub_8028614(u8); -void sub_802868C(u8, u8); -void sub_8028734(void); -void sub_80287E4(void); -void sub_80289E8(u8); -void sub_80286E4(void); -bool32 sub_8028828(void); -void sub_8028A34(void); -void sub_8028A88(void); -void sub_8028B80(void); -void sub_8028D44(void); -void sub_8028DFC(void); -void sub_8028E4C(void); -void sub_8028E84(void); -void sub_8028EC8(u8); -void sub_8028FCC(void); -void sub_802903C(void); -void sub_8029274(struct DodrioBerryPickingSubstruct_0160 *); -void sub_80292E0(u8); -bool32 sub_802A770(void); -u8 sub_802A794(void); +static void sub_8024A1C(void); +static void sub_8024A30(struct DodrioStruct *); +static void sub_8024BC8(u8 taskId); +static void sub_8024DBC(void); +static void sub_8024E00(void); +static void sub_8024E38(void); +static void sub_8024F10(void); +static void sub_8024F38(void); +static void sub_8024FFC(void); +static void sub_80250D4(void); +static void sub_8025158(void); +static void sub_8025198(void); +static void sub_8025230(void); +static void sub_8025324(void); +static void sub_8025470(void); +static void sub_8025644(void); +static void sub_80256AC(void); +static void sub_8025758(void); +static void sub_802589C(u8 taskId); +static void sub_8025910(u8 taskId); +static void sub_8025D04(void); +static void sub_8025D50(void); +static void sub_8025E0C(void); +static void sub_8025ED8(void); +static void sub_8025F48(void); +static void sub_8026044(void); +static void sub_80261CC(void); +static void sub_80261E4(void); +static void sub_80261F8(struct DodrioSubstruct_318C *, struct Pokemon *); +static void sub_802620C(TaskFunc, u8); +static void sub_802621C(TaskFunc); +static void sub_8026240(u8); +static bool32 sub_8026264(void); +static void sub_80262C0(void); +static bool32 sub_8026634(u8, u8, u8); +static void sub_802671C(void); +static void sub_8026AF4(void); +static void sub_8026B28(void); +static void sub_8026B5C(u8, u8*, u8*); +static bool32 sub_8026BB8(void); +static void sub_8026C28(void); +static bool32 sub_8026C50(void); +static bool32 sub_8026C90(void); +static void sub_8026D1C(u8); +static u8 sub_8026D8C(u8); +static u8 sub_8026DB0(u8, u8); +static void sub_8026F1C(u8, u8, u8); +static void sub_8027234(bool32 arg0); +static void sub_80272A4(void); +static void sub_80272E8(void); +static void sub_80273F0(void); +static void sub_802749C(void); +static u8 sub_8027518(u8); +static void sub_8027554(void); +static void sub_8027608(void); +static u32 sub_8027748(void); +static void sub_8027DD0(u32 arg0); +static void sub_8027E30(struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 arg6, u32 arg7, u32 arg8); +static u32 sub_8028164(u32 unused, struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 *arg6, u32 *arg7, u32 *arg8); +static void sub_80282EC(u8); +static u32 sub_8028318(u32 arg0, u8 *arg1); +static void sub_8028350(u32 arg0); +static u32 sub_8028374(u32 arg0); +static void sub_80283A8(void); +static void sub_8028408(struct DodrioSubstruct_318C *arg0, u8 arg1, u8 id, u8 arg3); +static void sub_80284CC(u8); +static void sub_8028504(u8); +static void sub_8028614(u8 count); +static void sub_802868C(bool8 invisible, u8 count); +static void sub_8028734(void); +static void sub_80287E4(void); +static void sub_80289E8(bool8 invisible); +static void sub_80286E4(void); +static bool32 sub_8028828(void); +static void sub_8028A34(void); +static void sub_8028A88(void); +static void sub_8028B80(void); +static void sub_8028D44(void); +static void sub_8028DFC(void); +static void sub_8028E4C(void); +static void sub_8028E84(void); +static void sub_8028EC8(bool8 invisible); +static void sub_8028FCC(void); +static void sub_802903C(void); +static void sub_8029274(struct DodrioSubstruct_0160 *PTR); +static void sub_80292E0(u8); +static bool32 sub_802A770(void); +static u8 sub_802A794(void); +static void sub_8028BF8(u8 id, bool8 invisible); +static void sub_8028C30(bool8 invisible); +static void sub_8028CA4(u16 id, u8 frameNum); +static void sub_8028C7C(u8 id, u8 y); +static void sub_80286B4(u8 id, u8 frameNum); +static u8 sub_8026E70(u8 arg0, u8 arg1); +static void sub_80288D4(u8 arg0); +static u32 sub_8027DFC(u32 arg0); +static u32 IncrementWithLimit(u32 arg0, u32 arg1); +static u32 Min(u32 arg0, u32 arg1); +static u32 sub_80276C0(u8 arg0); +static void sub_8027ACC(u8 taskId); +static void sub_8029314(u8 taskId); +static void sub_8027BEC(u8 windowId, s32 width); +static void nullsub_15(struct Sprite *sprite); +static void sub_80284A8(struct Sprite *sprite); +static u32 sub_802853C(struct Sprite *sprite); +static u32 sub_80285AC(struct Sprite *sprite); +static s16 sub_8028F14(u8 arg0, u8 arg1); +static void sub_8028654(bool8 invisible, u8 id); +static void sub_8029338(void); +static bool32 sub_802A8E8(void); +static void sub_802A7A8(void); +static void sub_802A72C(void (*func)(void)); +static void (*sub_802A75C(void))(void); +static void sub_8029338(void); +static void sub_8029440(void); +static void sub_802988C(void); +static void sub_802A010(void); +static void sub_802A380(void); +static void sub_802A454(void); +static void sub_802A534(void); +static void sub_802A588(void); +static void sub_802A6FC(void); +static void nullsub_16(void); -extern const u8 gUnknown_082F7A88[][3]; -extern const u8 gUnknown_082F449C[]; -extern const u8 gUknnown_082F45AF[]; -extern const u8 gUnknown_082F7A94[]; -extern void (*const gUnknown_082F7AC4[])(void); -extern void (*const gUnknown_082F7AF4[])(void); +// const rom data +static const u8 gUnknown_082F449C[5][5][11] = +{ + { + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, + }, + { + {0, 1, 2, 3, 4, 5, 6, 3, 8, 9, 0}, + {0, 1, 2, 5, 6, 3, 4, 5, 8, 9, 0}, + }, + { + {0, 1, 2, 3, 4, 5, 6, 7, 2, 9, 0}, + {0, 1, 4, 5, 6, 7, 2, 3, 4, 9, 0}, + {0, 1, 6, 7, 2, 3, 4, 5, 6, 9, 0}, + }, + { + {0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 0}, + {0, 3, 4, 5, 6, 7, 8, 1, 2, 3, 0}, + {0, 5, 6, 7, 8, 1, 2, 3, 4, 5, 0}, + {0, 7, 8, 1, 2, 3, 4, 5, 6, 7, 0}, + }, + { + {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0}, + {2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2}, + {4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4}, + {6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6}, + {8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8}, + }, +}; -void sub_802493C(u16 a0, void (*a1)(void)) +static const u8 gUknnown_082F45AF[5][5][3] = +{ + { + {4, 5, 6}, + }, + { + {3, 4, 5}, + {5, 6, 3}, + }, + { + {4, 5, 6}, + {6, 7, 2}, + {2, 3, 4}, + }, + { + {3, 4, 5}, + {5, 6, 7}, + {7, 8, 1}, + {1, 2, 3}, + }, + { + {4, 5, 6}, + {6, 7, 8}, + {8, 9, 0}, + {0, 1, 2}, + {2, 3, 4}, + }, +}; + +static const u8 gUnknown_082F45FA[5][5][3] = +{ + { + {1, 0, 1}, + }, + { + {1, 0, 1}, + {0, 1, 0}, + }, + { + {2, 0, 1}, + {0, 1, 2}, + {1, 2, 0}, + }, + { + {3, 0, 1}, + {0, 1, 2}, + {1, 2, 3}, + {2, 3, 0}, + }, + { + {4, 0, 1}, + {0, 1, 2}, + {1, 2, 3}, + {2, 3, 4}, + {3, 4, 0}, + }, +}; + +ALIGNED(4) +static const u8 gUnknown_082F4648[5][11] = +{ + {9, 9, 9, 9, 1, 1, 1, 9, 9, 9, 9}, + {9, 9, 9, 0, 0, 1, 1, 0, 9, 9, 9}, + {9, 9, 2, 2, 0, 0, 1, 1, 1, 9, 9}, + {9, 3, 3, 0, 0, 1, 1, 2, 2, 3, 9}, + {3, 3, 4, 4, 0, 0, 1, 1, 2, 2, 3}, +}; + +static const u8 gUnknown_082F467F[5][5] = +{ + {5}, + {4, 6}, + {3, 5, 7}, + {2, 4, 6, 8}, + {1, 3, 5, 6, 9}, +}; + +// Duplicate and unused gfx. Feel free to remove. +static const u32 sDuplicateGfx[] = INCBIN_U32("graphics/link_games/dodrioberry_bg1.gbapal", + "graphics/link_games/dodrioberry_bg2.gbapal", + "graphics/link_games/dodrioberry_pkmn.gbapal", + "graphics/link_games/dodrioberry_shiny.gbapal", + "graphics/link_games/dodrioberry_status.gbapal", + "graphics/link_games/dodrioberry_berrysprites.gbapal", + "graphics/link_games/dodrioberry_berrysprites.4bpp.lz", + "graphics/link_games/dodrioberry_platform.gbapal", + "graphics/link_games/dodrioberry_bg1.4bpp.lz", + "graphics/link_games/dodrioberry_bg2.4bpp.lz", + "graphics/link_games/dodrioberry_status.4bpp.lz", + "graphics/link_games/dodrioberry_platform.4bpp.lz", + "graphics/link_games/dodrioberry_pkmn.4bpp.lz", + "graphics/link_games/dodrioberry_bg1.bin.lz", + "graphics/link_games/dodrioberry_bg2right.bin.lz", + "graphics/link_games/dodrioberry_bg2left.bin.lz"); + + +static const u8 gUnknown_082F7A88[][3] = +{ + {40, 24, 13}, + {32, 19, 10}, + {22, 13, 7}, +}; + +ALIGNED(4) +static const u8 gUnknown_082F7A94[] = {8, 5, 8, 11, 15}; + +ALIGNED(4) +static const u8 gUnknown_082F7A9C[] = {5, 10, 20, 30, 50, 70, 100}; + +ALIGNED(4) +static const u8 gUnknown_082F7AA4[][10] = +{ + {15, 16, 17, 18, 19, 19, 18, 17, 16, 15}, + {20, 21, 22, 23, 24, 25, 26, 27, 28, 29}, + {30, 31, 32, 33, 34, 34, 33, 32, 31, 30}, +}; + +static void (*const gUnknown_082F7AC4[])(void) = +{ + sub_8024DBC, + sub_8024E00, + sub_8024E38, + sub_8024F10, + sub_8024F38, + sub_8025198, + sub_8025324, + sub_8025470, + sub_8025644, + sub_80256AC, + sub_8025758, + sub_80250D4 +}; + +static void (*const gUnknown_082F7AF4[])(void) = +{ + sub_8024DBC, + sub_8024E00, + sub_8024E38, + sub_8024F10, + sub_8024FFC, + sub_8025230, + sub_8025324, + sub_8025470, + sub_8025644, + sub_80256AC, + sub_8025758, + sub_8025158 +}; + +// code +void sub_802493C(u16 a0, void (*callback)(void)) { gUnknown_03000DB0 = FALSE; @@ -251,108 +458,108 @@ void sub_802493C(u16 a0, void (*a1)(void)) { sub_8024A1C(); sub_8024A30(gUnknown_02022C98); - gUnknown_02022C98->savedCallback = a1; + gUnknown_02022C98->savedCallback = callback; gUnknown_02022C98->multiplayerId = GetMultiplayerId(); - gUnknown_02022C98->unk_32CC = gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId]; - sub_80261F8(&gUnknown_02022C98->unk_318C[gUnknown_02022C98->multiplayerId], &gPlayerParty[a0]); + gUnknown_02022C98->unk32CC = gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId]; + sub_80261F8(&gUnknown_02022C98->unk318C[gUnknown_02022C98->multiplayerId], &gPlayerParty[a0]); CreateTask(sub_8024BC8, 1); SetMainCallback2(sub_80261CC); sub_80273F0(); - sub_8026B5C(gUnknown_02022C98->unk_0024, &gUnknown_02022C98->unk_0044, &gUnknown_02022C98->unk_0048); + sub_8026B5C(gUnknown_02022C98->unk24, &gUnknown_02022C98->unk44, &gUnknown_02022C98->unk48); StopMapMusic(); PlayNewMapMusic(MUS_RG_KINOMIKUI); } else { - SetMainCallback2(a1); + SetMainCallback2(callback); return; } } -void sub_8024A1C(void) +static void sub_8024A1C(void) { ResetTasks(); ResetSpriteData(); FreeAllSpritePalettes(); } -void sub_8024A30(struct DodrioBerryPickingStruct * data) +static void sub_8024A30(struct DodrioStruct * data) { u8 i; - data->unk_000C = 0; - data->unk_0010 = 0; - data->unk_0014 = 0; - data->unk_0018 = 0; - data->unk_001C = 0; - data->unk_011C = 0; - data->unk_0120 = 0; - data->unk_0030 = 0; - data->unk_0040 = 0; - data->unk_003C = 0; - data->unk_012C = 0; + data->unk0C = 0; + data->unk10 = 0; + data->unk14 = 0; + data->unk18 = 0; + data->unk1C = 0; + data->unk11C = 0; + data->unk120 = 0; + data->unk30 = 0; + data->unk40 = 0; + data->unk3C = 0; + data->unk12C = 0; for (i = 0; i < 4; i++) { - data->unk_0098[i] = 0; + data->unk98[i] = 0; } for (i = 0; i < 5; i++) { - data->unk_00A8[i] = 0; - data->unk_00B0[i] = 0; - data->unk_004A[i][0] = 0; - data->unk_004A[i][1] = 0; - data->unk_004A[i][2] = 0; - data->unk_004A[i][3] = 0; - data->unk_004A[i][5] = 0; - data->unk_010C[i] = 0; - data->unk_0130[i] = 0; + data->unkA8[i] = 0; + data->unkB0[i] = 0; + data->unk4A[i][0] = 0; + data->unk4A[i][1] = 0; + data->unk4A[i][2] = 0; + data->unk4A[i][3] = 0; + data->unk4A[i][5] = 0; + data->unk10C[i] = 0; + data->unk130[i] = 0; } for (i = 0; i < 11; i++) { - data->unk_00D0[i] = 0; - data->unk_00DC[i] = 0; - data->unk_00C4[i] = 0; - data->unk_00F4[i][0] = 0xFF; - data->unk_00F4[i][1] = 0xFF; + data->unkD0[i] = 0; + data->unkDC[i] = 0; + data->unkC4[i] = 0; + data->unkF4[i][0] = 0xFF; + data->unkF4[i][1] = 0xFF; } - data->unk_0020 = GetMultiplayerId() == 0 ? 1 : 0; - data->unk_0024 = GetLinkPlayerCount(); - data->unk_0034[0] = GetMultiplayerId(); - for (i = 1; i < data->unk_0024; i++) + data->unk20 = GetMultiplayerId() == 0 ? 1 : 0; + data->unk24 = GetLinkPlayerCount(); + data->unk34[0] = GetMultiplayerId(); + for (i = 1; i < data->unk24; i++) { - data->unk_0034[i] = data->unk_0034[i - 1] + 1; - if (data->unk_0034[i] > data->unk_0024 - 1) - data->unk_0034[i] %= data->unk_0024; + data->unk34[i] = data->unk34[i - 1] + 1; + if (data->unk34[i] > data->unk24 - 1) + data->unk34[i] %= data->unk24; } } -void sub_8024BC8(u8 taskId) +static void sub_8024BC8(u8 taskId) { u8 r4, r5; - switch (gUnknown_02022C98->unk_000C) + switch (gUnknown_02022C98->unk0C) { case 0: SetVBlankCallback(NULL); sub_802620C(sub_8025910, 4); - gUnknown_02022C98->unk_000C++; + gUnknown_02022C98->unk0C++; break; case 1: if (!FuncIsActiveTask(sub_8025910)) { - sub_8029274(&gUnknown_02022C98->unk_0160); - gUnknown_02022C98->unk_000C++; + sub_8029274(&gUnknown_02022C98->unk160); + gUnknown_02022C98->unk0C++; } break; case 2: if (!sub_802A770()) { sub_8010434(); - gUnknown_02022C98->unk_000C++; + gUnknown_02022C98->unk0C++; } break; case 3: @@ -363,37 +570,37 @@ void sub_8024BC8(u8 taskId) LoadWirelessStatusIndicatorSpriteGfx(); CreateWirelessStatusIndicatorSprite(0, 0); } - gUnknown_02022C98->unk_000C++; + gUnknown_02022C98->unk0C++; } break; case 4: - r5 = gUnknown_02022C98->unk_0024; + r5 = gUnknown_02022C98->unk24; sub_80283A8(); for (r4 = 0; r4 < r5; r4++) { - sub_8028408(&gUnknown_02022C98->unk_318C[gUnknown_02022C98->unk_0034[r4]], r4, gUnknown_02022C98->unk_0034[r4], gUnknown_02022C98->unk_0024); + sub_8028408(&gUnknown_02022C98->unk318C[gUnknown_02022C98->unk34[r4]], r4, gUnknown_02022C98->unk34[r4], gUnknown_02022C98->unk24); } - sub_802868C(0, gUnknown_02022C98->unk_0024); - gUnknown_02022C98->unk_000C++; + sub_802868C(FALSE, gUnknown_02022C98->unk24); + gUnknown_02022C98->unk0C++; break; case 5: sub_8028A34(); sub_8028A88(); sub_8028D44(); sub_8028734(); - gUnknown_02022C98->unk_000C++; + gUnknown_02022C98->unk0C++; break; case 6: BlendPalettes(0xFFFFFFFF, 0x10, 0x00); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); SetVBlankCallback(sub_80261E4); - gUnknown_02022C98->unk_000C++; + gUnknown_02022C98->unk0C++; break; case 7: UpdatePaletteFade(); if (!gPaletteFade.active) { - gUnknown_02022C98->unk_000C++; + gUnknown_02022C98->unk0C++; } break; default: @@ -403,36 +610,36 @@ void sub_8024BC8(u8 taskId) } } -void sub_8024D4C(u8 taskId) +static void sub_8024D4C(u8 taskId) { sub_8025D04(); - gUnknown_082F7AC4[gUnknown_02022C98->unk_0018](); - if (gUnknown_03000DB0 == FALSE) + gUnknown_082F7AC4[gUnknown_02022C98->unk18](); + if (!gUnknown_03000DB0) { sub_8026AF4(); } sub_8025D50(); } -void sub_8024D84(u8 taskId) +static void sub_8024D84(u8 taskId) { sub_8025E0C(); - gUnknown_082F7AF4[gUnknown_02022C98->unk_0018](); - if (gUnknown_03000DB0 == FALSE) + gUnknown_082F7AF4[gUnknown_02022C98->unk18](); + if (!gUnknown_03000DB0) { sub_8026B28(); } sub_8025ED8(); } -void sub_8024DBC(void) +static void sub_8024DBC(void) { - switch (gUnknown_02022C98->unk_0010) + switch (gUnknown_02022C98->unk10) { case 0: sub_8028504(1); sub_80292E0(1); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 1: if (!sub_802A770()) @@ -441,50 +648,50 @@ void sub_8024DBC(void) } } -void sub_8024E00(void) +static void sub_8024E00(void) { - if (gUnknown_02022C98->unk_0010 == 0) + if (gUnknown_02022C98->unk10 == 0) { sub_80262C0(); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } else { - gUnknown_02022C98->unk_0118 = 1; + gUnknown_02022C98->unk118 = 1; sub_8026240(2); } } -void sub_8024E38(void) +static void sub_8024E38(void) { - switch (gUnknown_02022C98->unk_0010) + switch (gUnknown_02022C98->unk10) { case 0: sub_802EB24(7, 8, 120, 80, 0); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 1: sub_8010434(); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 2: if (IsLinkTaskFinished()) { - gUnknown_02022C98->unk_0010++; - gUnknown_02022C98->unk_0030 = 0; + gUnknown_02022C98->unk10++; + gUnknown_02022C98->unk30 = 0; } break; case 3: if (!sub_802EB84()) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 4: - if (++gUnknown_02022C98->unk_0030 > 5) + if (++gUnknown_02022C98->unk30 > 5) { sub_8010434(); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 5: @@ -496,52 +703,52 @@ void sub_8024E38(void) } } -void sub_8024F10(void) +static void sub_8024F10(void) { - if (gUnknown_02022C98->unk_0010 == 0) + if (gUnknown_02022C98->unk10 == 0) { - if (gUnknown_02022C98->unk_011C != 0) + if (gUnknown_02022C98->unk11C != 0) { sub_8026240(4); } } } -void sub_8024F38(void) +static void sub_8024F38(void) { - if (gUnknown_02022C98->unk_0010 == 0) + if (gUnknown_02022C98->unk10 == 0) { - if (gUnknown_02022C98->unk_0040 < 10) + if (gUnknown_02022C98->unk40 < 10) { - if (gUnknown_02022C98->unk_00A8[0] == 0) + if (gUnknown_02022C98->unkA8[0] == 0) { if (JOY_NEW(DPAD_UP)) { - if (gUnknown_02022C98->unk_31A0[0].unk_2C == 0) + if (gUnknown_02022C98->unk31A0[0].unk2C.unk0 == 0) { - gUnknown_02022C98->unk_31A0[0].unk_30 = 0; - gUnknown_02022C98->unk_31A0[0].unk_2C = sub_8027518(2); + gUnknown_02022C98->unk31A0[0].unk2C.unk4 = 0; + gUnknown_02022C98->unk31A0[0].unk2C.unk0 = sub_8027518(2); } } else if (JOY_NEW(DPAD_RIGHT)) { - if (gUnknown_02022C98->unk_31A0[0].unk_2C == 0) + if (gUnknown_02022C98->unk31A0[0].unk2C.unk0 == 0) { - gUnknown_02022C98->unk_31A0[0].unk_30 = 0; - gUnknown_02022C98->unk_31A0[0].unk_2C = sub_8027518(1); + gUnknown_02022C98->unk31A0[0].unk2C.unk4 = 0; + gUnknown_02022C98->unk31A0[0].unk2C.unk0 = sub_8027518(1); } } else if (JOY_NEW(DPAD_LEFT)) { - if (gUnknown_02022C98->unk_31A0[0].unk_2C == 0) + if (gUnknown_02022C98->unk31A0[0].unk2C.unk0 == 0) { - gUnknown_02022C98->unk_31A0[0].unk_30 = 0; - gUnknown_02022C98->unk_31A0[0].unk_2C = sub_8027518(3); + gUnknown_02022C98->unk31A0[0].unk2C.unk4 = 0; + gUnknown_02022C98->unk31A0[0].unk2C.unk0 = sub_8027518(3); } } else { - gUnknown_02022C98->unk_31A0[0].unk_2C = sub_8027518(0); + gUnknown_02022C98->unk31A0[0].unk2C.unk0 = sub_8027518(0); } } } @@ -554,34 +761,34 @@ void sub_8024F38(void) } } -void sub_8024FFC(void) +static void sub_8024FFC(void) { - if (gUnknown_02022C98->unk_0040 < 10) + if (gUnknown_02022C98->unk40 < 10) { if (JOY_NEW(DPAD_UP)) { - if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_2C == 0) + if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 == 0) { - gUnknown_02022C98->unk_32CC.unk_2C = 2; + gUnknown_02022C98->unk32CC.unk2C.unk0 = 2; } } else if (JOY_NEW(DPAD_RIGHT)) { - if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_2C == 0) + if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 == 0) { - gUnknown_02022C98->unk_32CC.unk_2C = 1; + gUnknown_02022C98->unk32CC.unk2C.unk0 = 1; } } else if (JOY_NEW(DPAD_LEFT)) { - if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_2C == 0) + if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 == 0) { - gUnknown_02022C98->unk_32CC.unk_2C = 3; + gUnknown_02022C98->unk32CC.unk2C.unk0 = 3; } } else { - gUnknown_02022C98->unk_32CC.unk_2C = 0; + gUnknown_02022C98->unk32CC.unk2C.unk0 = 0; } } else @@ -591,7 +798,7 @@ void sub_8024FFC(void) sub_8026044(); } -void sub_80250D4(void) +static void sub_80250D4(void) { u8 i; @@ -604,26 +811,26 @@ void sub_80250D4(void) } else { - gUnknown_02022C98->unk_012C = 1; - for (i = 1; i < gUnknown_02022C98->unk_0024; i++) + gUnknown_02022C98->unk12C = 1; + for (i = 1; i < gUnknown_02022C98->unk24; i++) { - if (gUnknown_02022C98->unk_0130[i] != 1) + if (gUnknown_02022C98->unk130[i] != 1) { - gUnknown_02022C98->unk_012C = 0; + gUnknown_02022C98->unk12C = 0; break; } } } } -void sub_8025158(void) +static void sub_8025158(void) { sub_8026044(); if (sub_8026C90() == 1) sub_8026240(5); } -bool32 sub_8025170(void) +static bool32 sub_8025170(void) { u8 r4 = GetBlockReceivedStatus(); u8 r0 = sub_800A9D8(); @@ -638,32 +845,32 @@ bool32 sub_8025170(void) } } -void sub_8025198(void) +static void sub_8025198(void) { - switch (gUnknown_02022C98->unk_0010) + switch (gUnknown_02022C98->unk10) { case 0: - if (SendBlock(0, gUnknown_02022C98->unk_004A, sizeof(gUnknown_02022C98->unk_004A))) + if (SendBlock(0, gUnknown_02022C98->unk4A, sizeof(gUnknown_02022C98->unk4A))) { - gUnknown_02022C98->unk_0008 = 0; - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk08 = 0; + gUnknown_02022C98->unk10++; } break; case 1: if (IsLinkTaskFinished()) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 2: if (sub_8025170()) { - gUnknown_02022C98->unk_0008 = gUnknown_02022C98->unk_0024; + gUnknown_02022C98->unk08 = gUnknown_02022C98->unk24; } - if (gUnknown_02022C98->unk_0008 >= gUnknown_02022C98->unk_0024) + if (gUnknown_02022C98->unk08 >= gUnknown_02022C98->unk24) { - gUnknown_02022C98->unk_0014++; - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk14++; + gUnknown_02022C98->unk10++; } break; default: @@ -676,38 +883,38 @@ void sub_8025198(void) } } -void sub_8025230(void) +static void sub_8025230(void) { u8 i; - switch (gUnknown_02022C98->unk_0010) { + switch (gUnknown_02022C98->unk10) { case 0: - if (SendBlock(0, gUnknown_02022C98->unk_004A[gUnknown_02022C98->unk_0014], - sizeof(gUnknown_02022C98->unk_004A))) { - gUnknown_02022C98->unk_0008 = 0; - gUnknown_02022C98->unk_0010++; + if (SendBlock(0, gUnknown_02022C98->unk4A[gUnknown_02022C98->unk14], + sizeof(gUnknown_02022C98->unk4A))) { + gUnknown_02022C98->unk08 = 0; + gUnknown_02022C98->unk10++; } break; case 1: if (IsLinkTaskFinished()) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 2: if (sub_8025170()) { - for (i = 0; i < gUnknown_02022C98->unk_0024; i++) { - memcpy(gUnknown_02022C98->unk_004A, gBlockRecvBuffer, sizeof(gUnknown_02022C98->unk_004A)); - gUnknown_02022C98->unk_0008 = gUnknown_02022C98->unk_0024; + for (i = 0; i < gUnknown_02022C98->unk24; i++) { + memcpy(gUnknown_02022C98->unk4A, gBlockRecvBuffer, sizeof(gUnknown_02022C98->unk4A)); + gUnknown_02022C98->unk08 = gUnknown_02022C98->unk24; } } - if (gUnknown_02022C98->unk_0008 >= gUnknown_02022C98->unk_0024) { - gUnknown_02022C98->unk_0014++; - gUnknown_02022C98->unk_0010++; + if (gUnknown_02022C98->unk08 >= gUnknown_02022C98->unk24) { + gUnknown_02022C98->unk14++; + gUnknown_02022C98->unk10++; } break; default: if (WaitFanfare(TRUE)) { - gUnknown_02022C98->unk_0114 = gUnknown_02022C98->unk_004A[gUnknown_02022C98->multiplayerId][5]; + gUnknown_02022C98->unk114 = gUnknown_02022C98->unk4A[gUnknown_02022C98->multiplayerId][5]; sub_8026240(6); FadeOutAndPlayNewMapMusic(MUS_RG_WIN_YASEI, 4); } @@ -715,56 +922,56 @@ void sub_8025230(void) } } -void sub_8025324(void) +static void sub_8025324(void) { u8 sp00 = 1; u8 i; - switch (gUnknown_02022C98->unk_0010) + switch (gUnknown_02022C98->unk10) { case 0: sub_802749C(); - sub_80289E8(1); + sub_80289E8(TRUE); sub_8028DFC(); - sub_8028EC8(1); + sub_8028EC8(TRUE); sub_80292E0(2); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 1: if (!sub_802A770()) { sub_80292E0(5); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 2: sp00 = sub_802A794(); if (SendBlock(0, &sp00, sizeof(sp00))) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 3: if (IsLinkTaskFinished()) { - gUnknown_02022C98->unk_0010++; - gUnknown_02022C98->unk_0008 = 0; + gUnknown_02022C98->unk10++; + gUnknown_02022C98->unk08 = 0; } break; case 4: if (sub_8025170()) { - for (i = 0; i < gUnknown_02022C98->unk_0024; i++) + for (i = 0; i < gUnknown_02022C98->unk24; i++) { - *(gUnknown_02022C98->unk_010C + i) = *(u8 *)gBlockRecvBuffer[i]; - gUnknown_02022C98->unk_0008 = gUnknown_02022C98->unk_0024; + *(gUnknown_02022C98->unk10C + i) = *(u8 *)gBlockRecvBuffer[i]; + gUnknown_02022C98->unk08 = gUnknown_02022C98->unk24; } } - if (gUnknown_02022C98->unk_0008 >= gUnknown_02022C98->unk_0024) { - if (++gUnknown_02022C98->unk_0014 >= 120) + if (gUnknown_02022C98->unk08 >= gUnknown_02022C98->unk24) { + if (++gUnknown_02022C98->unk14 >= 120) { sub_80292E0(6); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } } break; @@ -777,74 +984,74 @@ void sub_8025324(void) } } -void sub_8025470(void) +static void sub_8025470(void) { u8 sp0; u8 i; - switch (gUnknown_02022C98->unk_0010) + switch (gUnknown_02022C98->unk10) { case 0: if (sub_8027748() >= 3000) { sub_80292E0(4); } - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 1: if (!sub_802A770()) { sub_80292E0(3); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 2: sub_8028FCC(); sub_80272E8(); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 3: if ((sp0 = sub_802A794()) != 0) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 4: if (!sub_802A770()) { sub_80292E0(5); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 5: sp0 = sub_802A794(); if (SendBlock(0, &sp0, sizeof(sp0))) { - gUnknown_02022C98->unk_0008 = 0; - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk08 = 0; + gUnknown_02022C98->unk10++; } break; case 6: if (IsLinkTaskFinished()) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 7: if (sub_8025170()) { - for (i = 0; i < gUnknown_02022C98->unk_0024; i++) + for (i = 0; i < gUnknown_02022C98->unk24; i++) { - *(gUnknown_02022C98->unk_010C + i) = *(u8 *)gBlockRecvBuffer[i]; - gUnknown_02022C98->unk_0008 = gUnknown_02022C98->unk_0024; + *(gUnknown_02022C98->unk10C + i) = *(u8 *)gBlockRecvBuffer[i]; + gUnknown_02022C98->unk08 = gUnknown_02022C98->unk24; } } - if (gUnknown_02022C98->unk_0008 >= gUnknown_02022C98->unk_0024) { - if (++gUnknown_02022C98->unk_0014 >= 120) + if (gUnknown_02022C98->unk08 >= gUnknown_02022C98->unk24) { + if (++gUnknown_02022C98->unk14 >= 120) { sub_8027608(); sub_80292E0(6); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } } else @@ -855,9 +1062,9 @@ void sub_8025470(void) default: if (!sub_802A770()) { - for (i = 0; i < gUnknown_02022C98->unk_0024; i++) + for (i = 0; i < gUnknown_02022C98->unk24; i++) { - if (gUnknown_02022C98->unk_010C[i] == 2) + if (gUnknown_02022C98->unk10C[i] == 2) { sub_8026240(8); return; @@ -869,25 +1076,25 @@ void sub_8025470(void) } } -void sub_8025644(void) +static void sub_8025644(void) { - switch (gUnknown_02022C98->unk_0010) + switch (gUnknown_02022C98->unk10) { case 0: sub_800AC34(); sub_80292E0(7); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 1: if (!sub_802A770()) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 2: if (sub_802A794() == 5) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; default: @@ -899,35 +1106,35 @@ void sub_8025644(void) } } -void sub_80256AC(void) +static void sub_80256AC(void) { - switch (gUnknown_02022C98->unk_0010) + switch (gUnknown_02022C98->unk10) { case 0: BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 1: UpdatePaletteFade(); if (!gPaletteFade.active) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 2: sub_8028B80(); sub_80287E4(); - sub_8028614(gUnknown_02022C98->unk_0024); + sub_8028614(gUnknown_02022C98->unk24); sub_8028E84(); gUnknown_03000DB0 = TRUE; sub_80292E0(8); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; default: if (!sub_802A770()) { SetMainCallback2(gUnknown_02022C98->savedCallback); - DestroyTask(gUnknown_02022C98->unk_0004); + DestroyTask(gUnknown_02022C98->unk04); Free(gUnknown_02022C98); FreeAllWindowBuffers(); } @@ -935,20 +1142,20 @@ void sub_80256AC(void) } } -void sub_8025758(void) +static void sub_8025758(void) { - switch (gUnknown_02022C98->unk_0010) + switch (gUnknown_02022C98->unk10) { case 0: sub_80292E0(9); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 1: UpdatePaletteFade(); if (!gPaletteFade.active) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 2: @@ -960,66 +1167,66 @@ void sub_8025758(void) ChangeBgY(2, 0, 0); ChangeBgX(3, 0, 0); ChangeBgY(3, 0, 0); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 3: StopMapMusic(); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 4: PlayNewMapMusic(MUS_RG_KINOMIKUI); sub_8028E4C(); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 5: BlendPalettes(0xFFFFFFFF, 16, 0); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 6: UpdatePaletteFade(); if (!gPaletteFade.active) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; default: - DestroyTask(gUnknown_02022C98->unk_0004); + DestroyTask(gUnknown_02022C98->unk04); sub_802621C(sub_802589C); sub_802903C(); sub_8024A30(gUnknown_02022C98); if (gReceivedRemoteLinkPlayers == 0) { - gUnknown_02022C98->unk_0024 = 1; + gUnknown_02022C98->unk24 = 1; } sub_80273F0(); - sub_8028EC8(0); + sub_8028EC8(FALSE); break; } } -void sub_802589C(u8 taskId) +static void sub_802589C(u8 taskId) { - switch (gUnknown_02022C98->unk_0010) + switch (gUnknown_02022C98->unk10) { case 0: if (sub_8026264() == 1) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; case 1: sub_80286E4(); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; break; case 2: - if (sub_8028828() == 1) + if (sub_8028828() == TRUE) { - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; default: - if (gUnknown_02022C98->unk_0020 != 0) + if (gUnknown_02022C98->unk20 != 0) { sub_802621C(sub_8024D4C); } @@ -1032,7 +1239,7 @@ void sub_802589C(u8 taskId) } } -void sub_8025910(u8 taskId) +static void sub_8025910(u8 taskId) { s16 * data = gTasks[taskId].data; u8 i; @@ -1040,9 +1247,9 @@ void sub_8025910(u8 taskId) switch (data[0]) { case 0: - if (SendBlock(0, &gUnknown_02022C98->unk_318C[gUnknown_02022C98->multiplayerId].isShiny, sizeof(gUnknown_02022C98->unk_318C[gUnknown_02022C98->multiplayerId].isShiny))) + if (SendBlock(0, &gUnknown_02022C98->unk318C[gUnknown_02022C98->multiplayerId].isShiny, sizeof(gUnknown_02022C98->unk318C[gUnknown_02022C98->multiplayerId].isShiny))) { - gUnknown_02022C98->unk_0008 = 0; + gUnknown_02022C98->unk08 = 0; data[0]++; } break; @@ -1055,129 +1262,129 @@ void sub_8025910(u8 taskId) case 2: if (sub_8025170()) { - for (i = 0; i < gUnknown_02022C98->unk_0024; i++) + for (i = 0; i < gUnknown_02022C98->unk24; i++) { - *(u8 *)&gUnknown_02022C98->unk_318C[i] = *(u8 *)gBlockRecvBuffer[i]; - gUnknown_02022C98->unk_0008 = gUnknown_02022C98->unk_0024; + *(u8 *)&gUnknown_02022C98->unk318C[i] = *(u8 *)gBlockRecvBuffer[i]; + gUnknown_02022C98->unk08 = gUnknown_02022C98->unk24; } } - if (gUnknown_02022C98->unk_0008 >= gUnknown_02022C98->unk_0024) + if (gUnknown_02022C98->unk08 >= gUnknown_02022C98->unk24) { DestroyTask(taskId); sub_80292E0(6); - gUnknown_02022C98->unk_0010++; + gUnknown_02022C98->unk10++; } break; } } -void sub_80259FC(void) +static void sub_80259FC(void) { u8 i; - u8 r7 = gUnknown_02022C98->unk_0024; + u8 r7 = gUnknown_02022C98->unk24; - gUnknown_02022C98->unk_31A0[0].unk_10 = sub_8028164(0, &gUnknown_02022C98->unk_31A0[0], &gUnknown_02022C98->unk_31A0[0].unk_2C, &gUnknown_02022C98->unk_31A0[1].unk_2C, &gUnknown_02022C98->unk_31A0[2].unk_2C, &gUnknown_02022C98->unk_31A0[3].unk_2C, &gUnknown_02022C98->unk_31A0[4].unk_2C, &gUnknown_02022C98->unk_0040, &gUnknown_02022C98->unk_0120, &gUnknown_02022C98->unk_012C); - gUnknown_02022C98->unk_0128 = 1; + gUnknown_02022C98->unk31A0[0].unk10 = sub_8028164(0, &gUnknown_02022C98->unk31A0[0], &gUnknown_02022C98->unk31A0[0].unk2C, &gUnknown_02022C98->unk31A0[1].unk2C, &gUnknown_02022C98->unk31A0[2].unk2C, &gUnknown_02022C98->unk31A0[3].unk2C, &gUnknown_02022C98->unk31A0[4].unk2C, &gUnknown_02022C98->unk40, &gUnknown_02022C98->unk120, &gUnknown_02022C98->unk12C); + gUnknown_02022C98->unk128 = 1; for (i = 1; i < r7; i++) { - if ( gUnknown_02022C98->unk_00A8[i] == 0 - && sub_8028318(i, &gUnknown_02022C98->unk_31A0[i].unk_2C) == 0) + if ( gUnknown_02022C98->unkA8[i] == 0 + && sub_8028318(i, &gUnknown_02022C98->unk31A0[i].unk2C.unk0) == 0) { - gUnknown_02022C98->unk_31A0[i].unk_2C = 0; - gUnknown_02022C98->unk_0128 = 0; + gUnknown_02022C98->unk31A0[i].unk2C.unk0 = 0; + gUnknown_02022C98->unk128 = 0; } } - if (++gUnknown_02022C98->unk_0124 >= 60) + if (++gUnknown_02022C98->unk124 >= 60) { - if (gUnknown_02022C98->unk_0128 != 0) + if (gUnknown_02022C98->unk128 != 0) { sub_8011AC8(); - gUnknown_02022C98->unk_0124 = 0; + gUnknown_02022C98->unk124 = 0; } - else if (gUnknown_02022C98->unk_0124 > 70) + else if (gUnknown_02022C98->unk124 > 70) { sub_8011AC8(); - gUnknown_02022C98->unk_0124 = 0; + gUnknown_02022C98->unk124 = 0; } } for (i = 0; i < r7; i++) { - if ( gUnknown_02022C98->unk_31A0[i].unk_2C != 0 - && gUnknown_02022C98->unk_00A8[i] == 0) + if ( gUnknown_02022C98->unk31A0[i].unk2C.unk0 != 0 + && gUnknown_02022C98->unkA8[i] == 0) { - gUnknown_02022C98->unk_00A8[i] = 1; + gUnknown_02022C98->unkA8[i] = 1; } - switch (gUnknown_02022C98->unk_00A8[i]) + switch (gUnknown_02022C98->unkA8[i]) { case 0: default: break; case 1 ... 3: - if (++gUnknown_02022C98->unk_00B0[i] >= 6) + if (++gUnknown_02022C98->unkB0[i] >= 6) { - gUnknown_02022C98->unk_00B0[i] = 0; - gUnknown_02022C98->unk_00A8[i] = 0; - gUnknown_02022C98->unk_31A0[i].unk_2C = 0; - gUnknown_02022C98->unk_31A0[i].unk_30 = 0; - gUnknown_02022C98->unk_31A0[i].unk_34 = 0; + gUnknown_02022C98->unkB0[i] = 0; + gUnknown_02022C98->unkA8[i] = 0; + gUnknown_02022C98->unk31A0[i].unk2C.unk0 = 0; + gUnknown_02022C98->unk31A0[i].unk2C.unk4 = 0; + gUnknown_02022C98->unk31A0[i].unk2C.unk8 = 0; } break; case 4: - if (++gUnknown_02022C98->unk_00B0[i] >= 40) + if (++gUnknown_02022C98->unkB0[i] >= 40) { - gUnknown_02022C98->unk_00B0[i] = 0; - gUnknown_02022C98->unk_00A8[i] = 0; - gUnknown_02022C98->unk_31A0[i].unk_2C = 0; - gUnknown_02022C98->unk_31A0[i].unk_30 = 0; - gUnknown_02022C98->unk_31A0[i].unk_34 = 0; + gUnknown_02022C98->unkB0[i] = 0; + gUnknown_02022C98->unkA8[i] = 0; + gUnknown_02022C98->unk31A0[i].unk2C.unk0 = 0; + gUnknown_02022C98->unk31A0[i].unk2C.unk4 = 0; + gUnknown_02022C98->unk31A0[i].unk2C.unk8 = 0; } break; } } } -void sub_8025C0C(void) +static void sub_8025C0C(void) { u8 i; - u8 r6 = gUnknown_02022C98->unk_0024; + u8 r6 = gUnknown_02022C98->unk24; - gUnknown_02022C98->unk_31A0[0].unk_10 = sub_8028164(0, &gUnknown_02022C98->unk_31A0[0], &gUnknown_02022C98->unk_31A0[0].unk_2C, &gUnknown_02022C98->unk_31A0[1].unk_2C, &gUnknown_02022C98->unk_31A0[2].unk_2C, &gUnknown_02022C98->unk_31A0[3].unk_2C, &gUnknown_02022C98->unk_31A0[4].unk_2C, &gUnknown_02022C98->unk_0040, &gUnknown_02022C98->unk_0120, &gUnknown_02022C98->unk_012C); - gUnknown_02022C98->unk_0128 = 1; + gUnknown_02022C98->unk31A0[0].unk10 = sub_8028164(0, &gUnknown_02022C98->unk31A0[0], &gUnknown_02022C98->unk31A0[0].unk2C, &gUnknown_02022C98->unk31A0[1].unk2C, &gUnknown_02022C98->unk31A0[2].unk2C, &gUnknown_02022C98->unk31A0[3].unk2C, &gUnknown_02022C98->unk31A0[4].unk2C, &gUnknown_02022C98->unk40, &gUnknown_02022C98->unk120, &gUnknown_02022C98->unk12C); + gUnknown_02022C98->unk128 = 1; for (i = 1; i < r6; i++) { if (sub_8028374(i) != 0) { - gUnknown_02022C98->unk_0130[i] = 1; - gUnknown_02022C98->unk_0128 = 0; + gUnknown_02022C98->unk130[i] = 1; + gUnknown_02022C98->unk128 = 0; } } - if (++gUnknown_02022C98->unk_0124 >= 60) + if (++gUnknown_02022C98->unk124 >= 60) { - if (gUnknown_02022C98->unk_0128 != 0) + if (gUnknown_02022C98->unk128 != 0) { sub_8011AC8(); - gUnknown_02022C98->unk_0124 = 0; + gUnknown_02022C98->unk124 = 0; } - else if (gUnknown_02022C98->unk_0124 > 70) + else if (gUnknown_02022C98->unk124 > 70) { sub_8011AC8(); - gUnknown_02022C98->unk_0124 = 0; + gUnknown_02022C98->unk124 = 0; } } } -void sub_8025D04(void) +static void sub_8025D04(void) { - switch (gUnknown_02022C98->unk_0018) + switch (gUnknown_02022C98->unk18) { case 3: - if (sub_8026BB8() == 1) + if (sub_8026BB8() == TRUE) { sub_8026C28(); - gUnknown_02022C98->unk_011C = 1; + gUnknown_02022C98->unk11C = 1; } break; case 4: @@ -1189,48 +1396,48 @@ void sub_8025D04(void) } } -void sub_8025D50(void) +static void sub_8025D50(void) { - switch (gUnknown_02022C98->unk_0018) + switch (gUnknown_02022C98->unk18) { case 4: - sub_8027E30(&gUnknown_02022C98->unk_32CC, &gUnknown_02022C98->unk_31A0[0].unk_2C, &gUnknown_02022C98->unk_31A0[1].unk_2C, &gUnknown_02022C98->unk_31A0[2].unk_2C, &gUnknown_02022C98->unk_31A0[3].unk_2C, &gUnknown_02022C98->unk_31A0[4].unk_2C, gUnknown_02022C98->unk_0040, gUnknown_02022C98->unk_0120, gUnknown_02022C98->unk_012C); + sub_8027E30(&gUnknown_02022C98->unk32CC, &gUnknown_02022C98->unk31A0[0].unk2C, &gUnknown_02022C98->unk31A0[1].unk2C, &gUnknown_02022C98->unk31A0[2].unk2C, &gUnknown_02022C98->unk31A0[3].unk2C, &gUnknown_02022C98->unk31A0[4].unk2C, gUnknown_02022C98->unk40, gUnknown_02022C98->unk120, gUnknown_02022C98->unk12C); break; case 11: - sub_8027E30(&gUnknown_02022C98->unk_32CC, &gUnknown_02022C98->unk_31A0[0].unk_2C, &gUnknown_02022C98->unk_31A0[1].unk_2C, &gUnknown_02022C98->unk_31A0[2].unk_2C, &gUnknown_02022C98->unk_31A0[3].unk_2C, &gUnknown_02022C98->unk_31A0[4].unk_2C, gUnknown_02022C98->unk_0040, gUnknown_02022C98->unk_0120, gUnknown_02022C98->unk_012C); + sub_8027E30(&gUnknown_02022C98->unk32CC, &gUnknown_02022C98->unk31A0[0].unk2C, &gUnknown_02022C98->unk31A0[1].unk2C, &gUnknown_02022C98->unk31A0[2].unk2C, &gUnknown_02022C98->unk31A0[3].unk2C, &gUnknown_02022C98->unk31A0[4].unk2C, gUnknown_02022C98->unk40, gUnknown_02022C98->unk120, gUnknown_02022C98->unk12C); break; } } -void sub_8025E0C(void) +static void sub_8025E0C(void) { - switch (gUnknown_02022C98->unk_0018) + switch (gUnknown_02022C98->unk18) { case 4: - sub_8028164(gUnknown_02022C98->multiplayerId, &gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId], &gUnknown_02022C98->unk_31A0[0].unk_2C, &gUnknown_02022C98->unk_31A0[1].unk_2C, &gUnknown_02022C98->unk_31A0[2].unk_2C, &gUnknown_02022C98->unk_31A0[3].unk_2C, &gUnknown_02022C98->unk_31A0[4].unk_2C, &gUnknown_02022C98->unk_0040, &gUnknown_02022C98->unk_0120, &gUnknown_02022C98->unk_012C); + sub_8028164(gUnknown_02022C98->multiplayerId, &gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId], &gUnknown_02022C98->unk31A0[0].unk2C, &gUnknown_02022C98->unk31A0[1].unk2C, &gUnknown_02022C98->unk31A0[2].unk2C, &gUnknown_02022C98->unk31A0[3].unk2C, &gUnknown_02022C98->unk31A0[4].unk2C, &gUnknown_02022C98->unk40, &gUnknown_02022C98->unk120, &gUnknown_02022C98->unk12C); break; case 11: - sub_8028164(gUnknown_02022C98->multiplayerId, &gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId], &gUnknown_02022C98->unk_31A0[0].unk_2C, &gUnknown_02022C98->unk_31A0[1].unk_2C, &gUnknown_02022C98->unk_31A0[2].unk_2C, &gUnknown_02022C98->unk_31A0[3].unk_2C, &gUnknown_02022C98->unk_31A0[4].unk_2C, &gUnknown_02022C98->unk_0040, &gUnknown_02022C98->unk_0120, &gUnknown_02022C98->unk_012C); + sub_8028164(gUnknown_02022C98->multiplayerId, &gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId], &gUnknown_02022C98->unk31A0[0].unk2C, &gUnknown_02022C98->unk31A0[1].unk2C, &gUnknown_02022C98->unk31A0[2].unk2C, &gUnknown_02022C98->unk31A0[3].unk2C, &gUnknown_02022C98->unk31A0[4].unk2C, &gUnknown_02022C98->unk40, &gUnknown_02022C98->unk120, &gUnknown_02022C98->unk12C); break; } } -void sub_8025ED8(void) +static void sub_8025ED8(void) { - switch (gUnknown_02022C98->unk_0018) + switch (gUnknown_02022C98->unk18) { case 3: sub_8027DD0(1); - gUnknown_02022C98->unk_011C = 1; + gUnknown_02022C98->unk11C = 1; break; case 4: - if (gUnknown_02022C98->unk_32CC.unk_2C != 0) + if (gUnknown_02022C98->unk32CC.unk2C.unk0 != 0) { - sub_80282EC(gUnknown_02022C98->unk_32CC.unk_2C); + sub_80282EC(gUnknown_02022C98->unk32CC.unk2C.unk0); } break; case 11: - if (gUnknown_02022C98->unk_0120 == 0 && gUnknown_02022C98->unk_012C == 0) + if (gUnknown_02022C98->unk120 == 0 && gUnknown_02022C98->unk12C == 0) { sub_8028350(1); } @@ -1238,105 +1445,105 @@ void sub_8025ED8(void) } } -void sub_8025F48(void) +static void sub_8025F48(void) { - if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_2C == 0) + if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 == 0) { if (!IsSEPlaying()) { - gUnknown_02022C98->unk_0144 = 0; + gUnknown_02022C98->unk144 = 0; } } - else if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_30 == 1) + else if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk4 == 1) { - if (gUnknown_02022C98->unk_0144 == 0) + if (gUnknown_02022C98->unk144 == 0) { m4aSongNumStop(SE_SEIKAI); PlaySE(SE_SEIKAI); - gUnknown_02022C98->unk_0144 = 1; + gUnknown_02022C98->unk144 = 1; } } - else if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_34 == 1) + else if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk8 == 1) { - if (gUnknown_02022C98->unk_0144 == 0 && !IsSEPlaying()) + if (gUnknown_02022C98->unk144 == 0 && !IsSEPlaying()) { PlaySE(SE_BOO); sub_80284CC(1); - gUnknown_02022C98->unk_0144 = 1; + gUnknown_02022C98->unk144 = 1; } } - if (gUnknown_02022C98->unk_0154 == 0 && gUnknown_02022C98->unk_0040 >= 10) + if (gUnknown_02022C98->unk154 == 0 && gUnknown_02022C98->unk40 >= 10) { StopMapMusic(); - gUnknown_02022C98->unk_0154 = 1; + gUnknown_02022C98->unk154 = 1; } - else if (gUnknown_02022C98->unk_0154 == 1) + else if (gUnknown_02022C98->unk154 == 1) { PlayFanfareByFanfareNum(11); // MUS_ME_ZANNEN - gUnknown_02022C98->unk_0154 = 2; + gUnknown_02022C98->unk154 = 2; } } -void sub_8026044(void) +static void sub_8026044(void) { - u8 r8 = gUnknown_02022C98->unk_0044; - u8 r7 = gUnknown_02022C98->unk_0048; + u8 r8 = gUnknown_02022C98->unk44; + u8 r7 = gUnknown_02022C98->unk48; u8 r4; - if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_2C == 0) + if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 == 0) { - if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_30 != 1 && gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_34 != 1) + if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk4 != 1 && gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk8 != 1) { - gUnknown_02022C98->unk_0144 = 0; + gUnknown_02022C98->unk144 = 0; } } - else if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_30 == 1) + else if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk4 == 1) { - if (gUnknown_02022C98->unk_0144 == 0) + if (gUnknown_02022C98->unk144 == 0) { m4aSongNumStop(SE_SEIKAI); PlaySE(SE_SEIKAI); - gUnknown_02022C98->unk_0144 = 1; + gUnknown_02022C98->unk144 = 1; } } - else if (gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_34 == 1) + else if (gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk8 == 1) { - if (gUnknown_02022C98->unk_0144 == 0 && !IsSEPlaying()) + if (gUnknown_02022C98->unk144 == 0 && !IsSEPlaying()) { PlaySE(SE_BOO); sub_80284CC(1); - gUnknown_02022C98->unk_0144 = 1; + gUnknown_02022C98->unk144 = 1; } } for (r4 = r8; r4 < r7; r4++) { - struct DodrioBerryPickingSubstruct_31A0_14 * ptr = &gUnknown_02022C98->unk_31A0[gUnknown_02022C98->multiplayerId].unk_14; - if (ptr->unk_B[r4] >= 10) + struct DodrioSubstruct_31A0_14 * ptr = &gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk14; + if (ptr->unkB[r4] >= 10) { - if (gUnknown_02022C98->unk_0148[r4] == 0) + if (gUnknown_02022C98->unk148[r4] == 0) { - PlaySE(SE_FUUSEN1 + ptr->unk_0[r4]); - gUnknown_02022C98->unk_0148[r4] = 1; + PlaySE(SE_FUUSEN1 + ptr->unk0[r4]); + gUnknown_02022C98->unk148[r4] = 1; } } else { - gUnknown_02022C98->unk_0148[r4] = 0; + gUnknown_02022C98->unk148[r4] = 0; } } - if (gUnknown_02022C98->unk_0154 == 0 && gUnknown_02022C98->unk_0040 >= 10) + if (gUnknown_02022C98->unk154 == 0 && gUnknown_02022C98->unk40 >= 10) { StopMapMusic(); - gUnknown_02022C98->unk_0154 = 1; + gUnknown_02022C98->unk154 = 1; } - else if (gUnknown_02022C98->unk_0154 == 1) + else if (gUnknown_02022C98->unk154 == 1) { PlayFanfareByFanfareNum(11); // MUS_ME_ZANNEN - gUnknown_02022C98->unk_0154 = 2; + gUnknown_02022C98->unk154 = 2; } } -void sub_80261CC(void) +static void sub_80261CC(void) { RunTasks(); AnimateSprites(); @@ -1344,46 +1551,46 @@ void sub_80261CC(void) UpdatePaletteFade(); } -void sub_80261E4(void) +static void sub_80261E4(void) { TransferPlttBuffer(); LoadOam(); ProcessSpriteCopyRequests(); } -void sub_80261F8(struct DodrioBerryPickingSubstruct_318C * a0, struct Pokemon * a1) +static void sub_80261F8(struct DodrioSubstruct_318C * a0, struct Pokemon * a1) { a0->isShiny = IsMonShiny(a1); } -void sub_802620C(TaskFunc func, u8 priority) +static void sub_802620C(TaskFunc func, u8 priority) { CreateTask(func, priority); } -void sub_802621C(TaskFunc func) +static void sub_802621C(TaskFunc func) { - gUnknown_02022C98->unk_0004 = CreateTask(func, 1); - gUnknown_02022C98->unk_0010 = 0; - gUnknown_02022C98->unk_000C = 0; - gUnknown_02022C98->unk_0014 = 0; + gUnknown_02022C98->unk04 = CreateTask(func, 1); + gUnknown_02022C98->unk10 = 0; + gUnknown_02022C98->unk0C = 0; + gUnknown_02022C98->unk14 = 0; } -void sub_8026240(u8 a0) +static void sub_8026240(u8 a0) { - gUnknown_02022C98->unk_001C = gUnknown_02022C98->unk_0018; - gUnknown_02022C98->unk_0018 = a0; - gUnknown_02022C98->unk_0010 = 0; - gUnknown_02022C98->unk_0014 = 0; + gUnknown_02022C98->unk1C = gUnknown_02022C98->unk18; + gUnknown_02022C98->unk18 = a0; + gUnknown_02022C98->unk10 = 0; + gUnknown_02022C98->unk14 = 0; } -bool32 sub_8026264(void) +static bool32 sub_8026264(void) { - u8 r2 = gUnknown_02022C98->unk_0014 / 4; - gUnknown_02022C98->unk_0014++; - if (r2 != 0 && gUnknown_02022C98->unk_0014 % 4 == 0) + u8 r2 = gUnknown_02022C98->unk14 / 4; + gUnknown_02022C98->unk14++; + if (r2 != 0 && gUnknown_02022C98->unk14 % 4 == 0) { - if (r2 < gUnknown_082F7A94[gUnknown_02022C98->unk_0024 - 1]) + if (r2 < gUnknown_082F7A94[gUnknown_02022C98->unk24 - 1]) { SetGpuReg(REG_OFFSET_BG1HOFS, (r2 * 8)); SetGpuReg(REG_OFFSET_BG2HOFS, -(r2 * 8)); @@ -1400,530 +1607,125 @@ bool32 sub_8026264(void) } } -void sub_80262C0(void) +static void sub_80262C0(void) { u8 i; - u8 start = gUnknown_02022C98->unk_0044; - u8 finish = gUnknown_02022C98->unk_0048; + u8 start = gUnknown_02022C98->unk44; + u8 finish = gUnknown_02022C98->unk48; for (i = start; i < finish; i++) { - struct DodrioBerryPickingSubstruct_31A0_14 * ptr = &gUnknown_02022C98->unk_32CC.unk_14; - ptr->unk_B[i] = (i % 2 == 0) ? 1 : 0; - ptr->unk_0[i] = 0; + struct DodrioSubstruct_31A0_14 * ptr = &gUnknown_02022C98->unk32CC.unk14; + ptr->unkB[i] = (i % 2 == 0) ? 1 : 0; + ptr->unk0[i] = 0; } } -#ifdef NONMATCHING -void sub_8026324(void) +static void sub_8026324(void) { - u8 sp0 = gUnknown_02022C98->unk_0044; - u8 sp4 = gUnknown_02022C98->unk_0048; - u8 sp8 = gUnknown_02022C98->unk_0024; - u8 r6; - u8 r10; - s32 r2; - u8 r5; - u8 r3; - s32 r2_2; - u8 r4; - u8 r7, r7_2; + u8 sp0 = gUnknown_02022C98->unk44; + u8 sp4 = gUnknown_02022C98->unk48; + u8 sp8 = gUnknown_02022C98->unk24; + u8 i, j, k, r5; - if (gUnknown_02022C98->unk_0040 >= 10) + if (gUnknown_02022C98->unk40 >= 10) return; - for (r6 = 0; r6 < sp8; r6++) + for (i = 0; i < sp8; i++) { - if (gUnknown_02022C98->unk_31A0[r6].unk_2C != 0 && gUnknown_02022C98->unk_00A8[r6] == 1) + u8 *ptr = &gUnknown_02022C98->unk31A0[i].unk2C.unk0; + if (*ptr != 0 && gUnknown_02022C98->unkA8[i] == 1) { - for (r10 = sp0; r10 < sp4; r10++) + for (j = sp0; j < sp4; j++) { - r5 = gUnknown_082F449C[r10]; - if (gUnknown_02022C98->unk_00F4[r5][0] == r6) - { + r5 = gUnknown_082F449C[0][0][j]; + if (gUnknown_02022C98->unkF4[r5][0] == i || gUnknown_02022C98->unkF4[r5][1] == i) break; - } - if (gUnknown_02022C98->unk_00F4[r5][1] == r6) + if (sub_8026634(i, *ptr, r5) == TRUE) { - break; - } - if (sub_8026634(gUnknown_02022C98->unk_31A0[r6].unk_2C, r6, gUnknown_082F449C[r10]) == 1) - { - for (r2 = 0; r2 < 2; r2++) + for (k = 0; k < 2; k++) { - if (gUnknown_02022C98->unk_00F4[r5][r2] == 0xFF) + if (gUnknown_02022C98->unkF4[r5][k] == 0xFF) { - gUnknown_02022C98->unk_00F4[r5][r2] = r6; - gUnknown_02022C98->unk_00A8[r6] = 2; - gUnknown_02022C98->unk_00C4[r5] = 1; + gUnknown_02022C98->unkF4[r5][k] = i; + gUnknown_02022C98->unkA8[i] = 2; + gUnknown_02022C98->unkC4[r5] = 1; break; } } break; } - if (gUnknown_02022C98->unk_31A0[r6].unk_34 == 1) - { + if (gUnknown_02022C98->unk31A0[i].unk2C.unk8 == 1) break; - } } } } - for (r10 = sp0; r10 < sp4; r10++) + for (j = sp0; j < sp4; j++) { - r6 = 0xFF; - r5 = gUnknown_082F449C[r10]; - if (gUnknown_02022C98->unk_00C4[r5] == 1) + u8 id = 0xFF; + r5 = gUnknown_082F449C[0][0][j]; + if (gUnknown_02022C98->unkC4[r5] == 1) { - r3 = gUnknown_02022C98->unk_0090[sub_8026D8C(r5)] / 7; - if (r3 < 2) - { - r3 = 2; - } - r2 = gUnknown_082F7A88[r3][gUnknown_02022C98->unk_31A0[0].unk_14.unk_0[r5]] - gUnknown_02022C98->unk_00D0[r5]; + s32 r2; + u8 r4, r3 = gUnknown_02022C98->unk90[sub_8026D8C(r5)] / 7; + if (r3 >= ARRAY_COUNT(gUnknown_082F7A88) - 1) + r3 = ARRAY_COUNT(gUnknown_082F7A88) - 1; + + r2 = gUnknown_082F7A88[r3][gUnknown_02022C98->unk31A0[0].unk14.unk0[r5]] - gUnknown_02022C98->unkD0[r5]; if (r2 < 6) + gUnknown_02022C98->unk9C[r5] += r2; + + if (++gUnknown_02022C98->unk9C[r5] >= 6) { - gUnknown_02022C98->unk_009C[r5] += r2; - } - if (++gUnknown_02022C98->unk_009C[r5] >= 6) - { - gUnknown_02022C98->unk_009C[r5] = 0; - if (gUnknown_02022C98->unk_00F4[r5][0] != 0xFF && gUnknown_02022C98->unk_00F4[r5][1] == 0xFF) - { - r4 = gUnknown_02022C98->unk_00F4[r5][0]; - } - else if (gUnknown_02022C98->unk_00F4[r5][0] == 0xFF && gUnknown_02022C98->unk_00F4[r5][1] == 0xFF) + gUnknown_02022C98->unk9C[r5] = 0; + if (gUnknown_02022C98->unkF4[r5][0] == 0xFF && gUnknown_02022C98->unkF4[r5][1] == 0xFF) { continue; } + else if (gUnknown_02022C98->unkF4[r5][0] != 0xFF && gUnknown_02022C98->unkF4[r5][1] == 0xFF) + { + r4 = gUnknown_02022C98->unkF4[r5][0]; + } else { - r7 = gUnknown_02022C98->unk_00F4[r5][0]; - r7_2 = gUnknown_02022C98->unk_00F4[r5][1]; - if ((Random() & 1)) + u8 unk0 = gUnknown_02022C98->unkF4[r5][0]; + i = gUnknown_02022C98->unkF4[r5][1]; // Have to re-use the variable to match. + if (!(Random() & 1)) { - r4 = r7_2; - r6 = r7; + r4 = unk0; + id = i; } else { - r4 = r7; - r6 = r7_2; + r4 = i; + id = unk0; } } - gUnknown_02022C98->unk_32CC.unk_14.unk_B[r5] = 7; - gUnknown_02022C98->unk_00C4[r5] = 2; - gUnknown_02022C98->unk_00A8[r4] = 3; - gUnknown_02022C98->unk_00B8[r5] = r4; - gUnknown_02022C98->unk_31A0[r4].unk_30 = 1; - gUnknown_02022C98->unk_31A0[r6].unk_34 = 1; - gUnknown_02022C98->unk_0086[r4]++; + gUnknown_02022C98->unk32CC.unk14.unkB[r5] = 7; + gUnknown_02022C98->unkC4[r5] = 2; + gUnknown_02022C98->unkA8[r4] = 3; + gUnknown_02022C98->unkB8[r5] = r4; + gUnknown_02022C98->unk31A0[r4].unk2C.unk4 = 1; + gUnknown_02022C98->unk31A0[id].unk2C.unk8 = 1; + gUnknown_02022C98->unk86[r4]++; sub_8026F1C(0, r5, r4); - sub_8027234(1); + sub_8027234(TRUE); sub_8026D1C(r4); - gUnknown_02022C98->unk_00E8[r5] = gUnknown_02022C98->unk_32CC.unk_14.unk_0[r5]; - gUnknown_02022C98->unk_32CC.unk_14.unk_0[r5] = 3; - gUnknown_02022C98->unk_00F4[r5][0] = 0xFF; - gUnknown_02022C98->unk_00F4[r5][1] = 0xFF; + gUnknown_02022C98->unkE8[r5] = gUnknown_02022C98->unk32CC.unk14.unk0[r5]; + gUnknown_02022C98->unk32CC.unk14.unk0[r5] = 3; + gUnknown_02022C98->unkF4[r5][0] = 0xFF; + gUnknown_02022C98->unkF4[r5][1] = 0xFF; } } } } -#else -NAKED -void sub_8026324(void) -{ - asm_unified("\tpush {r4-r7,lr}\n" - "\tmov r7, r10\n" - "\tmov r6, r9\n" - "\tmov r5, r8\n" - "\tpush {r5-r7}\n" - "\tsub sp, 0x10\n" - "\tldr r0, =gUnknown_02022C98\n" - "\tldr r1, [r0]\n" - "\tadds r0, r1, 0\n" - "\tadds r0, 0x44\n" - "\tldrb r0, [r0]\n" - "\tstr r0, [sp]\n" - "\tadds r0, r1, 0\n" - "\tadds r0, 0x48\n" - "\tldrb r0, [r0]\n" - "\tstr r0, [sp, 0x4]\n" - "\tadds r0, r1, 0\n" - "\tadds r0, 0x24\n" - "\tldrb r0, [r0]\n" - "\tstr r0, [sp, 0x8]\n" - "\tadds r0, r1, 0\n" - "\tadds r0, 0x40\n" - "\tldrb r0, [r0]\n" - "\tcmp r0, 0x9\n" - "\tbls _08026358\n" - "\tb _08026614\n" - "_08026358:\n" - "\tmovs r6, 0\n" - "\tldr r0, [sp, 0x8]\n" - "\tcmp r6, r0\n" - "\tbcs _08026440\n" - "_08026360:\n" - "\tldr r3, =gUnknown_02022C98\n" - "\tlsls r0, r6, 4\n" - "\tsubs r1, r0, r6\n" - "\tlsls r1, 2\n" - "\tldr r2, [r3]\n" - "\tadds r1, r2\n" - "\tldr r4, =0x000031cc\n" - "\tadds r4, r1\n" - "\tmov r8, r4\n" - "\tldrb r1, [r4]\n" - "\tmov r9, r0\n" - "\tadds r0, r6, 0x1\n" - "\tstr r0, [sp, 0xC]\n" - "\tcmp r1, 0\n" - "\tbeq _08026434\n" - "\tadds r0, r2, 0\n" - "\tadds r0, 0xA8\n" - "\tadds r0, r6\n" - "\tldrb r0, [r0]\n" - "\tcmp r0, 0x1\n" - "\tbne _08026434\n" - "\tldr r1, [sp]\n" - "\tmov r10, r1\n" - "\tldr r2, [sp, 0x4]\n" - "\tcmp r10, r2\n" - "\tbcs _08026434\n" - "\tadds r7, r3, 0\n" - "_08026396:\n" - "\tldr r0, =gUnknown_082F449C\n" - "\tadd r0, r10\n" - "\tldrb r5, [r0]\n" - "\tldr r1, [r7]\n" - "\tlsls r4, r5, 1\n" - "\tadds r0, r1, 0\n" - "\tadds r0, 0xF4\n" - "\tadds r0, r4\n" - "\tldrb r0, [r0]\n" - "\tcmp r0, r6\n" - "\tbeq _08026434\n" - "\tadds r0, r1, 0\n" - "\tadds r0, 0xF5\n" - "\tadds r0, r4\n" - "\tldrb r0, [r0]\n" - "\tcmp r0, r6\n" - "\tbeq _08026434\n" - "\tmov r0, r8\n" - "\tldrb r1, [r0]\n" - "\tadds r0, r6, 0\n" - "\tadds r2, r5, 0\n" - "\tbl sub_8026634\n" - "\tcmp r0, 0x1\n" - "\tbne _08026410\n" - "\tmovs r2, 0\n" - "\tldr r3, =gUnknown_02022C98\n" - "\tmov r8, r4\n" - "_080263CE:\n" - "\tldr r0, [r3]\n" - "\tmov r4, r8\n" - "\tadds r1, r2, r4\n" - "\tadds r0, 0xF4\n" - "\tadds r1, r0, r1\n" - "\tldrb r0, [r1]\n" - "\tcmp r0, 0xFF\n" - "\tbne _08026404\n" - "\tstrb r6, [r1]\n" - "\tldr r0, [r3]\n" - "\tadds r0, 0xA8\n" - "\tadds r0, r6\n" - "\tmovs r1, 0x2\n" - "\tstrb r1, [r0]\n" - "\tldr r0, [r3]\n" - "\tadds r0, 0xC4\n" - "\tadds r0, r5\n" - "\tmovs r1, 0x1\n" - "\tstrb r1, [r0]\n" - "\tb _08026434\n" - "\t.pool\n" - "_08026404:\n" - "\tadds r0, r2, 0x1\n" - "\tlsls r0, 24\n" - "\tlsrs r2, r0, 24\n" - "\tcmp r2, 0x1\n" - "\tbls _080263CE\n" - "\tb _08026434\n" - "_08026410:\n" - "\tldr r0, [r7]\n" - "\tmov r2, r9\n" - "\tsubs r1, r2, r6\n" - "\tlsls r1, 2\n" - "\tadds r0, r1\n" - "\tldr r4, =0x000031d4\n" - "\tadds r0, r4\n" - "\tldrb r0, [r0]\n" - "\tcmp r0, 0x1\n" - "\tbeq _08026434\n" - "\tmov r0, r10\n" - "\tadds r0, 0x1\n" - "\tlsls r0, 24\n" - "\tlsrs r0, 24\n" - "\tmov r10, r0\n" - "\tldr r0, [sp, 0x4]\n" - "\tcmp r10, r0\n" - "\tbcc _08026396\n" - "_08026434:\n" - "\tldr r1, [sp, 0xC]\n" - "\tlsls r0, r1, 24\n" - "\tlsrs r6, r0, 24\n" - "\tldr r2, [sp, 0x8]\n" - "\tcmp r6, r2\n" - "\tbcc _08026360\n" - "_08026440:\n" - "\tldr r4, [sp]\n" - "\tmov r10, r4\n" - "\tldr r0, [sp, 0x4]\n" - "\tcmp r10, r0\n" - "\tbcc _0802644C\n" - "\tb _08026614\n" - "_0802644C:\n" - "\tldr r1, =gUnknown_02022C98\n" - "\tmov r9, r1\n" - "_08026450:\n" - "\tmovs r6, 0xFF\n" - "\tldr r0, =gUnknown_082F449C\n" - "\tadd r0, r10\n" - "\tldrb r5, [r0]\n" - "\tmov r2, r9\n" - "\tldr r0, [r2]\n" - "\tadds r0, 0xC4\n" - "\tadds r0, r5\n" - "\tldrb r0, [r0]\n" - "\tcmp r0, 0x1\n" - "\tbeq _08026468\n" - "\tb _08026602\n" - "_08026468:\n" - "\tadds r0, r5, 0\n" - "\tbl sub_8026D8C\n" - "\tmov r1, r9\n" - "\tldr r4, [r1]\n" - "\tlsls r0, 24\n" - "\tlsrs r0, 24\n" - "\tadds r1, r4, 0\n" - "\tadds r1, 0x90\n" - "\tadds r1, r0\n" - "\tldrb r0, [r1]\n" - "\tmovs r1, 0x7\n" - "\tbl __udivsi3\n" - "\tlsls r0, 24\n" - "\tlsrs r3, r0, 24\n" - "\tcmp r3, 0x1\n" - "\tbls _0802648E\n" - "\tmovs r3, 0x2\n" - "_0802648E:\n" - "\tldr r2, =gUnknown_082F7A88\n" - "\tldr r0, =0x000031b4\n" - "\tadds r1, r4, r0\n" - "\tadds r1, r5\n" - "\tlsls r0, r3, 1\n" - "\tadds r0, r3\n" - "\tldrb r1, [r1]\n" - "\tadds r0, r1\n" - "\tadds r0, r2\n" - "\tldrb r1, [r0]\n" - "\tadds r0, r4, 0\n" - "\tadds r0, 0xD0\n" - "\tadds r0, r5\n" - "\tldrb r0, [r0]\n" - "\tsubs r2, r1, r0\n" - "\tcmp r2, 0x5\n" - "\tbgt _080264BC\n" - "\tadds r1, r4, 0\n" - "\tadds r1, 0x9C\n" - "\tadds r1, r5\n" - "\tldrb r0, [r1]\n" - "\tadds r0, r2\n" - "\tstrb r0, [r1]\n" - "_080264BC:\n" - "\tmov r2, r9\n" - "\tldr r1, [r2]\n" - "\tadds r1, 0x9C\n" - "\tadds r1, r5\n" - "\tldrb r0, [r1]\n" - "\tadds r0, 0x1\n" - "\tmovs r2, 0\n" - "\tstrb r0, [r1]\n" - "\tmovs r4, 0xFF\n" - "\tands r0, r4\n" - "\tcmp r0, 0x5\n" - "\tbhi _080264D6\n" - "\tb _08026602\n" - "_080264D6:\n" - "\tmov r1, r9\n" - "\tldr r0, [r1]\n" - "\tadds r0, 0x9C\n" - "\tadds r0, r5\n" - "\tstrb r2, [r0]\n" - "\tldr r3, [r1]\n" - "\tlsls r1, r5, 1\n" - "\tadds r0, r3, 0\n" - "\tadds r0, 0xF4\n" - "\tadds r2, r0, r1\n" - "\tldrb r0, [r2]\n" - "\tmov r8, r1\n" - "\tcmp r0, 0xFF\n" - "\tbne _08026518\n" - "\tadds r0, r3, 0\n" - "\tadds r0, 0xF5\n" - "\tadd r0, r8\n" - "\tldrb r0, [r0]\n" - "\tcmp r0, 0xFF\n" - "\tbne _08026500\n" - "\tb _08026602\n" - "_08026500:\n" - "\tb _08026528\n" - "\t.pool\n" - "_08026518:\n" - "\tadds r0, r3, 0\n" - "\tadds r0, 0xF5\n" - "\tadd r0, r8\n" - "\tldrb r0, [r0]\n" - "\tcmp r0, 0xFF\n" - "\tbne _08026528\n" - "\tldrb r4, [r2]\n" - "\tb _0802654E\n" - "_08026528:\n" - "\tmov r2, r9\n" - "\tldr r1, [r2]\n" - "\tadds r0, r1, 0\n" - "\tadds r0, 0xF4\n" - "\tadd r0, r8\n" - "\tldrb r7, [r0]\n" - "\tadds r1, 0xF5\n" - "\tadd r1, r8\n" - "\tldrb r6, [r1]\n" - "\tbl Random\n" - "\tmovs r1, 0x1\n" - "\tands r1, r0\n" - "\tcmp r1, 0\n" - "\tbne _0802654A\n" - "\tadds r4, r7, 0\n" - "\tb _0802654E\n" - "_0802654A:\n" - "\tadds r4, r6, 0\n" - "\tadds r6, r7, 0\n" - "_0802654E:\n" - "\tmov r1, r9\n" - "\tldr r0, [r1]\n" - "\tldr r2, =0x000032eb\n" - "\tadds r0, r2\n" - "\tadds r0, r5\n" - "\tmovs r1, 0x7\n" - "\tstrb r1, [r0]\n" - "\tmov r1, r9\n" - "\tldr r0, [r1]\n" - "\tadds r0, 0xC4\n" - "\tadds r0, r5\n" - "\tmovs r1, 0x2\n" - "\tstrb r1, [r0]\n" - "\tmov r2, r9\n" - "\tldr r0, [r2]\n" - "\tadds r0, 0xA8\n" - "\tadds r0, r4\n" - "\tmovs r1, 0x3\n" - "\tstrb r1, [r0]\n" - "\tldr r0, [r2]\n" - "\tadds r0, 0xB8\n" - "\tadds r0, r5\n" - "\tstrb r4, [r0]\n" - "\tldr r1, [r2]\n" - "\tlsls r0, r4, 4\n" - "\tsubs r0, r4\n" - "\tlsls r0, 2\n" - "\tadds r1, r0\n" - "\tldr r2, =0x000031d0\n" - "\tadds r1, r2\n" - "\tmovs r0, 0x1\n" - "\tstrb r0, [r1]\n" - "\tmov r2, r9\n" - "\tldr r1, [r2]\n" - "\tlsls r0, r6, 4\n" - "\tsubs r0, r6\n" - "\tlsls r0, 2\n" - "\tadds r1, r0\n" - "\tldr r0, =0x000031d4\n" - "\tadds r1, r0\n" - "\tmovs r2, 0x1\n" - "\tstrb r2, [r1]\n" - "\tmov r0, r9\n" - "\tldr r1, [r0]\n" - "\tlsls r0, r4, 1\n" - "\tadds r1, 0x86\n" - "\tadds r1, r0\n" - "\tldrh r0, [r1]\n" - "\tadds r0, 0x1\n" - "\tstrh r0, [r1]\n" - "\tmovs r0, 0\n" - "\tadds r1, r5, 0\n" - "\tadds r2, r4, 0\n" - "\tbl sub_8026F1C\n" - "\tmovs r0, 0x1\n" - "\tbl sub_8027234\n" - "\tadds r0, r4, 0\n" - "\tbl sub_8026D1C\n" - "\tmov r1, r9\n" - "\tldr r0, [r1]\n" - "\tadds r1, r0, 0\n" - "\tadds r1, 0xE8\n" - "\tadds r1, r5\n" - "\tldr r2, =0x000032e0\n" - "\tadds r0, r2\n" - "\tadds r0, r5\n" - "\tldrb r0, [r0]\n" - "\tstrb r0, [r1]\n" - "\tmov r4, r9\n" - "\tldr r0, [r4]\n" - "\tadds r0, r2\n" - "\tadds r0, r5\n" - "\tmovs r1, 0x3\n" - "\tstrb r1, [r0]\n" - "\tldr r1, [r4]\n" - "\tadds r1, 0xF4\n" - "\tadd r1, r8\n" - "\tldrb r0, [r1]\n" - "\tmovs r2, 0xFF\n" - "\torrs r0, r2\n" - "\tstrb r0, [r1]\n" - "\tldr r1, [r4]\n" - "\tadds r1, 0xF5\n" - "\tadd r1, r8\n" - "\tldrb r0, [r1]\n" - "\torrs r0, r2\n" - "\tstrb r0, [r1]\n" - "_08026602:\n" - "\tmov r0, r10\n" - "\tadds r0, 0x1\n" - "\tlsls r0, 24\n" - "\tlsrs r0, 24\n" - "\tmov r10, r0\n" - "\tldr r4, [sp, 0x4]\n" - "\tcmp r10, r4\n" - "\tbcs _08026614\n" - "\tb _08026450\n" - "_08026614:\n" - "\tadd sp, 0x10\n" - "\tpop {r3-r5}\n" - "\tmov r8, r3\n" - "\tmov r9, r4\n" - "\tmov r10, r5\n" - "\tpop {r4-r7}\n" - "\tpop {r0}\n" - "\tbx r0\n" - "\t.pool"); -} -#endif // NONMATCHING -u32 sub_8026634(u8 a0, u8 a1, u8 a2) +static bool32 sub_8026634(u8 a0, u8 a1, u8 a2) { s32 r7 = 0; - u8 r5 = gUnknown_02022C98->unk_0024 - 1; - struct DodrioBerryPickingSubstruct_31A0_14 * ptr = &gUnknown_02022C98->unk_32CC.unk_14; + u8 r5 = gUnknown_02022C98->unk24 - 1; + struct DodrioSubstruct_31A0_14 * ptr = &gUnknown_02022C98->unk32CC.unk14; switch (a1) { @@ -1938,13 +1740,13 @@ u32 sub_8026634(u8 a0, u8 a1, u8 a2) r7 = 2; break; } - if (ptr->unk_B[a2] == 6 || ptr->unk_B[a2] == 7) + if (ptr->unkB[a2] == 6 || ptr->unkB[a2] == 7) { - if (a2 == gUknnown_082F45AF[r7 + a0 * 3 + 15 * r5]) + if (a2 == gUknnown_082F45AF[r5][a0][r7]) { - if (gUnknown_02022C98->unk_00C4[a2] == 1 || gUnknown_02022C98->unk_00C4[a2] == 2) + if (gUnknown_02022C98->unkC4[a2] == 1 || gUnknown_02022C98->unkC4[a2] == 2) { - gUnknown_02022C98->unk_31A0[a0].unk_34 = 1; + gUnknown_02022C98->unk31A0[a0].unk2C.unk8 = 1; return FALSE; } else @@ -1955,98 +1757,3330 @@ u32 sub_8026634(u8 a0, u8 a1, u8 a2) } else { - if (a2 == gUknnown_082F45AF[r7 + a0 * 3 + 15 * r5]) + if (a2 == gUknnown_082F45AF[r5][a0][r7]) { - gUnknown_02022C98->unk_00A8[a0] = 4; - gUnknown_02022C98->unk_31A0[a0].unk_34 = 1; + gUnknown_02022C98->unkA8[a0] = 4; + gUnknown_02022C98->unk31A0[a0].unk2C.unk8 = 1; } } return FALSE; } -void sub_802671C(void) +static void sub_802671C(void) { - u8 r1 = gUnknown_02022C98->unk_0044; - u8 r9 = gUnknown_02022C98->unk_0048; + u8 r1 = gUnknown_02022C98->unk44; + u8 r9 = gUnknown_02022C98->unk48; u8 r3 = 0; u8 r10 = 0; u8 i; u8 r2; - struct DodrioBerryPickingStruct *ptr; + struct DodrioStruct *ptr; - gUnknown_02022C98->unk_0120 = 0; + gUnknown_02022C98->unk120 = 0; for (i = r1; i < r9 - 1; i++) { ptr = gUnknown_02022C98; - if (gUnknown_02022C98->unk_00C4[i] == 0 || gUnknown_02022C98->unk_00C4[i] == 1) + if (gUnknown_02022C98->unkC4[i] == 0 || gUnknown_02022C98->unkC4[i] == 1) { - gUnknown_02022C98->unk_0120 = 1; - if (ptr->unk_32CC.unk_14.unk_B[i] >= 10) + gUnknown_02022C98->unk120 = 1; + if (ptr->unk32CC.unk14.unkB[i] >= 10) { - ptr->unk_32CC.unk_14.unk_B[i] = 10; - gUnknown_02022C98->unk_00C4[i] = 3; - if (gUnknown_02022C98->unk_0148[i] == 0) + ptr->unk32CC.unk14.unkB[i] = 10; + gUnknown_02022C98->unkC4[i] = 3; + if (gUnknown_02022C98->unk148[i] == 0) { - gUnknown_02022C98->unk_0148[i] = 1; - PlaySE(SE_FUUSEN1 + ptr->unk_32CC.unk_14.unk_0[i]); + gUnknown_02022C98->unk148[i] = 1; + PlaySE(SE_FUUSEN1 + ptr->unk32CC.unk14.unk0[i]); } - if (gUnknown_02022C98->unk_0040 < 10 || r10 == 1) + if (gUnknown_02022C98->unk40 < 10 || r10 == 1) { r10 = 1; - gUnknown_02022C98->unk_0148[i] = 0; - if (gUnknown_02022C98->unk_0040 < 10) + gUnknown_02022C98->unk148[i] = 0; + if (gUnknown_02022C98->unk40 < 10) { - gUnknown_02022C98->unk_0040++; + gUnknown_02022C98->unk40++; } sub_8026F1C(3, i, 0); - sub_8027234(0); + sub_8027234(FALSE); } } else { - r3 = gUnknown_02022C98->unk_0090[sub_8026D8C(i)] / 7; + r3 = gUnknown_02022C98->unk90[sub_8026D8C(i)] / 7; if (r3 >= 2) { r3 = 2; } - r2 = gUnknown_082F7A88[r3][ptr->unk_32CC.unk_14.unk_0[i]]; - if (++gUnknown_02022C98->unk_00D0[i] >= r2) + r2 = gUnknown_082F7A88[r3][ptr->unk32CC.unk14.unk0[i]]; + if (++gUnknown_02022C98->unkD0[i] >= r2) { - ptr->unk_32CC.unk_14.unk_B[i]++; - gUnknown_02022C98->unk_00D0[i] = 0; + ptr->unk32CC.unk14.unkB[i]++; + gUnknown_02022C98->unkD0[i] = 0; } sub_8026324(); } } - else if (gUnknown_02022C98->unk_00C4[i] == 2) + else if (gUnknown_02022C98->unkC4[i] == 2) { - gUnknown_02022C98->unk_0120 = 1; - if (++gUnknown_02022C98->unk_00DC[i] >= 20) + gUnknown_02022C98->unk120 = 1; + if (++gUnknown_02022C98->unkDC[i] >= 20) { - gUnknown_02022C98->unk_31A0[gUnknown_02022C98->unk_00B8[i]].unk_30 = 0; - gUnknown_02022C98->unk_00DC[i] = 0; - gUnknown_02022C98->unk_00D0[i] = 0; - gUnknown_02022C98->unk_00C4[i] = 0; - ptr->unk_32CC.unk_14.unk_B[i] = 1; - ptr->unk_32CC.unk_14.unk_0[i] = sub_8026DB0(sub_8026D8C(i), i); + gUnknown_02022C98->unk31A0[gUnknown_02022C98->unkB8[i]].unk2C.unk4 = 0; + gUnknown_02022C98->unkDC[i] = 0; + gUnknown_02022C98->unkD0[i] = 0; + gUnknown_02022C98->unkC4[i] = 0; + ptr->unk32CC.unk14.unkB[i] = 1; + ptr->unk32CC.unk14.unk0[i] = sub_8026DB0(sub_8026D8C(i), i); } } - else if (gUnknown_02022C98->unk_00C4[i] == 3) + else if (gUnknown_02022C98->unkC4[i] == 3) { - if (++gUnknown_02022C98->unk_00DC[i] >= 20) + if (++gUnknown_02022C98->unkDC[i] >= 20) { - if (gUnknown_02022C98->unk_0040 < 10) + if (gUnknown_02022C98->unk40 < 10) { - gUnknown_02022C98->unk_00DC[i] = 0; - gUnknown_02022C98->unk_00D0[i] = 0; - gUnknown_02022C98->unk_00C4[i] = 0; - ptr->unk_32CC.unk_14.unk_B[i] = 1; - gUnknown_02022C98->unk_00E8[i] = ptr->unk_32CC.unk_14.unk_0[i]; - ptr->unk_32CC.unk_14.unk_0[i] = sub_8026DB0(sub_8026D8C(i), i); + gUnknown_02022C98->unkDC[i] = 0; + gUnknown_02022C98->unkD0[i] = 0; + gUnknown_02022C98->unkC4[i] = 0; + ptr->unk32CC.unk14.unkB[i] = 1; + gUnknown_02022C98->unkE8[i] = ptr->unk32CC.unk14.unk0[i]; + ptr->unk32CC.unk14.unk0[i] = sub_8026DB0(sub_8026D8C(i), i); } } } } } + +static void sub_8026988(void) +{ + u8 i, first, count; + + first = gUnknown_02022C98->unk44; + count = gUnknown_02022C98->unk48; + for (i = first; i < count; i++) + { + struct DodrioSubstruct_31A0 *ptr = &gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId]; + u8 var = gUnknown_082F449C[gUnknown_02022C98->unk24 - 1][gUnknown_02022C98->multiplayerId][i]; + + if (ptr->unk14.unkB[var] != 0) + sub_8028BF8(i, FALSE); + else + sub_8028BF8(i, TRUE); + + if (ptr->unk14.unkB[var] > 9) + { + sub_8028CA4(i, ptr->unk14.unk0[var] + 3); + sub_8028C7C(i, ptr->unk14.unkB[var] * 2 - 1); + } + else if (ptr->unk14.unk0[var] == 3) + { + ptr->unk14.unkB[var] = 7; + sub_8028CA4(i, 6); + sub_8028C7C(i, ptr->unk14.unkB[var] * 2 - 1); + } + else + { + sub_8028CA4(i, ptr->unk14.unk0[var]); + sub_8028C7C(i, ptr->unk14.unkB[var] * 2); + } + } +} + +static void sub_8026A88(void) +{ + u8 i, count; + + count = gUnknown_02022C98->unk24; + for (i = 0; i < count; i++) + { + struct DodrioSubstruct_31A0 *ptr = &gUnknown_02022C98->unk31A0[i]; + sub_80286B4(i, ptr->unk2C.unk0); + } +} + +static void sub_8026AC8(void) +{ + u8 i, count; + + count = gUnknown_02022C98->unk24; + for (i = 0; i < count; i++) + sub_80286B4(i, 4); +} + +static void sub_8026AF4(void) +{ + sub_8026988(); + if (gUnknown_02022C98->unk40 > 9) + sub_8026AC8(); + else + sub_8026A88(); + + sub_80288D4(gUnknown_02022C98->unk40); +} + +// This function is literally the same as the one above...Why? +static void sub_8026B28(void) +{ + sub_8026988(); + if (gUnknown_02022C98->unk40 > 9) + sub_8026AC8(); + else + sub_8026A88(); + + sub_80288D4(gUnknown_02022C98->unk40); +} + +static void sub_8026B5C(u8 arg0, u8 *arg1, u8 *arg2) +{ + switch (arg0) + { + case 1: + *arg1 = 4, *arg2 = 7; + break; + case 2: + *arg1 = 3, *arg2 = 8; + break; + case 3: + *arg1 = 2, *arg2 = 9; + break; + case 4: + *arg1 = 1, *arg2 = 10; + break; + case 5: + *arg1 = 0, *arg2 = 11; + break; + } +} + +static bool32 sub_8026BB8(void) +{ + u8 i, count; + + count = gUnknown_02022C98->unk24; + for (i = 1; i < count; i++) + { + if (gUnknown_02022C98->unk158[i] == 0) + gUnknown_02022C98->unk158[i] = sub_8027DFC(i); + } + + // This loop won't ever run, the seemingly poitnless assingment below is to make the compiler + // generate code for it. + count = count; + for (; i < count; i++) + { + if (gUnknown_02022C98->unk158[i] == 0) + return FALSE; + } + + return TRUE; +} + +static void sub_8026C28(void) +{ + u8 i; + + for (i = 0; i < 5; i++) + gUnknown_02022C98->unk158[i] = 0; +} + +static bool32 sub_8026C50(void) +{ + if (gUnknown_02022C98->unk40 > 9 && gUnknown_02022C98->unk120 == 0) + { + gUnknown_02022C98->unk40 = 10; + if (gUnknown_02022C98->unk12C != 0) + return TRUE; + } + + return FALSE; +} + +static bool32 sub_8026C90(void) +{ + u8 i, first, count; + + if (gUnknown_02022C98->unk40 > 9) + { + first = gUnknown_02022C98->unk44; + count = gUnknown_02022C98->unk48; + gUnknown_02022C98->unk40 = 10; + if (gUnknown_02022C98->unk12C != 0) + { + for (i = first; i < count; i++) + { + struct DodrioSubstruct_31A0 *ptr = &gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId]; + u8 var = gUnknown_082F449C[gUnknown_02022C98->unk24 - 1][gUnknown_02022C98->multiplayerId][i]; + + if (ptr->unk14.unkB[var] != 10) + return FALSE; + } + return TRUE; + } + } + + return FALSE; +} + +static void sub_8026D1C(u8 arg0) +{ + u8 var = gUnknown_082F7A9C[gUnknown_02022C98->unk90[arg0] % 7] + (gUnknown_02022C98->unk90[arg0] / 7) * 100; + if (gUnknown_02022C98->unk86[arg0] >= var) + gUnknown_02022C98->unk90[arg0]++; +} + +static u8 sub_8026D8C(u8 arg0) +{ + return gUnknown_082F4648[gUnknown_02022C98->unk24 - 1][arg0]; +} + +static u8 sub_8026DB0(u8 arg0, u8 arg1) +{ + u8 i, var3; + u8 count = gUnknown_02022C98->unk24 - 1; + u8 var0 = gUnknown_082F45FA[count][arg0][0]; + u8 var1 = gUnknown_082F45FA[count][arg0][1]; + u8 var2 = gUnknown_082F45FA[count][arg0][2]; + + for (i = 0; gUnknown_082F467F[count][i] != 0; i++) + { + if (arg1 == gUnknown_082F467F[count][i]) + return sub_8026E70(gUnknown_02022C98->unk90[var1], arg1); + } + + // Gets the highest of the three. + if (gUnknown_02022C98->unk90[var0] > gUnknown_02022C98->unk90[var1]) + var3 = gUnknown_02022C98->unk90[var0]; + else + var3 = gUnknown_02022C98->unk90[var1]; + + if (gUnknown_02022C98->unk90[var2] > var3) + var3 = gUnknown_02022C98->unk90[var2]; + + return sub_8026E70(var3, arg1); +} + +static u8 sub_8026E70(u8 arg0, u8 arg1) +{ + u8 var = gUnknown_02022C98->unkE8[arg1]; + switch (arg0 % 7) + { + default: return 0; + case 0: return 0; + case 1: return 1; + case 2: return 2; + case 3: + if (var == 0) + return 1; + else + return 0; + case 4: + if (var == 0) + return 2; + else + return 0; + case 5: + if (var == 2) + return 1; + else + return 2; + case 6: + if (var == 0) + return 1; + else if (var == 1) + return 2; + else + return 0; + } +} + +static bool32 sub_8026EEC(u16 arg0[5][6]) +{ + int sum, i; + for (sum = 0, i = 0; i < GetLinkPlayerCount(); sum += arg0[i][3], i++) + ; + + if (sum >= 11) + return TRUE; + else + return FALSE; +} + +static void sub_8026F1C(u8 arg0, u8 arg1, u8 arg2) +{ + u8 var; + u8 count = gUnknown_02022C98->unk24; + switch (arg0) + { + case 0: + case 1: + case 2: + var = gUnknown_02022C98->unk31A0[0].unk14.unk0[arg1]; + gUnknown_02022C98->unk4A[arg2][var] = IncrementWithLimit(gUnknown_02022C98->unk4A[arg2][var], 20000); + break; + case 3: + if (sub_8026EEC(gUnknown_02022C98->unk4A)) + break; + switch (count) + { + case 5: + switch (arg1) + { + case 0: + gUnknown_02022C98->unk4A[2][3]++; + gUnknown_02022C98->unk4A[3][3]++; + break; + case 1: + gUnknown_02022C98->unk4A[3][3]++; + break; + case 2: + gUnknown_02022C98->unk4A[3][3]++; + gUnknown_02022C98->unk4A[4][3]++; + break; + case 3: + gUnknown_02022C98->unk4A[4][3]++; + break; + case 4: + gUnknown_02022C98->unk4A[4][3]++; + gUnknown_02022C98->unk4A[0][3]++; + break; + case 5: + gUnknown_02022C98->unk4A[0][3]++; + break; + case 6: + gUnknown_02022C98->unk4A[0][3]++; + gUnknown_02022C98->unk4A[1][3]++; + break; + case 7: + gUnknown_02022C98->unk4A[1][3]++; + break; + case 8: + gUnknown_02022C98->unk4A[1][3]++; + gUnknown_02022C98->unk4A[2][3]++; + break; + case 9: + gUnknown_02022C98->unk4A[2][3]++; + break; + } + break; + case 4: + switch (arg1) + { + case 1: + gUnknown_02022C98->unk4A[2][3]++; + gUnknown_02022C98->unk4A[3][3]++; + break; + case 2: + gUnknown_02022C98->unk4A[3][3]++; + break; + case 3: + gUnknown_02022C98->unk4A[3][3]++; + gUnknown_02022C98->unk4A[0][3]++; + break; + case 4: + gUnknown_02022C98->unk4A[0][3]++; + break; + case 5: + gUnknown_02022C98->unk4A[0][3]++; + gUnknown_02022C98->unk4A[1][3]++; + break; + case 6: + gUnknown_02022C98->unk4A[1][3]++; + break; + case 7: + gUnknown_02022C98->unk4A[1][3]++; + gUnknown_02022C98->unk4A[2][3]++; + break; + case 8: + gUnknown_02022C98->unk4A[2][3]++; + break; + } + break; + case 3: + switch (arg1) + { + case 2: + gUnknown_02022C98->unk4A[1][3]++; + gUnknown_02022C98->unk4A[2][3]++; + break; + case 3: + gUnknown_02022C98->unk4A[2][3]++; + break; + case 4: + gUnknown_02022C98->unk4A[2][3]++; + gUnknown_02022C98->unk4A[0][3]++; + break; + case 5: + gUnknown_02022C98->unk4A[0][3]++; + break; + case 6: + gUnknown_02022C98->unk4A[0][3]++; + gUnknown_02022C98->unk4A[1][3]++; + break; + case 7: + gUnknown_02022C98->unk4A[1][3]++; + break; + } + break; + case 2: + switch (arg1) + { + case 3: + gUnknown_02022C98->unk4A[0][3]++; + gUnknown_02022C98->unk4A[1][3]++; + break; + case 4: + gUnknown_02022C98->unk4A[0][3]++; + break; + case 5: + gUnknown_02022C98->unk4A[0][3]++; + gUnknown_02022C98->unk4A[1][3]++; + break; + case 6: + gUnknown_02022C98->unk4A[1][3]++; + break; + } + break; + } + break; + } +} + +static void sub_8027234(bool32 arg0) +{ + if (gUnknown_02022C98->unk24 != 5) + return; + + if (arg0 == TRUE) + { + if (++gUnknown_02022C98->unk112 > gUnknown_02022C98->unk114) + gUnknown_02022C98->unk114 = gUnknown_02022C98->unk112; + if (gUnknown_02022C98->unk112 > 9999) + gUnknown_02022C98->unk112 = 9999; + } + else + { + if (gUnknown_02022C98->unk112 > gUnknown_02022C98->unk114) + gUnknown_02022C98->unk114 = gUnknown_02022C98->unk112; + gUnknown_02022C98->unk112 = 0; + } +} + +static void sub_80272A4(void) +{ + u8 i; + for (i = 0; i < gUnknown_02022C98->unk24; i++) + gUnknown_02022C98->unk4A[i][5] = gUnknown_02022C98->unk114; +} + +static void sub_80272E8(void) +{ + u8 i, j; + + for (i = 0; i < 5; i++) + { + for (j = 0; j < 11; j++) + gUnknown_02022C98->unk31A0[i].unk14.unkB[j] = 0; + gUnknown_02022C98->unk31A0[i].unk2C.unk0 = 0; + gUnknown_02022C98->unk31A0[i].unk2C.unk4 = 0; + gUnknown_02022C98->unk90[i] = 0; + gUnknown_02022C98->unk86[i] = 0; + gUnknown_02022C98->unk3308[i].unk0 = 0; + gUnknown_02022C98->unk3308[i].unk4 = 0; + gUnknown_02022C98->unk4A[i][0] = 0; + gUnknown_02022C98->unk4A[i][1] = 0; + gUnknown_02022C98->unk4A[i][2] = 0; + gUnknown_02022C98->unk4A[i][3] = 0; + gUnknown_02022C98->unk4A[i][4] = 0; + gUnknown_02022C98->unk4A[i][5] = 0; + } + gUnknown_02022C98->unk154 = 0; + gUnknown_02022C98->unk112 = 0; + gUnknown_02022C98->unk40 = 0; + sub_8026A88(); + sub_8026988(); +} + +static const s16 gUnknown_082F7B24[] = {10, 30, 50, 50}; + +static void sub_80273F0(void) +{ + u8 i, var = 0, var2 = 0; + + switch (gUnknown_02022C98->unk24) + { + case 4: var = 1; break; + case 5: var = 2; break; + } + + var2 = Random() % 10; + for (i = 0; i < 5; i++) + gUnknown_02022C98->unk4A[i][4] = gUnknown_082F7AA4[var][var2]; +} + +static u32 sub_802745C(u8 arg0) +{ + u32 sum = gUnknown_02022C98->unk4A[arg0][0] + + gUnknown_02022C98->unk4A[arg0][1] + + gUnknown_02022C98->unk4A[arg0][2]; + return min(sum, 9999); +} + +static void sub_802749C(void) +{ + u32 berriesPicked = Min(sub_802745C(gUnknown_02022C98->multiplayerId), 9999); + u32 score = Min(sub_80276C0(gUnknown_02022C98->multiplayerId), 999990); + + if (gSaveBlock2Ptr->berryPick.bestScore < score) + gSaveBlock2Ptr->berryPick.bestScore = score; + if (gSaveBlock2Ptr->berryPick.berriesPicked < berriesPicked) + gSaveBlock2Ptr->berryPick.berriesPicked = berriesPicked; + if (gSaveBlock2Ptr->berryPick.berriesPickedInRow < gUnknown_02022C98->unk114) + gSaveBlock2Ptr->berryPick.berriesPickedInRow = gUnknown_02022C98->unk114; +} + +static u8 sub_8027518(u8 arg0) +{ + u8 i, saved; + + saved = gUnknown_02022C98->unk98[3]; + for (i = 3; i != 0; i--) + gUnknown_02022C98->unk98[i] = gUnknown_02022C98->unk98[i - 1]; + gUnknown_02022C98->unk98[0] = arg0; + return saved; +} + +static void sub_8027554(void) +{ + if (gUnknown_02022C98->unkB0[gUnknown_02022C98->multiplayerId] == 0) + { + if (gMain.newKeys & DPAD_UP) + { + gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 = 2; + gUnknown_02022C98->unkB0[gUnknown_02022C98->multiplayerId] = 6; + PlaySE(SE_W204); + } + else if (gMain.newKeys & DPAD_LEFT) + { + gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 = 3; + gUnknown_02022C98->unkB0[gUnknown_02022C98->multiplayerId] = 6; + PlaySE(SE_W204); + } + else if (gMain.newKeys & DPAD_RIGHT) + { + gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 = 1; + gUnknown_02022C98->unkB0[gUnknown_02022C98->multiplayerId] = 6; + PlaySE(SE_W204); + } + else + { + gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 = 0; + } + } + else + { + gUnknown_02022C98->unkB0[gUnknown_02022C98->multiplayerId]--; + } +} + +static void sub_8027608(void) +{ + gUnknown_02022C98->unk31A0[gUnknown_02022C98->multiplayerId].unk2C.unk0 = 0; +} + +static u16 sub_802762C(void) +{ + return gUnknown_02022C98->unk4A[gUnknown_02022C98->multiplayerId][4] + FIRST_BERRY_INDEX; +} + +static u8 sub_8027650(void) +{ + return gUnknown_02022C98->unk24; +} + +static u8 *sub_8027660(u8 id) +{ + if (gReceivedRemoteLinkPlayers) + return gLinkPlayers[id].name; + else + return gUnknown_02022C98->unk31A0[id].name; +} + +static u16 sub_80276A0(u8 arg0, u8 arg1) +{ + return gUnknown_02022C98->unk4A[arg0][arg1]; +} + +static u32 sub_80276C0(u8 arg0) +{ + u8 i; + u32 var, sum = 0; + + for (i = 0; i < 3; i++) + sum += gUnknown_02022C98->unk4A[arg0][i] * gUnknown_082F7B24[i]; + + var = gUnknown_02022C98->unk4A[arg0][3] * gUnknown_082F7B24[3]; + if (sum <= var) + return 0; + else + return sum - var; +} + +static u32 sub_8027748(void) +{ + u8 i, count = gUnknown_02022C98->unk24; + u32 maxVar = sub_80276C0(0); + + for (i = 1; i < count; i++) + { + u32 var = sub_80276C0(i); + if (var > maxVar) + maxVar = var; + } + return Min(maxVar, 999990); +} + +static u32 sub_802778C(u8 arg0) +{ + u8 i, count = gUnknown_02022C98->unk24; + u16 maxVar = gUnknown_02022C98->unk4A[0][arg0]; + + for (i = 0; i < count; i++) + { + u16 var = gUnknown_02022C98->unk4A[i][arg0]; + if (var > maxVar) + maxVar = var; + } + return maxVar; +} + +static u32 sub_80277D0(u8 arg0) +{ + u32 vals[5], temp; + s16 r6 = TRUE; + u8 i, count = gUnknown_02022C98->unk24; + + for (i = 0; i < count; i++) + vals[i] = temp = sub_80276C0(i); + + while (r6) + { + r6 = FALSE; + for (i = 0; i < count - 1; i++) + { + if (vals[i] < vals[i + 1]) + { + SWAP(vals[i], vals[i + 1], temp); + r6 = TRUE; + } + } + } + + return vals[arg0]; +} + +static u32 sub_802784C(void) +{ + u8 i, r10 = 0, r8 = 0, r9 = 0, count = gUnknown_02022C98->unk24; + + // Function called two times for some reason. + sub_8027748(); + if (sub_8027748() == 0) + { + for (i = 0; i < count; i++) + { + gUnknown_02022C98->unk3308[i].unk0 = 4; + gUnknown_02022C98->unk3308[i].unk4 = 0; + } + } + + for (i = 0; i < count; i++) + gUnknown_02022C98->unk3308[i].unk4 = Min(sub_80276C0(i), 999990); + + do + { + u32 r6 = sub_80277D0(r10); + u8 r3 = r8; + for (i = 0; i < count; i++) + { + if (r6 == gUnknown_02022C98->unk3308[i].unk4) + { + gUnknown_02022C98->unk3308[i].unk0 = r3; + r8++; + r9++; + } + } + r10 = r8; + } while (r9 < count); + + return 0; +} + +static void sub_802793C(struct DodrioSubstruct_3308 *dst, u8 id) +{ + *dst = gUnknown_02022C98->unk3308[id]; +} + +// Unused function +static u8 sub_802795C(u8 arg0) +{ + u8 i, ret = 0, count = gUnknown_02022C98->unk24; + u32 var, vars[5] = {0}; + + for (i = 0; i < count; i++) + vars[i] = sub_80276C0(i); + + var = vars[arg0]; + for (i = 0; i < 5; i++) + { + if (i != arg0 && var < vars[i]) + ret++; + } + + return ret; +} + +static u8 sub_80279C8(void) +{ + u8 multiplayerId = gUnknown_02022C98->multiplayerId; + u16 itemId = sub_802762C(); + + if (sub_80276C0(multiplayerId) != sub_8027748()) + return 3; + if (!CheckBagHasSpace(itemId, 1)) + return 2; + + AddBagItem(itemId, 1); + if (!CheckBagHasSpace(itemId, 1)) + return 1; + return 0; +} + +// Really? What next, u32 Add(u32 a)return a+1;? +static u32 IncrementWithLimit(u32 a, u32 max) +{ + if (a < max) + return a + 1; + else + return max; +} + +// Gamefreak pls, min(a, b) ((a) < (b) ? (a) : (b)) is a well-known macro +static u32 Min(u32 a, u32 b) +{ + if (a < b) + return a; + else + return b; +} + +static u8 sub_8027A48(u8 id) +{ + return gUnknown_02022C98->unk34[id]; +} + +void sub_8027A5C(void) +{ + int i; + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES) + && GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_DODRIO) + { + gSpecialVar_Result = 1; + return; + } + } + + gSpecialVar_Result = 0; +} + +void sub_8027AAC(void) +{ + u8 taskId = CreateTask(sub_8027ACC, 0); + sub_8027ACC(taskId); +} + +// Data related to printing saved results. +static const struct WindowTemplate gUnknown_082F7B2C = +{ + .bg = 0, + .tilemapLeft = 5, + .tilemapTop = 1, + .width = 20, + .height = 11, + .paletteNum = 15, + .baseBlock = 0x1, +}; + +static const u8 *const gUnknown_082F7B34[3] = {gText_BerriesPicked, gText_BestScore, gText_BerriesInRowFivePlayers}; +static const u8 gUnknown_082F7B40[] = {4, 7, 4}; + +ALIGNED(4) +static const u8 gUnknown_082F7B44[][2] = {{25}, {41}, {57}}; +static const u8 gUnknown_082F7B4A[][2] = {{25}, {41}, {73}}; + +static void sub_8027ACC(u8 taskId) +{ + struct WindowTemplate window; + s32 i, width, widthCurr; + s16 *data = gTasks[taskId].data; + + switch (data[0]) + { + case 0: + window = gUnknown_082F7B2C; + width = GetStringWidth(1, gText_BerryPickingRecords, 0); + for (i = 0; i < ARRAY_COUNT(gUnknown_082F7B34); i++) + { + widthCurr = GetStringWidth(1, gUnknown_082F7B34[i], 0) + 50; + if (widthCurr > width) + width = widthCurr; + } + width = (width + 7) / 8; + if (width & 1) + width++; + window.tilemapLeft = (30 - width) / 2; + window.width = width; + data[1] = AddWindow(&window); + sub_8027BEC(data[1], width); + CopyWindowToVram(data[1], 3); + data[0]++; + break; + case 1: + if (!IsDma3ManagerBusyWithBgCopy()) + data[0]++; + break; + case 2: + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + { + rbox_fill_rectangle(data[1]); + CopyWindowToVram(data[1], 1); + data[0]++; + } + break; + case 3: + if (!IsDma3ManagerBusyWithBgCopy()) + { + RemoveWindow(data[1]); + DestroyTask(taskId); + EnableBothScriptContexts(); + } + break; + } +} + +static void sub_8027BEC(u8 windowId, s32 width) +{ + s32 i, x, numWidth; + s32 results[3]; + results[0] = gSaveBlock2Ptr->berryPick.berriesPicked; + results[1] = gSaveBlock2Ptr->berryPick.bestScore; + results[2] = gSaveBlock2Ptr->berryPick.berriesPickedInRow; + + LoadUserWindowBorderGfx_(windowId, 0x21D, 0xD0); + DrawTextBorderOuter(windowId, 0x21D, 0xD); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); + AddTextPrinterParameterized(windowId, 1, gText_BerryPickingRecords, GetStringCenterAlignXOffset(1, gText_BerryPickingRecords, width * 8), 1, TEXT_SPEED_FF, NULL); + for (i = 0; i < 3; i++) + { + ConvertIntToDecimalStringN(gStringVar1, results[i], STR_CONV_MODE_LEFT_ALIGN, gUnknown_082F7B40[i]); + numWidth = GetStringWidth(1, gStringVar1, -1); + AddTextPrinterParameterized(windowId, 1, gUnknown_082F7B34[i], 0, gUnknown_082F7B44[i][0], TEXT_SPEED_FF, NULL); + x = (width * 8) - numWidth; + AddTextPrinterParameterized(windowId, 1, gStringVar1, x, gUnknown_082F7B4A[i][0], TEXT_SPEED_FF, NULL); + } + PutWindowTilemap(windowId); +} + +// Debug functions? +static const u16 gUnknown_082F7B50[][4] = +{ + {9999, 0, 90, 9999}, + {9999, 9999, 70, 9999}, + {9999, 0, 9999, 0}, + {9999, 9999, 60, 0}, + {9999, 9999, 9999, 0}, +}; + +static const u8 gUnknown_082F7B78[] = _("あいうえおかき"); +static const u8 gUnknown_082F7B80[] = _("ABCDEFG"); +static const u8 gUnknown_082F7B88[] = _("0123456"); + +static const u8 *const gUnknown_082F7B90[] = +{ + gUnknown_082F7B78, + gUnknown_082F7B78, + gUnknown_082F7B78, + gUnknown_082F7B80, + gUnknown_082F7B88 +}; + +static void sub_8027D20(void) +{ + gUnknown_02022C98->unk24 = GetLinkPlayerCount(); +} + +static void sub_8027D38(void) +{ + u8 i, playerId; + + for (playerId = gUnknown_02022C98->unk24; playerId < 5; playerId++) + StringCopy(gLinkPlayers[playerId].name, gUnknown_082F7B90[playerId]); + + gUnknown_02022C98->unk24 = 5; + for (i = 0; i < 4; i++) + { + for (playerId = 0; playerId < gUnknown_02022C98->unk24; playerId++) + gUnknown_02022C98->unk4A[playerId][i] = gUnknown_082F7B50[playerId][i]; + } +} + +struct UnkPacket1 +{ + u8 id; + u8 ALIGNED(4) unk4; +}; + +static void sub_8027DD0(u32 arg0) +{ + struct UnkPacket1 packet; + packet.id = 1; + packet.unk4 = arg0; + sub_800FE50(&packet); +} + +static u32 sub_8027DFC(u32 arg0) +{ + struct UnkPacket1 *packet; + + if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00) + return 0; + + packet = (void *)&gRecvCmds[arg0][1]; + if (packet->id == 1) + return packet->unk4; + + return 0; +} + +struct UnkPacket2 +{ + u8 id; + u8 unk1_0:4; + u8 unk1_1:4; + u8 unk2_0:4; + u8 unk2_1:4; + u8 unk3_0:4; + u8 unk3_1:4; + u8 unk4_0:4; + u8 unk4_1:4; + u8 unk5_0:4; + u8 unk5_1:4; + u8 unk6_0:2; + u8 unk6_1:2; + u8 unk6_2:2; + u8 unk6_3:2; + u8 unk7_0:2; + u8 unk7_1:2; + u8 unk7_2:2; + u8 unk7_3:2; + u8 unk8_0:2; + u8 unk8_1:2; + u8 unk8_2:2; + u8 unk8_3:2; + u8 unk9_0:2; + u8 unk9_1:2; + u8 unk9_2:2; + u8 unk9_3:1; + u8 unk9_4:1; + u8 unkA_0:1; + u8 unkA_1:1; + u8 unkA_2:1; + u8 unkA_3:5; + u8 unkB_0:1; + u8 unkB_1:1; + u8 unkB_2:1; + u8 unkB_3:1; + u8 unkB_4:1; + u8 unkB_5:1; + u8 unkB_6:1; +}; + +#ifdef NONMATCHING +static void sub_8027E30(struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 arg6, u32 arg7, u32 arg8) +{ + struct UnkPacket2 packet; + struct DodrioSubstruct_31A0_14 *ptr = &arg0->unk14; + + packet.id = 2; + packet.unk1_0 = ptr->unkB[0]; + packet.unk1_1 = ptr->unkB[1]; + packet.unk2_0 = ptr->unkB[2]; + packet.unk2_1 = ptr->unkB[3]; + packet.unk3_0 = ptr->unkB[4]; + packet.unk3_1 = ptr->unkB[5]; + packet.unk4_0 = ptr->unkB[6]; + packet.unk4_1 = ptr->unkB[7]; + packet.unk5_0 = ptr->unkB[8]; + packet.unk5_1 = ptr->unkB[9]; + + packet.unk6_0 = ptr->unk0[0]; + packet.unk6_1 = ptr->unk0[1]; + packet.unk6_2 = ptr->unk0[2]; + packet.unk6_3 = ptr->unk0[3]; + packet.unk7_0 = ptr->unk0[4]; + packet.unk7_1 = ptr->unk0[5]; + packet.unk7_2 = ptr->unk0[6]; + packet.unk7_3 = ptr->unk0[7]; + packet.unk8_0 = ptr->unk0[8]; + packet.unk8_1 = ptr->unk0[9]; + + packet.unk8_2 = arg1->unk0; + packet.unk8_3 = arg2->unk0; + packet.unk9_0 = arg3->unk0; + packet.unk9_1 = arg4->unk0; + packet.unk9_2 = arg5->unk0; + + packet.unk9_3 = arg1->unk4; + packet.unk9_4 = arg2->unk4; + packet.unkA_0 = arg3->unk4; + packet.unkA_1 = arg4->unk4; + packet.unkA_2 = arg5->unk4; + + packet.unkB_2 = arg1->unk8; + packet.unkB_3 = arg2->unk8; + packet.unkB_4 = arg3->unk8; + packet.unkB_5 = arg4->unk8; + packet.unkB_6 = arg5->unk8; + + packet.unkA_3 = arg6; + packet.unkB_1 = arg7; + packet.unkB_0 = arg8; + sub_800FE50(&packet); +} +#else +NAKED +static void sub_8027E30(struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 arg6, u32 arg7, u32 arg8) +{ + asm_unified(" push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0x20\n\ + ldr r4, [sp, 0x48]\n\ + lsls r4, 24\n\ + str r4, [sp, 0x1C]\n\ + movs r4, 0x14\n\ + adds r4, r0\n\ + mov r9, r4\n\ + mov r5, sp\n\ + movs r4, 0x2\n\ + strb r4, [r5]\n\ + mov r10, sp\n\ + mov r5, r9\n\ + ldrb r4, [r5, 0xB]\n\ + movs r7, 0xF\n\ + adds r5, r7, 0\n\ + ands r5, r4\n\ + mov r6, r10\n\ + ldrb r6, [r6, 0x1]\n\ + mov r8, r6\n\ + movs r4, 0x10\n\ + negs r4, r4\n\ + mov r6, r8\n\ + ands r4, r6\n\ + orrs r4, r5\n\ + mov r5, r10\n\ + strb r4, [r5, 0x1]\n\ + mov r8, sp\n\ + mov r6, r9\n\ + ldrb r5, [r6, 0xC]\n\ + lsls r5, 4\n\ + ands r4, r7\n\ + orrs r4, r5\n\ + mov r5, r8\n\ + strb r4, [r5, 0x1]\n\ + ldrb r5, [r6, 0xD]\n\ + movs r6, 0xF\n\ + ands r5, r6\n\ + mov r4, r10\n\ + ldrb r4, [r4, 0x2]\n\ + mov r8, r4\n\ + movs r4, 0x10\n\ + negs r4, r4\n\ + mov r6, r8\n\ + ands r4, r6\n\ + orrs r4, r5\n\ + mov r5, r10\n\ + strb r4, [r5, 0x2]\n\ + mov r8, sp\n\ + mov r6, r9\n\ + ldrb r5, [r6, 0xE]\n\ + lsls r5, 4\n\ + ands r4, r7\n\ + orrs r4, r5\n\ + mov r5, r8\n\ + strb r4, [r5, 0x2]\n\ + ldrb r5, [r6, 0xF]\n\ + movs r6, 0xF\n\ + ands r5, r6\n\ + mov r4, r10\n\ + ldrb r4, [r4, 0x3]\n\ + mov r8, r4\n\ + movs r4, 0x10\n\ + negs r4, r4\n\ + mov r6, r8\n\ + ands r4, r6\n\ + orrs r4, r5\n\ + mov r5, r10\n\ + strb r4, [r5, 0x3]\n\ + mov r8, sp\n\ + mov r6, r9\n\ + ldrb r5, [r6, 0x10]\n\ + lsls r5, 4\n\ + ands r4, r7\n\ + orrs r4, r5\n\ + mov r5, r8\n\ + strb r4, [r5, 0x3]\n\ + ldrb r5, [r6, 0x11]\n\ + movs r6, 0xF\n\ + ands r5, r6\n\ + mov r4, r10\n\ + ldrb r4, [r4, 0x4]\n\ + mov r8, r4\n\ + movs r4, 0x10\n\ + negs r4, r4\n\ + mov r6, r8\n\ + ands r4, r6\n\ + orrs r4, r5\n\ + mov r5, r10\n\ + strb r4, [r5, 0x4]\n\ + mov r8, sp\n\ + mov r6, r9\n\ + ldrb r5, [r6, 0x12]\n\ + lsls r5, 4\n\ + ands r4, r7\n\ + orrs r4, r5\n\ + mov r5, r8\n\ + strb r4, [r5, 0x4]\n\ + ldrb r4, [r6, 0x13]\n\ + movs r6, 0xF\n\ + ands r4, r6\n\ + mov r6, r8\n\ + ldrb r5, [r6, 0x5]\n\ + movs r6, 0x10\n\ + negs r6, r6\n\ + ands r6, r5\n\ + orrs r6, r4\n\ + str r6, [sp, 0xC]\n\ + mov r4, r8\n\ + strb r6, [r4, 0x5]\n\ + mov r5, sp\n\ + mov r6, r9\n\ + ldrb r4, [r6, 0x14]\n\ + lsls r4, 4\n\ + ldr r6, [sp, 0xC]\n\ + ands r6, r7\n\ + orrs r6, r4\n\ + strb r6, [r5, 0x5]\n\ + mov r7, sp\n\ + movs r4, 0x3\n\ + mov r8, r4\n\ + ldrb r0, [r0, 0x14]\n\ + mov r5, r8\n\ + ands r0, r5\n\ + ldrb r5, [r7, 0x6]\n\ + movs r6, 0x4\n\ + negs r6, r6\n\ + mov r10, r6\n\ + mov r4, r10\n\ + ands r4, r5\n\ + orrs r4, r0\n\ + strb r4, [r7, 0x6]\n\ + mov r5, r9\n\ + ldrb r0, [r5, 0x1]\n\ + mov r6, r8\n\ + ands r0, r6\n\ + lsls r0, 2\n\ + movs r5, 0xD\n\ + negs r5, r5\n\ + ands r5, r4\n\ + orrs r5, r0\n\ + strb r5, [r7, 0x6]\n\ + mov r0, r9\n\ + ldrb r4, [r0, 0x2]\n\ + ands r4, r6\n\ + lsls r4, 4\n\ + movs r0, 0x31\n\ + negs r0, r0\n\ + ands r0, r5\n\ + orrs r0, r4\n\ + strb r0, [r7, 0x6]\n\ + mov r5, sp\n\ + mov r6, r9\n\ + ldrb r4, [r6, 0x3]\n\ + lsls r4, 6\n\ + movs r6, 0x3F\n\ + ands r0, r6\n\ + orrs r0, r4\n\ + strb r0, [r5, 0x6]\n\ + mov r4, r9\n\ + ldrb r0, [r4, 0x4]\n\ + mov r5, r8\n\ + ands r0, r5\n\ + ldrb r5, [r7, 0x7]\n\ + mov r4, r10\n\ + ands r4, r5\n\ + orrs r4, r0\n\ + strb r4, [r7, 0x7]\n\ + mov r6, r9\n\ + ldrb r0, [r6, 0x5]\n\ + mov r5, r8\n\ + ands r0, r5\n\ + lsls r0, 2\n\ + movs r5, 0xD\n\ + negs r5, r5\n\ + ands r5, r4\n\ + orrs r5, r0\n\ + strb r5, [r7, 0x7]\n\ + ldrb r4, [r6, 0x6]\n\ + mov r6, r8\n\ + ands r4, r6\n\ + lsls r4, 4\n\ + movs r0, 0x31\n\ + negs r0, r0\n\ + ands r0, r5\n\ + orrs r0, r4\n\ + strb r0, [r7, 0x7]\n\ + mov r5, sp\n\ + mov r6, r9\n\ + ldrb r4, [r6, 0x7]\n\ + lsls r4, 6\n\ + movs r6, 0x3F\n\ + ands r0, r6\n\ + orrs r0, r4\n\ + strb r0, [r5, 0x7]\n\ + mov r8, sp\n\ + mov r0, r9\n\ + ldrb r4, [r0, 0x8]\n\ + movs r7, 0x3\n\ + adds r0, r7, 0\n\ + ands r0, r4\n\ + mov r4, r8\n\ + ldrb r5, [r4, 0x8]\n\ + mov r4, r10\n\ + ands r4, r5\n\ + orrs r4, r0\n\ + mov r5, r8\n\ + strb r4, [r5, 0x8]\n\ + mov r6, r9\n\ + ldrb r5, [r6, 0x9]\n\ + adds r0, r7, 0\n\ + ands r0, r5\n\ + lsls r0, 2\n\ + movs r5, 0xD\n\ + negs r5, r5\n\ + ands r5, r4\n\ + orrs r5, r0\n\ + mov r0, r8\n\ + strb r5, [r0, 0x8]\n\ + ldrb r0, [r1]\n\ + adds r4, r7, 0\n\ + ands r4, r0\n\ + lsls r4, 4\n\ + movs r0, 0x31\n\ + negs r0, r0\n\ + ands r0, r5\n\ + orrs r0, r4\n\ + mov r4, r8\n\ + strb r0, [r4, 0x8]\n\ + mov r5, sp\n\ + ldrb r4, [r2]\n\ + lsls r4, 6\n\ + movs r6, 0x3F\n\ + ands r0, r6\n\ + orrs r0, r4\n\ + strb r0, [r5, 0x8]\n\ + ldrb r4, [r3]\n\ + adds r0, r7, 0\n\ + ands r0, r4\n\ + ldrb r4, [r5, 0x9]\n\ + mov r6, r10\n\ + ands r6, r4\n\ + orrs r6, r0\n\ + mov r10, r6\n\ + strb r6, [r5, 0x9]\n\ + ldr r0, [sp, 0x40]\n\ + ldrb r4, [r0]\n\ + adds r0, r7, 0\n\ + ands r0, r4\n\ + lsls r0, 2\n\ + movs r4, 0xD\n\ + negs r4, r4\n\ + ands r6, r4\n\ + orrs r6, r0\n\ + str r6, [sp, 0x10]\n\ + strb r6, [r5, 0x9]\n\ + mov r4, sp\n\ + ldr r5, [sp, 0x44]\n\ + ldrb r0, [r5]\n\ + adds r6, r7, 0\n\ + ands r6, r0\n\ + lsls r0, r6, 4\n\ + subs r7, 0x34\n\ + ldr r5, [sp, 0x10]\n\ + ands r7, r5\n\ + orrs r7, r0\n\ + strb r7, [r4, 0x9]\n\ + mov r5, sp\n\ + ldrb r0, [r1, 0x4]\n\ + movs r6, 0x1\n\ + mov r12, r6\n\ + mov r4, r12\n\ + ands r4, r0\n\ + lsls r4, 6\n\ + movs r0, 0x41\n\ + negs r0, r0\n\ + mov r10, r0\n\ + ands r0, r7\n\ + orrs r0, r4\n\ + strb r0, [r5, 0x9]\n\ + ldrb r4, [r2, 0x4]\n\ + lsls r4, 7\n\ + movs r5, 0x7F\n\ + ands r0, r5\n\ + orrs r0, r4\n\ + mov r4, r8\n\ + strb r0, [r4, 0x9]\n\ + ldrb r4, [r3, 0x4]\n\ + mov r0, r12\n\ + ands r0, r4\n\ + mov r5, r8\n\ + ldrb r4, [r5, 0xA]\n\ + movs r7, 0x2\n\ + negs r7, r7\n\ + adds r5, r7, 0\n\ + ands r5, r4\n\ + orrs r5, r0\n\ + mov r6, r8\n\ + strb r5, [r6, 0xA]\n\ + mov r9, sp\n\ + ldr r4, [sp, 0x40]\n\ + ldrb r0, [r4, 0x4]\n\ + mov r4, r12\n\ + ands r4, r0\n\ + lsls r4, 1\n\ + movs r6, 0x3\n\ + negs r6, r6\n\ + mov r8, r6\n\ + mov r0, r8\n\ + ands r0, r5\n\ + orrs r0, r4\n\ + mov r4, r9\n\ + strb r0, [r4, 0xA]\n\ + ldr r6, [sp, 0x44]\n\ + ldrb r5, [r6, 0x4]\n\ + mov r4, r12\n\ + ands r4, r5\n\ + lsls r4, 2\n\ + movs r5, 0x5\n\ + negs r5, r5\n\ + ands r0, r5\n\ + orrs r0, r4\n\ + mov r4, r9\n\ + strb r0, [r4, 0xA]\n\ + mov r4, sp\n\ + ldrb r1, [r1, 0x8]\n\ + mov r0, r12\n\ + ands r0, r1\n\ + lsls r0, 2\n\ + ldrb r1, [r4, 0xB]\n\ + ands r5, r1\n\ + orrs r5, r0\n\ + strb r5, [r4, 0xB]\n\ + ldrb r1, [r2, 0x8]\n\ + mov r0, r12\n\ + ands r0, r1\n\ + lsls r0, 3\n\ + movs r1, 0x9\n\ + negs r1, r1\n\ + ands r1, r5\n\ + orrs r1, r0\n\ + strb r1, [r4, 0xB]\n\ + ldrb r2, [r3, 0x8]\n\ + mov r0, r12\n\ + ands r0, r2\n\ + lsls r0, 4\n\ + movs r2, 0x11\n\ + negs r2, r2\n\ + ands r2, r1\n\ + orrs r2, r0\n\ + strb r2, [r4, 0xB]\n\ + mov r3, sp\n\ + ldr r5, [sp, 0x40]\n\ + ldrb r0, [r5, 0x8]\n\ + mov r1, r12\n\ + ands r1, r0\n\ + lsls r1, 5\n\ + movs r0, 0x21\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r3, 0xB]\n\ + mov r2, sp\n\ + ldrb r1, [r6, 0x8]\n\ + mov r6, r12\n\ + ands r6, r1\n\ + lsls r1, r6, 6\n\ + mov r3, r10\n\ + ands r0, r3\n\ + orrs r0, r1\n\ + strb r0, [r2, 0xB]\n\ + ldr r4, [sp, 0x1C]\n\ + lsrs r3, r4, 21\n\ + ldrb r1, [r2, 0xA]\n\ + movs r0, 0x7\n\ + ands r0, r1\n\ + orrs r0, r3\n\ + strb r0, [r2, 0xA]\n\ + mov r1, sp\n\ + ldr r5, [sp, 0x4C]\n\ + movs r6, 0x1\n\ + ands r5, r6\n\ + lsls r2, r5, 1\n\ + ldrb r0, [r1, 0xB]\n\ + mov r3, r8\n\ + ands r3, r0\n\ + orrs r3, r2\n\ + mov r8, r3\n\ + strb r3, [r1, 0xB]\n\ + mov r0, sp\n\ + ldr r4, [sp, 0x50]\n\ + ands r4, r6\n\ + mov r5, r8\n\ + ands r5, r7\n\ + orrs r5, r4\n\ + strb r5, [r0, 0xB]\n\ + bl sub_800FE50\n\ + add sp, 0x20\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ +"); +} +#endif + +static u32 sub_8028164(u32 unused, struct DodrioSubstruct_31A0 *arg0, struct DodrioSubstruct_31A0_2C *arg1, struct DodrioSubstruct_31A0_2C *arg2, struct DodrioSubstruct_31A0_2C *arg3, struct DodrioSubstruct_31A0_2C *arg4, struct DodrioSubstruct_31A0_2C *arg5, u8 *arg6, u32 *arg7, u32 *arg8) +{ + struct UnkPacket2 *packet; + struct DodrioSubstruct_31A0_14 *ptr = &arg0->unk14; + + if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00) + return 0; + + packet = (void *)&gRecvCmds[0][1]; + if (packet->id == 2) + { + ptr->unkB[0] = packet->unk1_0; + ptr->unkB[1] = packet->unk1_1; + ptr->unkB[2] = packet->unk2_0; + ptr->unkB[3] = packet->unk2_1; + ptr->unkB[4] = packet->unk3_0; + ptr->unkB[5] = packet->unk3_1; + ptr->unkB[6] = packet->unk4_0; + ptr->unkB[7] = packet->unk4_1; + ptr->unkB[8] = packet->unk5_0; + ptr->unkB[9] = packet->unk5_1; + ptr->unkB[10] = packet->unk1_0; + + ptr->unk0[0] = packet->unk6_0; + ptr->unk0[1] = packet->unk6_1; + ptr->unk0[2] = packet->unk6_2; + ptr->unk0[3] = packet->unk6_3; + ptr->unk0[4] = packet->unk7_0; + ptr->unk0[5] = packet->unk7_1; + ptr->unk0[6] = packet->unk7_2; + ptr->unk0[7] = packet->unk7_3; + ptr->unk0[8] = packet->unk8_0; + ptr->unk0[9] = packet->unk8_1; + ptr->unk0[10] = packet->unk6_0; + + arg1->unk0 = packet->unk8_2; + arg1->unk4 = packet->unk9_3; + arg1->unk8 = packet->unkB_2; + + arg2->unk0 = packet->unk8_3; + arg2->unk4 = packet->unk9_4; + arg2->unk8 = packet->unkB_3; + + arg3->unk0 = packet->unk9_0; + arg3->unk4 = packet->unkA_0; + arg3->unk8 = packet->unkB_4; + + arg4->unk0 = packet->unk9_1; + arg4->unk4 = packet->unkA_1; + arg4->unk8 = packet->unkB_5; + + arg5->unk0 = packet->unk9_2; + arg5->unk4 = packet->unkA_2; + arg5->unk8 = packet->unkB_6; + + *arg6 = packet->unkA_3; + *arg7 = packet->unkB_1; + *arg8 = packet->unkB_0; + return 1; + } + + return 0; +} + +struct UnkPacket3 +{ + u8 id; + u8 ALIGNED(4) unk4; +}; + +static void sub_80282EC(u8 arg0) +{ + struct UnkPacket3 packet; + packet.id = 3; + packet.unk4 = arg0; + sub_800FE50(&packet); +} + +static u32 sub_8028318(u32 arg0, u8 *arg1) +{ + struct UnkPacket3 *packet; + + if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00) + return 0; + + packet = (void *)&gRecvCmds[arg0][1]; + if (packet->id == 3) + { + *arg1 = packet->unk4; + return 1; + } + + return 0; +} + +struct UnkPacket4 +{ + u8 id; + u32 unk4; +}; + +static void sub_8028350(u32 arg0) +{ + struct UnkPacket4 packet; + packet.id = 4; + packet.unk4 = arg0; + sub_800FE50(&packet); +} + +static u32 sub_8028374(u32 arg0) +{ + struct UnkPacket4 *packet; + + if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00) + return 0; + + packet = (void *)&gRecvCmds[arg0][1]; + if (packet->id == 4) + return packet->unk4; + + return 0; +} + +// Large chunk of data +static const struct BgTemplate gUnknown_082F7BA4[] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 2, + .mapBaseIndex = 12, + .screenSize = 1, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 14, + .screenSize = 1, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 3, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, +}; + +// Unknown unreferenced data, feel free to remove. +static const u32 sUnused[] = {255, 0}; + +static const struct WindowTemplate gUnknown_082F7BBC[] = +{ + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 28, + .height = 2, + .paletteNum = 13, + .baseBlock = 0x13, + }, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 5, + .width = 28, + .height = 14, + .paletteNum = 13, + .baseBlock = 0x4B, + } +}; +static const struct WindowTemplate gUnknown_082F7BCC = +{ + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 5, + .width = 28, + .height = 7, + .paletteNum = 13, + .baseBlock = 0x4B, +}; +static const struct WindowTemplate gUnknown_082F7BD4[] = +{ + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 8, + .width = 19, + .height = 3, + .paletteNum = 13, + .baseBlock = 0x13, + }, + { + .bg = 0, + .tilemapLeft = 22, + .tilemapTop = 7, + .width = 6, + .height = 4, + .paletteNum = 13, + .baseBlock = 0x4C, + } +}; +static const struct WindowTemplate gUnknown_082F7BE4 = +{ + .bg = 0, + .tilemapLeft = 4, + .tilemapTop = 6, + .width = 22, + .height = 5, + .paletteNum = 13, + .baseBlock = 0x13, +}; +static const struct WindowTemplate gUnknown_082F7BEC = +{ + .bg = 0, + .tilemapLeft = 5, + .tilemapTop = 8, + .width = 19, + .height = 3, + .paletteNum = 13, + .baseBlock = 0x13, +}; + +// This is an unused copy of the tables from the top of the file. Feel free to remove. +static const u8 sDuplicateArray[] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 3, 8, 9, 0, 0, 1, 2, 5, 6, 3, 4, 5, 8, 9, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 2, 9, + 0, 0, 1, 4, 5, 6, 7, 2, 3, 4, 9, 0, 0, 1, 6, 7, 2, 3, 4, 5, 6, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 1, 0, 0, 3, 4, 5, 6, 7, 8, 1, 2, 3, 0, 0, 5, 6, 7, 8, 1, 2, 3, 4, 5, 0, 0, 7, + 8, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 3, 4, 5, 6, 7, 8, 9, 0, + 1, 2, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 4, 5, 6, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 5, 5, 6, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 6, 7, 2, 2, 3, 4, 0, 0, 0, 0, 0, 0, + 3, 4, 5, 5, 6, 7, 7, 8, 1, 1, 2, 3, 0, 0, 0, 4, 5, 6, 6, 7, 8, 8, 9, 0, 0, 1, 2, 2, 3, 4, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 0, 1, + 2, 1, 2, 3, 2, 3, 0, 0, 0, 0, 4, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3, 4, 3, 4, 0, 0, 0, 0, 9, 9, 9, 9, 1, 1, 1, 9, 9, 9, 9, 9, + 9, 9, 0, 0, 1, 1, 0, 9, 9, 9, 9, 9, 2, 2, 0, 0, 1, 1, 1, 9, 9, 9, 3, 3, 0, 0, 1, 1, 2, 2, 3, 9, 3, 3, 4, 4, 0, 0, 1, 1, + 2, 2, 3, 5, 0, 0, 0, 0, 4, 6, 0, 0, 0, 3, 5, 7, 0, 0, 2, 4, 6, 8, 0, 1, 3, 5, 6, 9 +}; + +static const u16 gDodrioBerryBgPal1[] = INCBIN_U16("graphics/link_games/dodrioberry_bg1.gbapal", + "graphics/link_games/dodrioberry_bg2.gbapal"); +static const u16 gDodrioBerryPkmnPal[] = INCBIN_U16("graphics/link_games/dodrioberry_pkmn.gbapal"); +static const u16 gDodrioBerryShinyPal[] = INCBIN_U16("graphics/link_games/dodrioberry_shiny.gbapal"); +static const u16 gDodrioBerryStatusPal[] = INCBIN_U16("graphics/link_games/dodrioberry_status.gbapal"); +static const u16 gDodrioBerrySpritesPal[] = INCBIN_U16("graphics/link_games/dodrioberry_berrysprites.gbapal"); +static const u32 gDodrioBerrySpritesGfx[] = INCBIN_U32("graphics/link_games/dodrioberry_berrysprites.4bpp.lz"); +static const u16 gDodrioBerryPlatformPal[] = INCBIN_U16("graphics/link_games/dodrioberry_platform.gbapal"); +static const u32 gDodrioBerryBgGfx1[] = INCBIN_U32("graphics/link_games/dodrioberry_bg1.4bpp.lz"); +static const u32 gDodrioBerryBgGfx2[] = INCBIN_U32("graphics/link_games/dodrioberry_bg2.4bpp.lz"); +static const u32 gDodrioBerryStatusGfx[] = INCBIN_U32("graphics/link_games/dodrioberry_status.4bpp.lz"); +static const u32 gDodrioBerryPlatformGfx[] = INCBIN_U32("graphics/link_games/dodrioberry_platform.4bpp.lz"); +static const u32 gDodrioBerryPkmnGfx[] = INCBIN_U32("graphics/link_games/dodrioberry_pkmn.4bpp.lz"); +static const u32 gDodrioBerryBgTilemap1[] = INCBIN_U32("graphics/link_games/dodrioberry_bg1.bin.lz"); +static const u32 gDodrioBerryBgTilemap2Right[] = INCBIN_U32("graphics/link_games/dodrioberry_bg2right.bin.lz"); +static const u32 gDodrioBerryBgTilemap2Left[] = INCBIN_U32("graphics/link_games/dodrioberry_bg2left.bin.lz"); + +static const struct OamData sOamData_82FB1E0 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct OamData sOamData_82FB1E8 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct OamData sOamData_82FB1F0 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct OamData sOamData_82FB1F8 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 3, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AnimCmd sSpriteAnim_82FB200[] = +{ + ANIMCMD_FRAME(0, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB208[] = +{ + ANIMCMD_FRAME(64, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB210[] = +{ + ANIMCMD_FRAME(128, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB218[] = +{ + ANIMCMD_FRAME(192, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB220[] = +{ + ANIMCMD_FRAME(256, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const sSpriteAnimTable_82FB228[] = +{ + sSpriteAnim_82FB200, + sSpriteAnim_82FB208, + sSpriteAnim_82FB210, + sSpriteAnim_82FB218, + sSpriteAnim_82FB220 +}; + +static const union AnimCmd sSpriteAnim_82FB23C[] = +{ + ANIMCMD_FRAME(0, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB244[] = +{ + ANIMCMD_FRAME(4, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB24C[] = +{ + ANIMCMD_FRAME(8, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const sSpriteAnimTable_82FB254[] = +{ + sSpriteAnim_82FB23C, + sSpriteAnim_82FB244, + sSpriteAnim_82FB24C +}; + +static const union AnimCmd sSpriteAnim_82FB260[] = +{ + ANIMCMD_FRAME(0, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB268[] = +{ + ANIMCMD_FRAME(4, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB270[] = +{ + ANIMCMD_FRAME(8, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB278[] = +{ + ANIMCMD_FRAME(12, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB280[] = +{ + ANIMCMD_FRAME(16, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB288[] = +{ + ANIMCMD_FRAME(20, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB290[] = +{ + ANIMCMD_FRAME(24, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB298[] = +{ + ANIMCMD_FRAME(28, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_82FB2A0[] = +{ + ANIMCMD_FRAME(32, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const sSpriteAnimTable_82FB2A8[] = +{ + sSpriteAnim_82FB260, + sSpriteAnim_82FB268, + sSpriteAnim_82FB270, + sSpriteAnim_82FB278, + sSpriteAnim_82FB280, + sSpriteAnim_82FB288, + sSpriteAnim_82FB290, + sSpriteAnim_82FB298, + sSpriteAnim_82FB2A0 +}; + +static const union AnimCmd sSpriteAnim_82FB2CC[] = +{ + ANIMCMD_FRAME(0, 20), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const sSpriteAnimTable_82FB2D4[] = +{ + sSpriteAnim_82FB2CC +}; + +static void sub_80283A8(void) +{ + void *ptr = AllocZeroed(0x3000); + struct SpritePalette pal1 = {gDodrioBerryPkmnPal, 0}; + struct SpritePalette pal2 = {gDodrioBerryShinyPal, 1}; + + LZ77UnCompWram(gDodrioBerryPkmnGfx, ptr); + // This check should be one line up. + if (ptr != NULL) + { + struct SpriteSheet sheet = {ptr, 0x3000, 0}; + LoadSpriteSheet(&sheet); + Free(ptr); + } + LoadSpritePalette(&pal1); + LoadSpritePalette(&pal2); +} + +static void sub_8028408(struct DodrioSubstruct_318C *arg0, u8 arg1, u8 id, u8 arg3) +{ + struct SpriteTemplate sprTemplate = + { + .tileTag = 0, + .paletteTag = arg0->isShiny, + .oam = &sOamData_82FB1E0, + .anims = sSpriteAnimTable_82FB228, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80284A8, + }; + + gUnknown_02022C9C[id] = AllocZeroed(4); + *gUnknown_02022C9C[id] = CreateSprite(&sprTemplate, sub_8028F14(arg1, arg3), 136, 3); + sub_8028654(TRUE, id); +} + +static void sub_80284A8(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + break; + case 1: + sub_802853C(sprite); + break; + case 2: + sub_80285AC(sprite); + break; + } +} + +static void sub_80284CC(u8 unused) +{ + struct Sprite *sprite = &gSprites[*gUnknown_02022C9C[GetMultiplayerId()]]; + sprite->data[0] = 1; + sprite->data[1] = 0; + sprite->data[2] = 0; + sprite->data[3] = 0; + sprite->data[4] = 0; +} + +static void sub_8028504(u8 unused) +{ + struct Sprite *sprite = &gSprites[*gUnknown_02022C9C[GetMultiplayerId()]]; + sprite->data[0] = 2; + sprite->data[1] = 0; + sprite->data[2] = 0; + sprite->data[3] = 0; + sprite->data[4] = 0; +} + +static u32 sub_802853C(struct Sprite *sprite) +{ + s8 var; + u8 mod = (++sprite->data[1] / 2) % 4; + + if (sprite->data[1] >= 3) + { + switch (mod) + { + default: + var = 1; + break; + case 1: + case 2: + var = -1; + break; + } + + sprite->pos1.x += var; + if (++sprite->data[1] >= 40) + { + sprite->data[0] = 0; + sprite->pos1.x = sub_8028F14(0, sub_8027650()); + } + } + + return 0; +} + +static u32 sub_80285AC(struct Sprite *sprite) +{ + u8 mod = (++sprite->data[1] / 13) % 4; + + if (sprite->data[1] % 13 == 0 && mod != 0) + PlaySE(SE_W204); + if (sprite->data[1] >= 104) + { + sprite->data[0] = 0; + mod = 0; + } + sub_80286B4(GetMultiplayerId(), mod); + return 0; +} + +static void sub_8028614(u8 count) +{ + u8 i; + for (i = 0; i < count; i++) + { + struct Sprite *sprite = &gSprites[*gUnknown_02022C9C[i]]; + if (sprite != NULL) + DestroySpriteAndFreeResources(sprite); + // Memory should be freed here but is not. + } +} + +static void sub_8028654(bool8 invisible, u8 id) +{ + gSprites[*gUnknown_02022C9C[id]].invisible = invisible; +} + +static void sub_802868C(bool8 invisible, u8 count) +{ + u8 i; + for (i = 0; i < count; i++) + sub_8028654(invisible, i); +} + +static void sub_80286B4(u8 id, u8 frameNum) +{ + StartSpriteAnim(&gSprites[*gUnknown_02022C9C[id]], frameNum); +} + +static void nullsub_15(struct Sprite *sprite) +{ + +} + +static void sub_80286E4(void) +{ + u8 i; + for (i = 0; i < 10; i++) + { + struct Sprite *sprite = &gSprites[gUnknown_02022CF4->unk2A[i]]; + sprite->pos1.x = (i * 16) + 48; + sprite->pos1.y = -8 - (i * 8); + gUnknown_02022CF4->unkC[i] = 0; + } +} + +static void sub_8028734(void) +{ + u8 i; + void *ptr = AllocZeroed(0x180); + struct SpritePalette spPal = {gDodrioBerryStatusPal, 2}; + + LZ77UnCompWram(gDodrioBerryStatusGfx, ptr); + // This check should be one line up. + if (ptr != NULL) + { + struct SpriteSheet spSheet = {ptr, 0x180, 1}; + struct SpriteTemplate spTemplate = + { + .tileTag = 1, + .paletteTag = 2, + .oam = &sOamData_82FB1E8, + .anims = sSpriteAnimTable_82FB254, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = nullsub_15, + }; + + gUnknown_02022CF4 = AllocZeroed(sizeof(*gUnknown_02022CF4)); + LoadSpriteSheet(&spSheet); + LoadSpritePalette(&spPal); + for (i = 0; i < 10; i++) + gUnknown_02022CF4->unk2A[i] = CreateSprite(&spTemplate, (i * 16) + 48, -8 - (i * 8), 0); + } + + Free(ptr); +} + +static void sub_80287E4(void) +{ + u8 i; + for (i = 0; i < 10; i++) + { + struct Sprite *sprite = &gSprites[gUnknown_02022CF4->unk2A[i]]; + if (sprite != NULL) + DestroySpriteAndFreeResources(sprite); + } + FREE_AND_SET_NULL(gUnknown_02022CF4); +} + +static bool32 sub_8028828(void) +{ + u8 i; + bool32 r3 = FALSE; + for (i = 0; i < 10; i++) + { + struct Sprite *sprite = &gSprites[gUnknown_02022CF4->unk2A[i]]; + gUnknown_02022CF4->unk16[i] = 2; + if (gUnknown_02022CF4->unkC[i] != 0 && sprite->pos1.y == 8) + continue; + r3 = TRUE; + if (sprite->pos1.y == 8) + { + if (gUnknown_02022CF4->unkC[i] != 0) + continue; + gUnknown_02022CF4->unkC[i] = 1; + gUnknown_02022CF4->unk16[i] = -16; + PlaySE(SE_TK_KASYA); + } + sprite->pos1.y += gUnknown_02022CF4->unk16[i]; + } + + if (r3) + return FALSE; + else + return TRUE; +} + +static void sub_80288D4(u8 arg0) +{ + u8 i; + + if (arg0 > 10) + { + for (i = 0; i < 10; i++) + StartSpriteAnim(&gSprites[gUnknown_02022CF4->unk2A[i]], 1); + } + else + { + for (i = 0; i < 10 - arg0; i++) + { + if (arg0 > 6) + { + gUnknown_02022CF4->unk3E += arg0 - 6; + if (gUnknown_02022CF4->unk3E > 30) + gUnknown_02022CF4->unk3E = 0; + else if (gUnknown_02022CF4->unk3E > 10) + StartSpriteAnim(&gSprites[gUnknown_02022CF4->unk2A[i]], 2); + else + StartSpriteAnim(&gSprites[gUnknown_02022CF4->unk2A[i]], 0); + } + else + { + StartSpriteAnim(&gSprites[gUnknown_02022CF4->unk2A[i]], 0); + } + } + for (; i < 10; i++) + StartSpriteAnim(&gSprites[gUnknown_02022CF4->unk2A[i]], 1); + } +} + +static void sub_80289E8(bool8 invisible) +{ + u8 i; + for (i = 0; i < 10; i++) + gSprites[gUnknown_02022CF4->unk2A[i]].invisible = invisible; +} + +// Unknown unused data, feel free to remove. +static const u8 sUnused2[] = {0xD4, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0xFB, 0x0, 0x0}; + +static void sub_8028A34(void) +{ + void *ptr = AllocZeroed(0x480); + struct SpritePalette sprPal = {gDodrioBerrySpritesPal, 3}; + + LZ77UnCompWram(gDodrioBerrySpritesGfx, ptr); + if (ptr != NULL) + { + struct SpriteSheet sprSheet = {ptr, 0x480, 2}; + LoadSpriteSheet(&sprSheet); + } + + LoadSpritePalette(&sprPal); + Free(ptr); +} + +static const s16 gUnknown_082FB31C[] = {88, 128, 168, 208}; + +static void sub_8028A88(void) +{ + u8 i; + s16 x; + + struct SpriteTemplate sprTemplate1 = + { + .tileTag = 2, + .paletteTag = 3, + .oam = &sOamData_82FB1F0, + .anims = sSpriteAnimTable_82FB2A8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }; + struct SpriteTemplate sprTemplate2 = + { + .tileTag = 2, + .paletteTag = 3, + .oam = &sOamData_82FB1E8, + .anims = sSpriteAnimTable_82FB2A8, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }; + + for (i = 0; i < 11; i++) + { + gUnknown_02022CB8[i] = AllocZeroed(4); + x = i * 16; + *gUnknown_02022CB8[i] = CreateSprite(&sprTemplate1, x + (i * 8), 8, 1); + sub_8028BF8(i, TRUE); + } + for (i = 0; i < 4; i++) + { + gUnknown_02022CE4[i] = AllocZeroed(4); + if (i == 3) + *gUnknown_02022CE4[i] = CreateSprite(&sprTemplate2, gUnknown_082FB31C[i], 49, 0); + else + *gUnknown_02022CE4[i] = CreateSprite(&sprTemplate2, gUnknown_082FB31C[i], 52, 0); + StartSpriteAnim(&gSprites[*gUnknown_02022CE4[i]], i); + } + + sub_8028C30(TRUE); +} + +static void sub_8028B80(void) +{ + struct Sprite *sprite; + u8 i; + + for (i = 0; i < 11; i++) + { + sprite = &gSprites[*gUnknown_02022CB8[i]]; + if (sprite != NULL) + DestroySprite(sprite); + FREE_AND_SET_NULL(gUnknown_02022CB8[i]); + } + for (i = 0; i < 4; i++) + { + sprite = &gSprites[*gUnknown_02022CE4[i]]; + if (sprite != NULL) + DestroySprite(sprite); + FREE_AND_SET_NULL(gUnknown_02022CE4[i]); + } +} + +static void sub_8028BF8(u8 id, bool8 invisible) +{ + gSprites[*gUnknown_02022CB8[id]].invisible = invisible; +} + +static void sub_8028C30(bool8 invisible) +{ + u8 i; + for (i = 0; i < 4; i++) + gSprites[*gUnknown_02022CE4[i]].invisible = invisible; +} + +static void sub_8028C7C(u8 id, u8 y) +{ + gSprites[*gUnknown_02022CB8[id]].pos1.y = y * 8; +} + +static void sub_8028CA4(u16 id, u8 frameNum) +{ + StartSpriteAnim(&gSprites[*gUnknown_02022CB8[id]], frameNum); +} + +// Unused +static void sub_8028CD0(u8 spriteId) +{ + gSprites[spriteId].pos1.x = 20 * spriteId + 50; + gSprites[spriteId].pos1.y = 50; +} + +// Gamefreak made a mistake there and goes out of bounds for the data array as it holds 8 elements +// in turn overwriting sprite's subpriority and subsprites fields. +#if defined(NONMATCHING) || MODERN + #define sKeepPosX data[1] +#else + #define sKeepPosX data[10] +#endif // NONMATCHING + +static void sub_8028CF4(struct Sprite *sprite) +{ + u8 i; + static const u8 array[] = {30, 20}; + + if (sprite->sKeepPosX != TRUE) + { + for (i = 0; i < 2; i++) + { + if (++gUnknown_02022CB0[i][1] > array[i]) + { + sprite->pos1.x--; + gUnknown_02022CB0[i][1] = 0; + } + } + } +} + +static const s16 gUnknown_082FB356[][2] = {{230, 55}, {30, 74}}; + +static void sub_8028D44(void) +{ + u8 i; + void *ptr = AllocZeroed(0x400); + struct SpritePalette sprPal = {gDodrioBerryPlatformPal, 6}; + + LZ77UnCompWram(gDodrioBerryPlatformGfx, ptr); + if (ptr != NULL) + { + struct SpriteSheet sprSheet = {ptr, 0x400, 5}; + struct SpriteTemplate sprTemplate = + { + .tileTag = 5, + .paletteTag = 6, + .oam = &sOamData_82FB1F8, + .anims = sSpriteAnimTable_82FB2D4, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8028CF4, + }; + + LoadSpriteSheet(&sprSheet); + LoadSpritePalette(&sprPal); + for (i = 0; i < 2; i++) + { + gUnknown_02022CB0[i] = AllocZeroed(4); + *gUnknown_02022CB0[i] = CreateSprite(&sprTemplate, gUnknown_082FB356[i][0], gUnknown_082FB356[i][1], 4); + } + } + + Free(ptr); +} + +static void sub_8028DFC(void) +{ + u8 i; + for (i = 0; i < 2; i++) + { + struct Sprite *sprite = &gSprites[*gUnknown_02022CB0[i]]; + sprite->sKeepPosX = TRUE; + sprite->pos1.x = gUnknown_082FB356[i][0]; + sprite->pos1.y = gUnknown_082FB356[i][1]; + } +} + +static void sub_8028E4C(void) +{ + u8 i; + for (i = 0; i < 2; i++) + { + struct Sprite *sprite = &gSprites[*gUnknown_02022CB0[i]]; + sprite->sKeepPosX = FALSE; + } +} + +static void sub_8028E84(void) +{ + u8 i; + for (i = 0; i < 2; i++) + { + struct Sprite *sprite = &gSprites[*gUnknown_02022CB0[i]]; + if (sprite) + DestroySprite(sprite); + FREE_AND_SET_NULL(gUnknown_02022CB0[i]); + } +} + +static void sub_8028EC8(bool8 invisible) +{ + u8 i; + for (i = 0; i < 2; i++) + gSprites[*gUnknown_02022CB0[i]].invisible = invisible; +} + +#undef sKeepPosX + +static s16 sub_8028F14(u8 arg0, u8 arg1) +{ + s16 x = 0; + switch (arg1) + { + case 1: + x = 15; + break; + case 2: + switch (arg0) + { + case 0: x = 12; break; + case 1: x = 18; break; + } + break; + case 3: + switch (arg0) + { + case 0: x = 15; break; + case 1: x = 21; break; + case 2: x = 9; break; + } + break; + case 4: + switch (arg0) + { + case 0: x = 12; break; + case 1: x = 18; break; + case 2: x = 24; break; + case 3: x = 6; break; + } + break; + case 5: + switch (arg0) + { + case 0: x = 15; break; + case 1: x = 21; break; + case 2: x = 27; break; + case 3: x = 3; break; + case 4: x = 9; break; + } + break; + } + + return x * 8; +} + +static void sub_8028FCC(void) +{ + u8 i; + for (i = 0; i < 11; i++) + { + sub_8028BF8(i, TRUE); + sub_8028C7C(i, 1); + } + sub_80289E8(FALSE); +} + +static void sub_8028FF8(u8 frameId) +{ + LoadBgTiles(0, GetWindowFrameTilesPal(frameId)->tiles, 0x120, 1); + LoadPalette(GetWindowFrameTilesPal(frameId)->pal, 0xA0, 0x20); +} + +static void sub_802902C(void) +{ + LoadUserWindowBorderGfx_(0, 0xA, 0xB0); +} + +static void sub_802903C(void) +{ + gUnknown_02022CF8->finished = FALSE; + gUnknown_02022CF8->state = 0; + gUnknown_02022CF8->unk3018 = 0; + gUnknown_02022CF8->unk3020 = 0; + gUnknown_02022CF8->unk3024 = 0; +} + +static void sub_8029074(const struct WindowTemplate *winTempl) +{ + u8 pal = 0xA; + + FillBgTilemapBufferRect(0, 1, winTempl->tilemapLeft - 1, winTempl->tilemapTop - 1, 1, 1, pal); + FillBgTilemapBufferRect(0, 2, winTempl->tilemapLeft, winTempl->tilemapTop - 1, winTempl->width, 1, pal); + FillBgTilemapBufferRect(0, 3, winTempl->tilemapLeft + winTempl->width, winTempl->tilemapTop - 1, 1, 1, pal); + FillBgTilemapBufferRect(0, 4, winTempl->tilemapLeft - 1, winTempl->tilemapTop, 1, winTempl->height, pal); + FillBgTilemapBufferRect(0, 6, winTempl->tilemapLeft + winTempl->width, winTempl->tilemapTop, 1, winTempl->height, pal); + FillBgTilemapBufferRect(0, 7, winTempl->tilemapLeft - 1, winTempl->tilemapTop + winTempl->height, 1, 1, pal); + FillBgTilemapBufferRect(0, 8, winTempl->tilemapLeft, winTempl->tilemapTop + winTempl->height, winTempl->width, 1, pal); + FillBgTilemapBufferRect(0, 9, winTempl->tilemapLeft + winTempl->width, winTempl->tilemapTop + winTempl->height, 1, 1, pal); +} + +static void sub_8029174(const struct WindowTemplate *winTempl) +{ + u8 pal = 0xB; + + FillBgTilemapBufferRect(0, 10, winTempl->tilemapLeft - 1, winTempl->tilemapTop - 1, 1, 1, pal); + FillBgTilemapBufferRect(0, 11, winTempl->tilemapLeft, winTempl->tilemapTop - 1, winTempl->width, 1, pal); + FillBgTilemapBufferRect(0, 12, winTempl->tilemapLeft + winTempl->width, winTempl->tilemapTop - 1, 1, 1, pal); + FillBgTilemapBufferRect(0, 13, winTempl->tilemapLeft - 1, winTempl->tilemapTop, 1, winTempl->height, pal); + FillBgTilemapBufferRect(0, 15, winTempl->tilemapLeft + winTempl->width, winTempl->tilemapTop, 1, winTempl->height, pal); + FillBgTilemapBufferRect(0, 16, winTempl->tilemapLeft - 1, winTempl->tilemapTop + winTempl->height, 1, 1, pal); + FillBgTilemapBufferRect(0, 17, winTempl->tilemapLeft, winTempl->tilemapTop + winTempl->height, winTempl->width, 1, pal); + FillBgTilemapBufferRect(0, 18, winTempl->tilemapLeft + winTempl->width, winTempl->tilemapTop + winTempl->height, 1, 1, pal); +} + +static void sub_8029274(struct DodrioSubstruct_0160 *ptr) +{ + gUnknown_02022CF8 = ptr; + gUnknown_02022CF8->finished = FALSE; + gUnknown_02022CF8->state = 0; + gUnknown_02022CF8->unk3018 = 0; + gUnknown_02022CF8->unk3020 = 0; + gUnknown_02022CF8->unk3024 = 0; + gUnknown_02022CF8->unk3004 = CreateTask(sub_8029314, 3); + sub_802A72C(sub_8029338); +} + +static void sub_80292D4(void) +{ + FreeAllWindowBuffers(); +} + +// Data used by functions below. +struct WinCoords +{ + u8 left; + u8 top; +}; + +static const u8 gUnknown_082FB380[][3] = +{ + {1, 2, 3}, + {1, 4, 5}, + {1, 8, 9}, + {1, 6, 7}, +}; + +static const struct WinCoords gUnknown_082FB38C[] = {{12, 6}}; +static const struct WinCoords gUnknown_082FB390[] = {{9, 10}, {15, 6}}; +static const struct WinCoords gUnknown_082FB398[] = {{12, 6}, {18, 10}, {6, 10}}; +static const struct WinCoords gUnknown_082FB3A4[] = {{9, 10}, {15, 6}, {21, 10}, {3, 6}}; +static const struct WinCoords gUnknown_082FB3B4[] = {{12, 6}, {18, 10}, {23, 6}, {1, 6}, {6, 10}}; + +static const struct WinCoords *const gUnknown_082FB3C8[] = +{ + gUnknown_082FB38C, + gUnknown_082FB390, + gUnknown_082FB398, + gUnknown_082FB3A4, + gUnknown_082FB3B4, +}; + +static const u8 *const gUnknown_082FB3DC[] = +{ + gText_1Colon, + gText_2Colon, + gText_3Colon, + gText_4Colon, + gText_5Colon, +}; + +static const u16 gUnknown_082FB3F0[] = {92, 132, 172, 212}; +static const u16 gUnknown_082FB3F8[] = {33, 49, 65, 81, 97}; +static const u16 gUnknown_082FB402[] = {17, 33, 49, 65, 81}; + +struct +{ + u8 id; + void (*func)(void); +} const gUnknown_082FB40C[] = +{ + {0, sub_8029338}, + {1, sub_8029440}, + {2, sub_802988C}, + {3, sub_802A010}, + {4, sub_802A380}, + {5, sub_802A454}, + {6, sub_802A534}, + {7, sub_802A588}, + {8, sub_802A6FC}, + {9, nullsub_16}, +}; + +static void sub_80292E0(u8 arg0) +{ + u8 i; + for (i = 0; i < 10; i++) + { + if (gUnknown_082FB40C[i].id == arg0) + sub_802A72C(gUnknown_082FB40C[i].func); + } +} + +static void sub_8029314(u8 taskId) +{ + if (!gUnknown_02022CF8->finished) + sub_802A75C()(); +} + +static void sub_8029338(void) +{ + switch (gUnknown_02022CF8->state) + { + case 0: + sub_802A7A8(); + gUnknown_02022CF8->state++; + break; + case 1: + if (sub_802A8E8() == TRUE) + gUnknown_02022CF8->state++; + break; + case 2: + CopyToBgTilemapBuffer(3, gDodrioBerryBgTilemap1, 0, 0); + CopyToBgTilemapBuffer(1, gDodrioBerryBgTilemap2Left, 0, 0); + CopyToBgTilemapBuffer(2, gDodrioBerryBgTilemap2Right, 0, 0); + CopyBgTilemapBufferToVram(3); + CopyBgTilemapBufferToVram(1); + CopyBgTilemapBufferToVram(2); + gUnknown_02022CF8->state++; + break; + case 3: + ShowBg(0); + ShowBg(3); + ShowBg(1); + ShowBg(2); + gUnknown_02022CF8->state++; + break; + case 4: + sub_8028FF8(gSaveBlock2Ptr->optionsWindowFrameType); + sub_802902C(); + gUnknown_02022CF8->state++; + break; + default: + gUnknown_02022CF8->finished = TRUE; + break; + } +} + +static void sub_8029440(void) +{ + u8 i, playersCount, id, colorsId, *name; + u32 left; + struct WindowTemplate window; + const struct WinCoords *ptr; + + switch (gUnknown_02022CF8->state) + { + case 0: + playersCount = sub_8027650(); + ptr = gUnknown_082FB3C8[playersCount - 1]; + window.bg = 0; + window.width = 7; + window.height = 2; + window.paletteNum = 0xD; + window.baseBlock = 0x13; + for (i = 0; i < playersCount; ptr++, i++) + { + colorsId = 0; + id = sub_8027A48(i); + left = (56 - GetStringWidth(1, sub_8027660(id), -1)) / 2u; + window.tilemapLeft = ptr->left; + window.tilemapTop = ptr->top; + gUnknown_02022CF8->unk3008[i] = AddWindow(&window); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[i]); + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[i], PIXEL_FILL(1)); + if (id == GetMultiplayerId()) + colorsId = 2; + name = sub_8027660(id); + AddTextPrinterParameterized3(gUnknown_02022CF8->unk3008[i], 1, left, 1, gUnknown_082FB380[colorsId], -1, name); + CopyWindowToVram(gUnknown_02022CF8->unk3008[i], 2); + window.baseBlock += 0xE; + sub_8029174(&window); + } + gUnknown_02022CF8->state++; + break; + case 1: + if (!IsDma3ManagerBusyWithBgCopy()) + { + playersCount = sub_8027650(); + for (i = 0; i < playersCount; i++) + PutWindowTilemap(gUnknown_02022CF8->unk3008[i]); + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->state++; + } + break; + default: + if (++gUnknown_02022CF8->state > 180) + { + playersCount = sub_8027650(); + for (i = 0; i < playersCount; i++) + { + ClearWindowTilemap(gUnknown_02022CF8->unk3008[i]); + RemoveWindow(gUnknown_02022CF8->unk3008[i]); + } + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->finished = TRUE; + } + break; + } +} + +static void sub_80296A8(u8 playersCount_) +{ + u8 i, r8 = 0, r6 = 0; + u8 playersCount = playersCount_; // Pointless variable, I know, but it's needed to match. + u8 *name; + u32 x, numWidth; + u8 numString[32]; + u8 array[5] = {0, 1, 2, 3, 4}; + struct DodrioSubstruct_3308 temp, structArray[5]; + + for (i = 0; i < playersCount; i++) + { + array[i] = i; + sub_802793C(&temp, i); + structArray[i] = temp; + } + + if (sub_8027748() != 0) + { + do + { + for (i = 0; i < playersCount; i++) + { + if (structArray[i].unk0 == r8) + { + array[r6] = i; + r6++; + } + } + r8 = r6; + } while (r6 < playersCount); + } + + for (i = 0; i < playersCount; i++) + { + if (structArray[i].unk4 == 0) + structArray[i].unk0 = playersCount - 1; + } + + x = 216 - GetStringWidth(1, gText_SpacePoints, 0); + for (i = 0; i < playersCount; i++) + { + u8 colorsId = 0; + u8 id = array[i]; + u32 points = structArray[id].unk4; + + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gUnknown_082FB3DC[structArray[id].unk0], 8, gUnknown_082FB402[i], -1, NULL); + if (id == GetMultiplayerId()) + colorsId = 2; + name = sub_8027660(id); + AddTextPrinterParameterized3(gUnknown_02022CF8->unk3008[1], 1, 28, gUnknown_082FB402[i], gUnknown_082FB380[colorsId], -1, name); + ConvertIntToDecimalStringN(numString, points, STR_CONV_MODE_LEFT_ALIGN, 7); + numWidth = GetStringWidth(1, numString, -1); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, numString, x - numWidth, gUnknown_082FB402[i], -1, NULL); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gText_SpacePoints, x, gUnknown_082FB402[i], -1, NULL); + } +} + +static void sub_802988C(void) +{ + u8 i, j, itemGiveRet, playersCount = sub_8027650(); + u8 *name; + u32 strWidth, x; + + switch (gUnknown_02022CF8->state) + { + case 0: + sub_802784C(); + gUnknown_02022CF8->unk301C = 0; + gUnknown_02022CF8->state++; + break; + case 1: + gUnknown_02022CF8->unk3008[0] = AddWindow(&gUnknown_082F7BBC[0]); + gUnknown_02022CF8->unk3008[1] = AddWindow(&gUnknown_082F7BBC[1]); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[0]); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[1]); + sub_8029174(&gUnknown_082F7BBC[0]); + sub_8029174(&gUnknown_082F7BBC[1]); + gUnknown_02022CF8->state++; + break; + case 2: + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[0], PIXEL_FILL(1)); + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[1], PIXEL_FILL(1)); + strWidth = GetStringWidth(1, gText_BerryPickingResults, -1); + x = (224 - strWidth) / 2; + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[0], 1, gText_BerryPickingResults, x, 1, -1, NULL); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gText_10P30P50P50P, 68, 17, -1, NULL); + for (i = 0; i < playersCount; i++) + { + u8 colorsId = 0; + if (i == GetMultiplayerId()) + colorsId = 2; + + name = sub_8027660(i); + AddTextPrinterParameterized3(gUnknown_02022CF8->unk3008[1], 1, 0, gUnknown_082FB3F8[i], gUnknown_082FB380[colorsId], -1, name); + for (j = 0; j < 4; j++) + { + u32 width; + u16 result1 = Min(sub_80276A0(i, j), 9999); + u16 result2 = Min(sub_802778C(j), 9999); + + ConvertIntToDecimalStringN(gStringVar4, result1, STR_CONV_MODE_LEFT_ALIGN, 4); + width = GetStringWidth(1, gStringVar4, -1); + if (result2 == result1 && result2 != 0) + AddTextPrinterParameterized3(gUnknown_02022CF8->unk3008[1], 1, gUnknown_082FB3F0[j] - width, gUnknown_082FB3F8[i], gUnknown_082FB380[1], -1, gStringVar4); + else + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gStringVar4, gUnknown_082FB3F0[j] - width, gUnknown_082FB3F8[i], -1, NULL); + } + } + CopyWindowToVram(gUnknown_02022CF8->unk3008[0], 2); + CopyWindowToVram(gUnknown_02022CF8->unk3008[1], 2); + gUnknown_02022CF8->state++; + break; + case 3: + if (!IsDma3ManagerBusyWithBgCopy()) + { + PutWindowTilemap(gUnknown_02022CF8->unk3008[0]); + PutWindowTilemap(gUnknown_02022CF8->unk3008[1]); + } + CopyBgTilemapBufferToVram(0); + sub_8028C30(FALSE); + gUnknown_02022CF8->state++; + break; + case 4: + if (++gUnknown_02022CF8->unk301C >= 30 && gMain.newKeys & A_BUTTON) + { + gUnknown_02022CF8->unk301C = 0; + PlaySE(SE_SELECT); + sub_8028C30(TRUE); + gUnknown_02022CF8->state++; + } + break; + case 5: + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[0], PIXEL_FILL(1)); + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[1], PIXEL_FILL(1)); + strWidth = GetStringWidth(1, gText_AnnouncingRankings, -1); + x = (224 - strWidth) / 2; + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[0], 1, gText_AnnouncingRankings, x, 1, -1, NULL); + gUnknown_02022CF8->state++; + break; + case 6: + sub_80296A8(playersCount); + CopyWindowToVram(gUnknown_02022CF8->unk3008[0], 2); + CopyWindowToVram(gUnknown_02022CF8->unk3008[1], 2); + gUnknown_02022CF8->state++; + break; + case 7: + if (!IsDma3ManagerBusyWithBgCopy()) + { + PutWindowTilemap(gUnknown_02022CF8->unk3008[0]); + PutWindowTilemap(gUnknown_02022CF8->unk3008[1]); + } + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->state++; + break; + case 8: + if (++gUnknown_02022CF8->unk301C >= 30 && gMain.newKeys & A_BUTTON) + { + gUnknown_02022CF8->unk301C = 0; + PlaySE(SE_SELECT); + if (sub_8027748() < 3000) + { + gUnknown_02022CF8->state = 127; + } + else + { + StopMapMusic(); + gUnknown_02022CF8->state++; + } + + FillBgTilemapBufferRect_Palette0(0, 0, 0, 5, 30, 15); + RemoveWindow(gUnknown_02022CF8->unk3008[1]); + gUnknown_02022CF8->unk3008[1] = AddWindow(&gUnknown_082F7BCC); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[1]); + sub_8029174(&gUnknown_082F7BCC); + } + break; + case 9: + PlayNewMapMusic(MUS_FANFA1); + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[0], PIXEL_FILL(1)); + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[1], PIXEL_FILL(1)); + strWidth = GetStringWidth(1, gText_AnnouncingPrizes, -1); + x = (224 - strWidth) / 2; + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[0], 1, gText_AnnouncingPrizes, x, 1, -1, NULL); + DynamicPlaceholderTextUtil_Reset(); + CopyItemName(sub_802762C(), gStringVar1); + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1); + DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_FirstPlacePrize); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gStringVar4, 0, 1, -1, NULL); + itemGiveRet = sub_80279C8(); + if (itemGiveRet != 0 && itemGiveRet != 3) + { + DynamicPlaceholderTextUtil_Reset(); + CopyItemName(sub_802762C(), gStringVar1); + DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1); + if (itemGiveRet == 2) + DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_CantHoldAnyMore); + else if (itemGiveRet == 1) + DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_FilledStorageSpace); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gStringVar4, 0, 41, -1, NULL); + } + CopyWindowToVram(gUnknown_02022CF8->unk3008[0], 2); + CopyWindowToVram(gUnknown_02022CF8->unk3008[1], 2); + gUnknown_02022CF8->state++; + break; + case 10: + if (!IsDma3ManagerBusyWithBgCopy()) + { + PutWindowTilemap(gUnknown_02022CF8->unk3008[0]); + PutWindowTilemap(gUnknown_02022CF8->unk3008[1]); + } + CopyBgTilemapBufferToVram(0); + FadeOutAndFadeInNewMapMusic(MUS_RG_WIN_YASEI, 20, 10); + gUnknown_02022CF8->state++; + break; + case 11: + if (++gUnknown_02022CF8->unk301C >= 30 && gMain.newKeys & A_BUTTON) + { + gUnknown_02022CF8->unk301C = 0; + PlaySE(SE_SELECT); + gUnknown_02022CF8->state++; + } + break; + default: + ClearWindowTilemap(gUnknown_02022CF8->unk3008[0]); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[1]); + RemoveWindow(gUnknown_02022CF8->unk3008[0]); + RemoveWindow(gUnknown_02022CF8->unk3008[1]); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->finished = TRUE; + break; + } +} + +static void sub_802A010(void) +{ + u8 y; + + switch (gUnknown_02022CF8->state) + { + case 0: + gUnknown_02022CF8->unk3008[0] = AddWindow(&gUnknown_082F7BD4[0]); + gUnknown_02022CF8->unk3008[1] = AddWindow(&gUnknown_082F7BD4[1]); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[0]); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[1]); + sub_8029174(&gUnknown_082F7BD4[0]); + sub_8029074(&gUnknown_082F7BD4[1]); + gUnknown_02022CF8->state++; + gUnknown_02022CF8->unk3020 = 0; + gUnknown_02022CF8->unk3024 = 0; + break; + case 1: + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[0], PIXEL_FILL(1)); + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[1], PIXEL_FILL(1)); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[0], 1, gText_WantToPlayAgain, 0, 5, -1, NULL); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gText_Yes, 8, 1, -1, NULL); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gText_No, 8, 17, -1, NULL); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gText_SelectorArrow2, 0, 1, -1, NULL); + CopyWindowToVram(gUnknown_02022CF8->unk3008[0], 2); + CopyWindowToVram(gUnknown_02022CF8->unk3008[1], 2); + gUnknown_02022CF8->state++; + break; + case 2: + if (!IsDma3ManagerBusyWithBgCopy()) + { + PutWindowTilemap(gUnknown_02022CF8->unk3008[0]); + PutWindowTilemap(gUnknown_02022CF8->unk3008[1]); + } + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->state++; + break; + case 3: + y = gUnknown_02022CF8->unk3020; + if (y == 0) + y = 1; + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[1], PIXEL_FILL(1)); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gText_Yes, 8, 1, -1, NULL); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gText_No, 8, 17, -1, NULL); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[1], 1, gText_SelectorArrow2, 0, ((y - 1) * 16) + 1, -1, NULL); + CopyWindowToVram(gUnknown_02022CF8->unk3008[1], 3); + // Increment state only if A or B button have been pressed. + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + if (gUnknown_02022CF8->unk3020 == 0) + gUnknown_02022CF8->unk3020 = 1; + gUnknown_02022CF8->state++; + } + else if (gMain.newKeys & (DPAD_UP | DPAD_DOWN)) + { + PlaySE(SE_SELECT); + switch (gUnknown_02022CF8->unk3020) + { + case 0: + gUnknown_02022CF8->unk3020 = 2; + break; + case 1: + gUnknown_02022CF8->unk3020 = 2; + break; + case 2: + gUnknown_02022CF8->unk3020 = 1; + break; + } + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + gUnknown_02022CF8->unk3020 = 2; + gUnknown_02022CF8->state++; + } + break; + default: + gUnknown_02022CF8->unk3024 = gUnknown_02022CF8->unk3020; + ClearWindowTilemap(gUnknown_02022CF8->unk3008[0]); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[1]); + RemoveWindow(gUnknown_02022CF8->unk3008[0]); + RemoveWindow(gUnknown_02022CF8->unk3008[1]); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->finished = TRUE; + break; + } +} + +static void sub_802A380(void) +{ + switch (gUnknown_02022CF8->state) + { + case 0: + DrawDialogueFrame(0, FALSE); + AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3); + gUnknown_02022CF8->state++; + break; + case 1: + CopyWindowToVram(0, 3); + gUnknown_02022CF8->state++; + break; + case 2: + if (!IsDma3ManagerBusyWithBgCopy()) + { + CreateTask(sub_8153688, 0); + gUnknown_02022CF8->state++; + } + break; + case 3: + if (!FuncIsActiveTask(sub_8153688)) + gUnknown_02022CF8->state++; + break; + default: + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->finished = TRUE; + break; + } +} + +static void sub_802A454(void) +{ + switch (gUnknown_02022CF8->state) + { + case 0: + gUnknown_02022CF8->unk3008[0] = AddWindow(&gUnknown_082F7BEC); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[0]); + sub_8029174(&gUnknown_082F7BEC); + gUnknown_02022CF8->state++; + break; + case 1: + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[0], PIXEL_FILL(1)); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[0], 1, gText_CommunicationStandby3, 0, 5, -1, NULL); + CopyWindowToVram(gUnknown_02022CF8->unk3008[0], 2); + gUnknown_02022CF8->state++; + break; + case 2: + if (!IsDma3ManagerBusyWithBgCopy()) + PutWindowTilemap(gUnknown_02022CF8->unk3008[0]); + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->state++; + break; + default: + gUnknown_02022CF8->finished = TRUE; + break; + } +} + +static void sub_802A534(void) +{ + ClearWindowTilemap(gUnknown_02022CF8->unk3008[0]); + RemoveWindow(gUnknown_02022CF8->unk3008[0]); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->finished = TRUE; +} + +static void sub_802A588(void) +{ + switch (gUnknown_02022CF8->state) + { + case 0: + gUnknown_02022CF8->unk3008[0] = AddWindow(&gUnknown_082F7BE4); + ClearWindowTilemap(gUnknown_02022CF8->unk3008[0]); + sub_8029174(&gUnknown_082F7BE4); + gUnknown_02022CF8->state++; + gUnknown_02022CF8->unk301C = 0; + gUnknown_02022CF8->unk3020 = 0; + gUnknown_02022CF8->unk3024 = 0; + break; + case 1: + FillWindowPixelBuffer(gUnknown_02022CF8->unk3008[0], PIXEL_FILL(1)); + AddTextPrinterParameterized(gUnknown_02022CF8->unk3008[0], 1, gText_SomeoneDroppedOut, 0, 5, -1, NULL); + CopyWindowToVram(gUnknown_02022CF8->unk3008[0], 2); + gUnknown_02022CF8->state++; + break; + case 2: + if (!IsDma3ManagerBusyWithBgCopy()) + PutWindowTilemap(gUnknown_02022CF8->unk3008[0]); + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->state++; + break; + case 3: + if (++gUnknown_02022CF8->unk301C >= 120) + gUnknown_02022CF8->state++; + break; + default: + gUnknown_02022CF8->unk3024 = 5; + ClearWindowTilemap(gUnknown_02022CF8->unk3008[0]); + RemoveWindow(gUnknown_02022CF8->unk3008[0]); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + gUnknown_02022CF8->finished = TRUE; + break; + } +} + +static void sub_802A6FC(void) +{ + DestroyTask(gUnknown_02022CF8->unk3004); + gUnknown_02022CF8->finished = TRUE; +} + +static void nullsub_16(void) +{ + +} + +static void sub_802A72C(void (*func)(void)) +{ + gUnknown_02022CF8->state = 0; + gUnknown_02022CF8->finished = FALSE; + gUnknown_02022CF8->unk3028 = func; +} + +static void (*sub_802A75C(void))(void) +{ + return gUnknown_02022CF8->unk3028; +} + +static bool32 sub_802A770(void) +{ + if (gUnknown_02022CF8->finished == TRUE) + return FALSE; + else + return TRUE; +} + +static u8 sub_802A794(void) +{ + return gUnknown_02022CF8->unk3024; +} + +static void sub_802A7A8(void) +{ + DmaClearLarge16(3, (void *)VRAM, VRAM_SIZE, 0x1000); + DmaClear32(3,(void *)OAM, OAM_SIZE); + DmaClear16(3, (void *)PLTT, PLTT_SIZE); + SetGpuReg(REG_OFFSET_DISPCNT, 0); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_082F7BA4, ARRAY_COUNT(gUnknown_082F7BA4)); + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + ChangeBgX(2, 0, 0); + ChangeBgY(2, 0, 0); + ChangeBgX(3, 0, 0); + ChangeBgY(3, 0, 0); + InitStandardTextBoxWindows(); + sub_8197200(); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + SetBgTilemapBuffer(3, gUnknown_02022CF8->tilemapBuffers[0]); + SetBgTilemapBuffer(1, gUnknown_02022CF8->tilemapBuffers[1]); + SetBgTilemapBuffer(2, gUnknown_02022CF8->tilemapBuffers[2]); +} + +static bool32 sub_802A8E8(void) +{ + switch (gUnknown_02022CF8->unk3018) + { + case 0: + LoadPalette(gDodrioBerryBgPal1, 0, sizeof(gDodrioBerryBgPal1)); + break; + case 1: + reset_temp_tile_data_buffers(); + break; + case 2: + decompress_and_copy_tile_data_to_vram(3, gDodrioBerryBgGfx1, 0, 0, 0); + break; + case 3: + decompress_and_copy_tile_data_to_vram(1, gDodrioBerryBgGfx2, 0, 0, 0); + break; + case 4: + if (free_temp_tile_data_buffers_if_possible() == TRUE) + return FALSE; + break; + case 5: + LoadPalette(stdpal_get(3), 0xD0, 0x20); + break; + default: + gUnknown_02022CF8->unk3018 = 0; + return TRUE; + } + + gUnknown_02022CF8->unk3018++; + return FALSE; +} diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 605cd0366..835141ef2 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -73,7 +73,7 @@ static void CreateRandomEggShardSprite(void); static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 spriteAnimIndex); // IWRAM bss -static IWRAM_DATA struct EggHatchData *sEggHatchData; +static struct EggHatchData *sEggHatchData; // rom data static const u16 sEggPalette[] = INCBIN_U16("graphics/pokemon/egg/normal.gbapal"); diff --git a/src/ereader_helpers.c b/src/ereader_helpers.c index cd64afe0e..11aaaafe7 100755 --- a/src/ereader_helpers.c +++ b/src/ereader_helpers.c @@ -26,17 +26,17 @@ static void sub_81D414C(void); static void sub_81D3F1C(u32, u32*, u32*); static void sub_81D3F68(void); -IWRAM_DATA struct Unknown030012C8 gUnknown_030012C8; -IWRAM_DATA u16 gUnknown_030012E0; -IWRAM_DATA u16 gUnknown_030012E2; -IWRAM_DATA u16 gUnknown_030012E4; -IWRAM_DATA u16 gUnknown_030012E6; -IWRAM_DATA u32 gUnknown_030012E8; -IWRAM_DATA u16 gUnknown_030012EC; -IWRAM_DATA u16 gUnknown_030012EE; -IWRAM_DATA u16 gUnknown_030012F0; -IWRAM_DATA u16 gUnknown_030012F2; -IWRAM_DATA u16 gUnknown_030012F4; +static struct Unknown030012C8 gUnknown_030012C8; +static u16 gUnknown_030012E0; +static u16 gUnknown_030012E2; +static u16 gUnknown_030012E4; +static u16 gUnknown_030012E6; +static u32 gUnknown_030012E8; +static u16 gUnknown_030012EC; +static u16 gUnknown_030012EE; +static u16 gUnknown_030012F0; +static u16 gUnknown_030012F2; +static u16 gUnknown_030012F4; extern const u8 gUnknown_08625B6C[][0x148]; diff --git a/src/ereader_screen.c b/src/ereader_screen.c index f74efa32b..98f0d9b8c 100755 --- a/src/ereader_screen.c +++ b/src/ereader_screen.c @@ -38,7 +38,7 @@ struct Unk03006370 static void sub_81D5084(u8); -extern struct Unk03006370 gUnknown_03006370; +struct Unk03006370 gUnknown_03006370; extern const u8 gUnknown_089A3470[]; extern const u8 gMultiBootProgram_BerryGlitchFix_Start[]; diff --git a/src/field_camera.c b/src/field_camera.c index b976cf2ff..7f294afdb 100644 --- a/src/field_camera.c +++ b/src/field_camera.c @@ -36,11 +36,11 @@ static void DrawMetatile(s32 a, u16 *b, u16 c); static void CameraPanningCB_PanAhead(void); // IWRAM bss vars -static IWRAM_DATA struct FieldCameraOffset sFieldCameraOffset; -static IWRAM_DATA s16 sHorizontalCameraPan; -static IWRAM_DATA s16 sVerticalCameraPan; -static IWRAM_DATA u8 gUnknown_03000E2C; -static IWRAM_DATA void (*sFieldCameraPanningCallback)(void); +static struct FieldCameraOffset sFieldCameraOffset; +static s16 sHorizontalCameraPan; +static s16 sVerticalCameraPan; +static u8 gUnknown_03000E2C; +static void (*sFieldCameraPanningCallback)(void); struct CameraObject gFieldCamera; u16 gTotalCameraPixelOffsetY; diff --git a/src/field_effect.c b/src/field_effect.c index 22bf44f28..7569bdc75 100644 --- a/src/field_effect.c +++ b/src/field_effect.c @@ -232,7 +232,7 @@ static void Fldeff_MoveDeoxysRock_Step(u8 taskId); // Static RAM declarations -static IWRAM_DATA u8 sActiveList[32]; +static u8 sActiveList[32]; // External declarations extern struct CompressedSpritePalette gMonPaletteTable[]; // GF made a mistake and did not extern it as const. diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index b322fc1c7..6d62cdc4a 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -336,14 +336,9 @@ void player_step(u8 direction, u16 newKeys, u16 heldKeys) static bool8 TryInterruptEventObjectSpecialAnim(struct EventObject *playerEventObj, u8 direction) { - #ifdef NONMATCHING - u8 r5 = direction; - u8 r6 = direction; - #else - u8 r5 = direction; - register u8 r6 asm("r6") = direction; - #endif - //a very bad HACK + u8 r5 = direction; + u8 r6 = direction; + r6++; r6--; if (EventObjectIsMovementOverridden(playerEventObj) && !EventObjectClearHeldMovementIfFinished(playerEventObj)) diff --git a/src/field_weather.c b/src/field_weather.c index 814e85ef4..024b6631f 100644 --- a/src/field_weather.c +++ b/src/field_weather.c @@ -68,7 +68,7 @@ static u8 None_Finish(void); EWRAM_DATA struct Weather gWeather = {0}; EWRAM_DATA static u8 sFieldEffectPaletteGammaTypes[32] = {0}; -IWRAM_DATA static const u8 *sPaletteGammaTypes; +static const u8 *sPaletteGammaTypes; // The drought weather effect uses a precalculated color lookup table. Presumably this // is because the underlying color shift calculation is slow. diff --git a/src/fire.c b/src/fire.c index aee7e1d01..cd1266cf6 100644 --- a/src/fire.c +++ b/src/fire.c @@ -957,6 +957,7 @@ static void sub_81094D0(u8 taskId) // animate Move_ERUPTION? break; default: + break; } } diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index 68c50cae7..3115ff231 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -59,11 +59,11 @@ static void CutGrassSpriteCallbackEnd(struct Sprite *); static void HandleLongGrassOnHyper(u8, s16, s16); // IWRAM variables -static IWRAM_DATA u8 sCutSquareSide; -static IWRAM_DATA u8 sTileCountFromPlayer_X; -static IWRAM_DATA u8 sTileCountFromPlayer_Y; -static IWRAM_DATA u32 sUnused; -static IWRAM_DATA bool8 sHyperCutTiles[CUT_HYPER_AREA]; +static u8 sCutSquareSide; +static u8 sTileCountFromPlayer_X; +static u8 sTileCountFromPlayer_Y; +static u32 sUnused; +static bool8 sHyperCutTiles[CUT_HYPER_AREA]; // EWRAM variables static EWRAM_DATA u8 *sCutGrassSpriteArrayPtr = NULL; diff --git a/src/fldeff_flash.c b/src/fldeff_flash.c index c002f700f..a2457307b 100644 --- a/src/fldeff_flash.c +++ b/src/fldeff_flash.c @@ -219,8 +219,8 @@ static void sub_8137404(u8 taskId) static void sub_8137420(u8 taskId) { SetGpuReg(REG_OFFSET_DISPCNT, 0); - LZ77UnCompVram(gCaveTransitionTiles, (void *)0x600C000); - LZ77UnCompVram(gCaveTransitionTilemap, (void *)0x600F800); + LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000)); + LZ77UnCompVram(gCaveTransitionTilemap, (void *)(VRAM + 0xF800)); LoadPalette(gCaveTransitionPalette_White, 0xE0, 0x20); LoadPalette(gUnknown_085B28A0, 0xE0, 0x10); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 @@ -304,8 +304,8 @@ static void sub_81375BC(u8 taskId) static void sub_81375D8(u8 taskId) { SetGpuReg(REG_OFFSET_DISPCNT, 0); - LZ77UnCompVram(gCaveTransitionTiles, (void *)0x600C000); - LZ77UnCompVram(gCaveTransitionTilemap, (void *)0x600F800); + LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000)); + LZ77UnCompVram(gCaveTransitionTilemap, (void *)(VRAM + 0xF800)); SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDY, 0); diff --git a/src/ghost.c b/src/ghost.c index 16e9722db..7d70c72a5 100644 --- a/src/ghost.c +++ b/src/ghost.c @@ -1180,7 +1180,8 @@ void sub_8112B78(struct Sprite *sprite) if (++coeffB > 16) coeffB = 16; - if (--(s16)coeffA < 0) + --coeffA; + if ((s16)coeffA < 0) coeffA = 0; SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(coeffA, coeffB)); diff --git a/src/gpu_regs.c b/src/gpu_regs.c index e5ff4fe8f..3bcc4fd93 100644 --- a/src/gpu_regs.c +++ b/src/gpu_regs.c @@ -10,9 +10,9 @@ static u8 sGpuRegBuffer[GPU_REG_BUF_SIZE]; static u8 sGpuRegWaitingList[GPU_REG_BUF_SIZE]; -static bool8 sGpuRegBufferLocked; -static bool8 sShouldSyncRegIE; -static u16 sRegIE; +static volatile bool8 sGpuRegBufferLocked; +static volatile bool8 sShouldSyncRegIE; +static vu16 sRegIE; static void CopyBufferedValueToGpuReg(u8 regOffset); static void SyncRegIE(void); diff --git a/src/item.c b/src/item.c index fe8e8eadd..5e505724c 100644 --- a/src/item.c +++ b/src/item.c @@ -18,6 +18,9 @@ extern u16 gUnknown_0203CF30[]; // this file's functions +#if !defined(NONMATCHING) && MODERN +#define static +#endif static bool8 CheckPyramidBagHasItem(u16 itemId, u16 count); static bool8 CheckPyramidBagHasSpace(u16 itemId, u16 count); diff --git a/src/item_menu.c b/src/item_menu.c index bdba9622c..5b47a567b 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -127,7 +127,7 @@ void sub_81ABAE0(void); u8 sub_81AB1F0(u8); void sub_81AC23C(u8); void BagMenu_MoveCursorCallback(s32 a, bool8 b, struct ListMenu*); -void PrintItemQuantityPlusGFX(u8 rboxId, int item_index_in_pocket, u8 a); +void PrintItemQuantityPlusGFX(u8 rboxId, s32 item_index_in_pocket, u8 a); void ItemMenu_UseOutOfBattle(u8 taskId); void ItemMenu_Toss(u8 taskId); void ItemMenu_Register(u8 taskId); @@ -830,7 +830,7 @@ void BagMenu_MoveCursorCallback(s32 a, bool8 b, struct ListMenu *unused) } } -void PrintItemQuantityPlusGFX(u8 rboxId, int item_index_in_pocket, u8 a) +void PrintItemQuantityPlusGFX(u8 rboxId, s32 item_index_in_pocket, u8 a) { u16 itemId; u16 itemQuantity; diff --git a/src/librfu.c b/src/librfu.c new file mode 100644 index 000000000..cdf14b693 --- /dev/null +++ b/src/librfu.c @@ -0,0 +1,9 @@ +#include "global.h" +#include "librfu.h" + +struct RfuUnk1* gUnknown_03007870[4]; +struct RfuUnk2* gUnknown_03007880[4]; +struct RfuUnk5 *gUnknown_03007890; +u32 *gUnknown_03007894; +struct RfuUnk3* gUnknown_03007898; +u8 gUnknown_030078A0[12]; diff --git a/src/librfu_intr.c b/src/librfu_intr.c index bdf8b072a..c6db9a50c 100644 --- a/src/librfu_intr.c +++ b/src/librfu_intr.c @@ -1,4 +1,5 @@ #include "global.h" #include "main.h" +#include "librfu.h" //TODO: decompile asm/librfu_intr.s to here diff --git a/src/librfu_stwi.c b/src/librfu_stwi.c index 556b79bf8..670692118 100644 --- a/src/librfu_stwi.c +++ b/src/librfu_stwi.c @@ -1,6 +1,8 @@ #include "global.h" #include "librfu.h" +struct RfuStruct *gRfuState; + extern IntrFunc IntrSIO32(void); extern void STWI_stop_timer(void); diff --git a/src/link.c b/src/link.c index bcdcb52a4..9928b48da 100644 --- a/src/link.c +++ b/src/link.c @@ -52,22 +52,21 @@ struct LinkTestBGInfo // Static RAM declarations -IWRAM_DATA struct BlockTransfer sBlockSend; -IWRAM_DATA u32 link_c_unused_03000d1c; -IWRAM_DATA struct BlockTransfer sBlockRecv[MAX_LINK_PLAYERS]; -IWRAM_DATA u32 sBlockSendDelayCounter; -IWRAM_DATA u32 gUnknown_03000D54; -IWRAM_DATA u8 gUnknown_03000D58; -IWRAM_DATA u32 sPlayerDataExchangeStatus; -IWRAM_DATA u32 gUnknown_03000D60; -IWRAM_DATA u8 sLinkTestLastBlockSendPos; -ALIGNED() IWRAM_DATA u8 sLinkTestLastBlockRecvPos[MAX_LINK_PLAYERS]; -IWRAM_DATA u8 sNumVBlanksWithoutSerialIntr; -IWRAM_DATA bool8 sSendBufferEmpty; -IWRAM_DATA u16 sSendNonzeroCheck; -IWRAM_DATA u16 sRecvNonzeroCheck; -IWRAM_DATA u8 sChecksumAvailable; -IWRAM_DATA u8 sHandshakePlayerCount; +static struct BlockTransfer sBlockSend; +static struct BlockTransfer sBlockRecv[MAX_LINK_PLAYERS]; +static u32 sBlockSendDelayCounter; +static u32 gUnknown_03000D54; +static u8 gUnknown_03000D58; +static u32 sPlayerDataExchangeStatus; +static u32 gUnknown_03000D60; +static u8 sLinkTestLastBlockSendPos; +static u8 sLinkTestLastBlockRecvPos[MAX_LINK_PLAYERS]; +static u8 sNumVBlanksWithoutSerialIntr; +static bool8 sSendBufferEmpty; +static u16 sSendNonzeroCheck; +static u16 sRecvNonzeroCheck; +static u8 sChecksumAvailable; +static u8 sHandshakePlayerCount; u16 gLinkPartnersHeldKeys[6]; u32 gLinkDebugSeed; diff --git a/src/link_rfu.c b/src/link_rfu.c index 3728b1219..1f3ae4f3c 100644 --- a/src/link_rfu.c +++ b/src/link_rfu.c @@ -24,10 +24,10 @@ extern u16 gHeldKeyCodeToSend; struct UnkRfuStruct_1 gUnknown_03004140; struct UnkRfuStruct_2 gUnknown_03005000; -IWRAM_DATA u8 gUnknown_03000D74; -ALIGNED(4) IWRAM_DATA u8 gUnknown_03000D78[8]; -IWRAM_DATA u8 gUnknown_03000D80[16]; -IWRAM_DATA u16 gUnknown_03000D90[8]; +BSS_DATA u8 gUnknown_03000D74; +ALIGNED(4) BSS_DATA u8 gUnknown_03000D78[8]; +BSS_DATA u8 gUnknown_03000D80[16]; +BSS_DATA u16 gUnknown_03000D90[8]; EWRAM_DATA u8 gWirelessStatusIndicatorSpriteId = 0; EWRAM_DATA ALIGNED(4) struct UnkLinkRfuStruct_02022B14 gUnknown_02022B14 = {}; @@ -2021,6 +2021,8 @@ void sub_800DBF8(u8 *q1, u8 mode) } } +// File boundary here maybe? + void PkmnStrToASCII(u8 *q1, const u8 *q2) { s32 i; @@ -2413,7 +2415,7 @@ void RecordMixTrainerNames(void) } } } - + // Save the connected trainers first, at the top of the list. nextSpace = 0; for (i = 0; i < GetLinkPlayerCount(); i++) @@ -2444,7 +2446,7 @@ void RecordMixTrainerNames(void) } } } - + // Finalize the new list, and clean up. memcpy(gSaveBlock1Ptr->trainerNameRecords, newRecords, 20 * sizeof(struct TrainerNameRecord)); free(newRecords); @@ -3493,7 +3495,7 @@ void sub_800FD14(u16 command) } } -void sub_800FE50(u16 *a0) +void sub_800FE50(void *a0) { if (gSendCmd[0] == 0 && !sub_8011A80()) { @@ -5142,4 +5144,3 @@ u32 GetRfuRecvQueueLength(void) { return gUnknown_03005000.unk_124.unk_8c2; } - diff --git a/src/load_save.c b/src/load_save.c index 150c557c6..5857f2b46 100644 --- a/src/load_save.c +++ b/src/load_save.c @@ -42,10 +42,10 @@ EWRAM_DATA struct LoadedSaveData gLoadedSaveData = {0}; EWRAM_DATA u32 gLastEncryptionKey = 0; // IWRAM common -IWRAM_DATA bool32 gFlashMemoryPresent; -IWRAM_DATA struct SaveBlock1 *gSaveBlock1Ptr; -IWRAM_DATA struct SaveBlock2 *gSaveBlock2Ptr; -IWRAM_DATA struct PokemonStorage *gPokemonStoragePtr; +bool32 gFlashMemoryPresent; +struct SaveBlock1 *gSaveBlock1Ptr; +struct SaveBlock2 *gSaveBlock2Ptr; +struct PokemonStorage *gPokemonStoragePtr; // code void CheckForFlashMemory(void) diff --git a/src/m4a.c b/src/m4a.c index 7b4441ca4..267a72657 100644 --- a/src/m4a.c +++ b/src/m4a.c @@ -1,3 +1,4 @@ +#include #include "gba/m4a_internal.h" extern const u8 gCgb3Vol[]; diff --git a/src/main.c b/src/main.c index 40381bb68..06425e661 100644 --- a/src/main.c +++ b/src/main.c @@ -85,7 +85,27 @@ void EnableVCountIntrAtLine150(void); void AgbMain() { +#if MODERN + // Modern compilers are liberal with the stack on entry to this function, + // so RegisterRamReset may crash if it resets IWRAM. + RegisterRamReset(RESET_ALL & ~RESET_IWRAM); + asm("mov\tr1, #0xC0\n" + "\tlsl\tr1, r1, #0x12\n" + "\tmov r2, #0xFC\n" + "\tlsl r2, r2, #0x7\n" + "\tadd\tr2, r1, r2\n" + "\tmov\tr0, #0\n" + "\tmov\tr3, r0\n" + "\tmov\tr4, r0\n" + "\tmov\tr5, r0\n" + ".LCU0:\n" + "\tstmia r1!, {r0, r3, r4, r5}\n" + "\tcmp\tr1, r2\n" + "\tbcc\t.LCU0\n" + ); +#else RegisterRamReset(RESET_ALL); +#endif //MODERN *(vu16 *)BG_PLTT = 0x7FFF; InitGpuRegManager(); REG_WAITCNT = WAITCNT_PREFETCH_ENABLE | WAITCNT_WS0_S_1 | WAITCNT_WS0_N_3; diff --git a/src/main_menu.c b/src/main_menu.c index bc509c70d..6a0bd9e2d 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -176,7 +176,7 @@ static EWRAM_DATA u8 gUnknown_02022D04 = 0; static EWRAM_DATA u16 sCurrItemAndOptionMenuCheck = 0; -static IWRAM_DATA u8 sBirchSpeechMainTaskId; +static u8 sBirchSpeechMainTaskId; // Static ROM declarations diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index 8bb9cb6e4..64f04f3bc 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -33,7 +33,7 @@ static void Task_BardSong(u8 taskId); static void StorytellerSetup(void); static void Storyteller_ResetFlag(void); -IWRAM_DATA u8 sSelectedStory; +static u8 sSelectedStory; struct BardSong gBardSong; diff --git a/src/menu.c b/src/menu.c index 354346d27..8d50d4dcc 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1,6 +1,7 @@ #include "global.h" #include "alloc.h" #include "bg.h" +#include "blit.h" #include "dma3.h" #include "event_data.h" #include "graphics.h" @@ -2013,337 +2014,82 @@ void PrintPlayerNameOnWindow(u8 windowId, const u8 *src, u16 x, u16 y) AddTextPrinterParameterized(windowId, 1, gStringVar4, x, y, 0xFF, 0); } -//Screw this function, it's long and unreferenced and ugh - -struct UnkStruct_819A080 { - u8 *unk00; - u16 unk04; - u16 unk06; -}; - -#ifdef NONMATCHING -void sub_819A080(struct UnkStruct_819A080 *a0, struct UnkStruct_819A080 *a1, u16 a2, u16 a3, u16 a4, u16 a5, u16 a6, u16 a7) +// Unused. Similar to BlitBitmapRect4Bit. +void sub_819A080(const struct Bitmap *src, struct Bitmap *dst, u16 srcX, u16 srcY, u16 dstX, u16 dstY, u16 width, u16 height) { - // r3 = a3 - // r4 = a5 - // r1 = a6 - // r5 = a7 - // sp+00 = a0 - // sp+04 = a1 - // sp+08 = a2 - // sp+0c = a4 - int sp10 = a1->unk04 - a4 < a6 ? a1->unk04 - a4 + a2 : a6 + a2; - int sp14 = a0->unk06 - a5 < a7 ? a3 + a0->unk06 - a5 : a3 + a7; - int sp18 = (a0->unk04 + (a0->unk04 & 0x7)) / 8; - int sp1c = (a1->unk04 + (a1->unk04 & 0x7)) / 8; - int r12; // sp+20 - int r8; // sp+24 - int r5; - int r6; - u16 r2; + int loopSrcY, loopDstY, loopSrcX, loopDstX, xEnd, yEnd, multiplierSrcY, multiplierDstY; + const u8 *pixelsSrc; + u16 *pixelsDst; + u16 toOrr; - for (r12 = a3, r8 = a5; r12 < sp14; r12++, r8++) + if (dst->width - dstX < width) + xEnd = dst->width - dstX + srcX; + else + xEnd = width + srcX; + + if (dst->height - dstY < height) + yEnd = srcY + dst->height - dstY; + else + yEnd = srcY + height; + + multiplierSrcY = (src->width + (src->width & 7)) >> 3; + multiplierDstY = (dst->width + (dst->width & 7)) >> 3; + + for (loopSrcY = srcY, loopDstY = dstY; loopSrcY < yEnd; loopSrcY++, loopDstY++) { - for (r5 = a2, r6 = a4; a5 < sp10; a5++, a6++) + for (loopSrcX = srcX, loopDstX = dstX; loopSrcX < xEnd; loopSrcX++, loopDstX++) { - u8 *r3 = a0->unk00 + ((r5 >> 1) & 0x3) + ((r5 >> 3) << 5) + (((r12 >> 3) * sp18) << 5) + ((r12 & 0x7) << 2); - u8 *r4 = a1->unk00 + ((r6 >> 1) & 0x3) + ((r6 >> 3) << 5) + (((r8 >> 3) * sp1c) << 5) + ((r8 & 0x7) << 2); - if (((uintptr_t)r4) & 0x1) + pixelsSrc = src->pixels + ((loopSrcX >> 1) & 3) + ((loopSrcX >> 3) << 5) + (((loopSrcY >> 3) * multiplierSrcY) << 5) + ((u32)(loopSrcY << 0x1d) >> 0x1B); + pixelsDst = (void*) dst->pixels + ((loopDstX >> 1) & 3) + ((loopDstX >> 3) << 5) + ((( loopDstY >> 3) * multiplierDstY) << 5) + ((u32)( loopDstY << 0x1d) >> 0x1B); + + if ((uintptr_t )pixelsDst & 0x1) { - u16 *r4_2 = (u16 *)(r4 - 1); - if (r6 & 0x1) + pixelsDst = (void*)(pixelsDst) - 1; + if (loopDstX & 0x1) { - r2 = *r4_2 & 0x0fff; - if (r5 & 0x1) - *r4_2 = r2 | ((*r3 & 0xf0) << 8); + toOrr = *pixelsDst & 0x0fff; + if (loopSrcX & 0x1) + *pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 8); else - *r4_2 = r2 | ((*r3 & 0x0f) << 12); + *pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 12); } else { - r2 = *r4_2 * 0xf0ff; - if (r5 & 0x1) - *r4_2 = r2 | ((*r3 & 0xf0) << 4); + toOrr = *pixelsDst & 0xf0ff; + if (loopSrcX & 0x1) + *pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 4); else - *r4_2 = r2 | ((*r3 & 0x0f) << 8); + *pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 8); } } else { - u16 *r4_2 = (u16 *)r4; - if (r6 & 1) + if (loopDstX & 1) { - r2 = *r4_2 & 0xff0f; - if (r5 & 1) - *r4_2 = r2 | ((*r3 & 0xf0) << 0); + toOrr = *pixelsDst & 0xff0f; + if (loopSrcX & 1) + *pixelsDst = toOrr | ((*pixelsSrc & 0xf0) << 0); else - *r4_2 = r2 | ((*r3 & 0x0f) << 4); + *pixelsDst = toOrr | ((*pixelsSrc & 0x0f) << 4); } else { - r2 = *r4_2 & 0xfff0; - if (r5 & 1) - *r4_2 = r2 | ((*r3 & 0xf0) >> 4); + toOrr = *pixelsDst & 0xfff0; + if (loopSrcX & 1) + *pixelsDst = toOrr | ((*pixelsSrc & 0xf0) >> 4); else - *r4_2 = r2 | ((*r3 & 0x0f) >> 0); + *pixelsDst = toOrr | ((*pixelsSrc & 0x0f) >> 0); } } + + // Needed to match, urgh. + #ifndef NONMATCHING + asm("":::"r4"); + pixelsDst++;pixelsDst--; + #endif // NONMATCHING } } } -#else -NAKED -void sub_819A080(struct UnkStruct_819A080 *a0, struct UnkStruct_819A080 *a1, u16 a2, u16 a3, u16 a4, u16 a5, u16 a6, u16 a7) -{ - asm("push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, #0x28\n\ - str r0, [sp]\n\ - str r1, [sp, #0x4]\n\ - ldr r0, [sp, #0x48]\n\ - ldr r4, [sp, #0x4C]\n\ - ldr r1, [sp, #0x50]\n\ - ldr r5, [sp, #0x54]\n\ - lsl r2, #16\n\ - lsr r2, #16\n\ - str r2, [sp, #0x8]\n\ - lsl r3, #16\n\ - lsr r3, #16\n\ - lsl r0, #16\n\ - lsr r0, #16\n\ - str r0, [sp, #0xC]\n\ - lsl r4, #16\n\ - lsr r4, #16\n\ - lsl r1, #16\n\ - lsr r1, #16\n\ - lsl r5, #16\n\ - lsr r5, #16\n\ - ldr r2, [sp, #0x4]\n\ - ldrh r0, [r2, #0x4]\n\ - ldr r2, [sp, #0xC]\n\ - sub r0, r2\n\ - ldr r2, [sp, #0x8]\n\ - add r2, r1, r2\n\ - str r2, [sp, #0x10]\n\ - cmp r0, r1\n\ - bge _0819A0CC\n\ - ldr r1, [sp, #0x8]\n\ - add r0, r1\n\ - str r0, [sp, #0x10]\n\ -_0819A0CC:\n\ - ldr r2, [sp, #0x4]\n\ - ldrh r1, [r2, #0x6]\n\ - sub r0, r1, r4\n\ - cmp r0, r5\n\ - bge _0819A0DE\n\ - add r0, r3, r1\n\ - sub r0, r4\n\ - str r0, [sp, #0x14]\n\ - b _0819A0E2\n\ -_0819A0DE:\n\ - add r5, r3, r5\n\ - str r5, [sp, #0x14]\n\ -_0819A0E2:\n\ - ldr r0, [sp]\n\ - ldrh r1, [r0, #0x4]\n\ - mov r2, #0x7\n\ - add r0, r1, #0\n\ - and r0, r2\n\ - add r1, r0\n\ - asr r1, #3\n\ - str r1, [sp, #0x18]\n\ - ldr r0, [sp, #0x4]\n\ - ldrh r1, [r0, #0x4]\n\ - add r0, r1, #0\n\ - and r0, r2\n\ - add r1, r0\n\ - asr r1, #3\n\ - str r1, [sp, #0x1C]\n\ - mov r12, r3\n\ - mov r8, r4\n\ - ldr r1, [sp, #0x14]\n\ - cmp r12, r1\n\ - blt _0819A10C\n\ - b _0819A24A\n\ -_0819A10C:\n\ - ldr r5, [sp, #0x8]\n\ - ldr r6, [sp, #0xC]\n\ - mov r2, r12\n\ - add r2, #0x1\n\ - str r2, [sp, #0x20]\n\ - mov r0, r8\n\ - add r0, #0x1\n\ - str r0, [sp, #0x24]\n\ - ldr r1, [sp, #0x10]\n\ - cmp r5, r1\n\ - blt _0819A124\n\ - b _0819A23A\n\ -_0819A124:\n\ - mov r7, #0x1\n\ - mov r2, #0xF0\n\ - mov r10, r2\n\ - mov r0, #0xF\n\ - mov r9, r0\n\ -_0819A12E:\n\ - asr r0, r5, #1\n\ - mov r1, #0x3\n\ - and r0, r1\n\ - ldr r2, [sp]\n\ - ldr r1, [r2]\n\ - add r1, r0\n\ - asr r0, r5, #3\n\ - lsl r0, #5\n\ - add r1, r0\n\ - mov r2, r12\n\ - asr r0, r2, #3\n\ - ldr r2, [sp, #0x18]\n\ - mul r0, r2\n\ - lsl r0, #5\n\ - add r1, r0\n\ - mov r2, r12\n\ - lsl r0, r2, #29\n\ - lsr r0, #27\n\ - add r3, r1, r0\n\ - asr r0, r6, #1\n\ - mov r1, #0x3\n\ - and r0, r1\n\ - ldr r2, [sp, #0x4]\n\ - ldr r1, [r2]\n\ - add r1, r0\n\ - asr r0, r6, #3\n\ - lsl r0, #5\n\ - add r1, r0\n\ - mov r2, r8\n\ - asr r0, r2, #3\n\ - ldr r2, [sp, #0x1C]\n\ - mul r0, r2\n\ - lsl r0, #5\n\ - add r1, r0\n\ - mov r2, r8\n\ - lsl r0, r2, #29\n\ - lsr r0, #27\n\ - add r4, r1, r0\n\ - add r0, r4, #0\n\ - and r0, r7\n\ - cmp r0, #0\n\ - beq _0819A1DA\n\ - sub r4, #0x1\n\ - add r0, r6, #0\n\ - and r0, r7\n\ - cmp r0, #0\n\ - beq _0819A1B2\n\ - ldrh r0, [r4]\n\ - ldr r2, =0x00000fff\n\ - and r2, r0\n\ - add r0, r5, #0\n\ - and r0, r7\n\ - cmp r0, #0\n\ - beq _0819A1A8\n\ - ldrb r1, [r3]\n\ - mov r0, r10\n\ - and r0, r1\n\ - lsl r0, #8\n\ - b _0819A22A\n\ - .pool\n\ -_0819A1A8:\n\ - ldrb r1, [r3]\n\ - mov r0, r9\n\ - and r0, r1\n\ - lsl r0, #12\n\ - b _0819A22A\n\ -_0819A1B2:\n\ - ldrh r0, [r4]\n\ - ldr r2, =0x0000f0ff\n\ - and r2, r0\n\ - add r0, r5, #0\n\ - and r0, r7\n\ - cmp r0, #0\n\ - beq _0819A1D0\n\ - ldrb r1, [r3]\n\ - mov r0, r10\n\ - and r0, r1\n\ - lsl r0, #4\n\ - b _0819A22A\n\ - .pool\n\ -_0819A1D0:\n\ - ldrb r1, [r3]\n\ - mov r0, r9\n\ - and r0, r1\n\ - lsl r0, #8\n\ - b _0819A22A\n\ -_0819A1DA:\n\ - add r0, r6, #0\n\ - and r0, r7\n\ - cmp r0, #0\n\ - beq _0819A206\n\ - ldrh r0, [r4]\n\ - ldr r2, =0x0000ff0f\n\ - and r2, r0\n\ - add r0, r5, #0\n\ - and r0, r7\n\ - cmp r0, #0\n\ - beq _0819A1FC\n\ - ldrb r1, [r3]\n\ - mov r0, r10\n\ - b _0819A228\n\ - .pool\n\ -_0819A1FC:\n\ - ldrb r1, [r3]\n\ - mov r0, r9\n\ - and r0, r1\n\ - lsl r0, #4\n\ - b _0819A22A\n\ -_0819A206:\n\ - ldrh r0, [r4]\n\ - ldr r2, =0x0000fff0\n\ - and r2, r0\n\ - add r0, r5, #0\n\ - and r0, r7\n\ - cmp r0, #0\n\ - beq _0819A224\n\ - ldrb r1, [r3]\n\ - mov r0, r10\n\ - and r0, r1\n\ - lsr r0, #4\n\ - b _0819A22A\n\ - .pool\n\ -_0819A224:\n\ - ldrb r1, [r3]\n\ - mov r0, r9\n\ -_0819A228:\n\ - and r0, r1\n\ -_0819A22A:\n\ - orr r2, r0\n\ - strh r2, [r4]\n\ - add r5, #0x1\n\ - add r6, #0x1\n\ - ldr r0, [sp, #0x10]\n\ - cmp r5, r0\n\ - bge _0819A23A\n\ - b _0819A12E\n\ -_0819A23A:\n\ - ldr r1, [sp, #0x20]\n\ - mov r12, r1\n\ - ldr r2, [sp, #0x24]\n\ - mov r8, r2\n\ - ldr r0, [sp, #0x14]\n\ - cmp r12, r0\n\ - bge _0819A24A\n\ - b _0819A10C\n\ -_0819A24A:\n\ - add sp, #0x28\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n"); -} -#endif void sub_819A25C(u8 palOffset, u16 speciesId) { diff --git a/src/menu_helpers.c b/src/menu_helpers.c index 801e2546b..cb0d621c6 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -27,7 +27,7 @@ EWRAM_DATA static struct YesNoFuncTable gUnknown_0203A138 = {0}; EWRAM_DATA static u8 gUnknown_0203A140 = 0; // IWRAM bss vars -IWRAM_DATA static TaskFunc gUnknown_0300117C; +static TaskFunc gUnknown_0300117C; // const rom data static const struct OamData sOamData_859F4E8 = diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 34dd1fe2b..1536cf413 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -458,338 +458,106 @@ void sub_81D2230(struct UnknownStruct_81D1ED4 *arg0) arg0->unk354 = 1; } -/* TODO -static void sub_81D2278(struct UnknownStruct_81D1ED4 *arg0, u16 arg1[66][2], struct UnknownSubStruct_81D1ED4 *arg2, struct UnknownSubStruct_81D1ED4 *arg3, u8 arg4, u16 arg5[66][2]) +static void sub_81D2278(struct UnknownStruct_81D1ED4 *arg0, u16 *arg1, struct UnknownSubStruct_81D1ED4 *arg2, struct UnknownSubStruct_81D1ED4 *arg3, u8 arg4, u16 *arg5) { - s32 var_2C = 0; - u16 r8; - s32 r10, r4, r2, r0, r1, var_30; + u16 i, r8, r10, r0, var_30; + u16 *ptr; + s32 r4, var_2C; + var_2C = 0; if (arg2->unk2 < arg3->unk2) { - r2 = arg2->unk2; r10 = arg2->unk2; r0 = arg3->unk2; - r1 = arg2->unk0; - r4 = r1 << 10; + r4 = arg2->unk0 << 10; var_30 = arg3->unk0; + r8 = r0 - r10; + if (r8 != 0) + var_2C = ((var_30 - arg2->unk0) << 10) / r8; } else { - r0 = arg2->unk0; + r0 = arg2->unk2; r10 = arg3->unk2; - r1 = arg3->unk0; - r4 = r1 << 10; + r4 = arg3->unk0 << 10; var_30 = arg2->unk0; - r2 = arg3->unk2; + r8 = r0 - r10; + if (r8 != 0) + var_2C = ((var_30 - arg3->unk0) << 10) / r8; } - r8 = r0 - r2; - if (r8 != 0) - var_2C = ((var_30 - r1) << 10) / r8; r8++; if (arg5 == NULL) { + arg1 += (r10 - 56) * 2; + for (i = 0; i < r8; i++) + { + arg1[arg4] = (r4 >> 10) + ((r4 >> 9) & 1) + arg4; + r4 += var_2C; + arg1 += 2; + } + ptr = arg1 - 2; } -} -*/ -NAKED -static void sub_81D2278(struct UnknownStruct_81D1ED4 *arg0, u16 arg1[66][2], struct UnknownSubStruct_81D1ED4 *arg2, struct UnknownSubStruct_81D1ED4 *arg3, u8 arg4, u16 arg5[66][2]) -{ - asm_unified("\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0x18\n\ - str r0, [sp]\n\ - adds r6, r1, 0\n\ - adds r5, r2, 0\n\ - str r3, [sp, 0x4]\n\ - ldr r0, [sp, 0x38]\n\ - ldr r7, [sp, 0x3C]\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - mov r9, r0\n\ - movs r0, 0\n\ - str r0, [sp, 0xC]\n\ - ldrh r0, [r5, 0x2]\n\ - ldrh r1, [r3, 0x2]\n\ - cmp r0, r1\n\ - bcs _081D22B2\n\ - adds r2, r0, 0\n\ - mov r10, r2\n\ - ldrh r0, [r3, 0x2]\n\ - ldrh r1, [r5]\n\ - lsls r4, r1, 10\n\ - ldrh r3, [r3]\n\ - str r3, [sp, 0x8]\n\ - b _081D22C6\n\ - _081D22B2:\n\ - ldrh r0, [r5, 0x2]\n\ - ldr r1, [sp, 0x4]\n\ - ldrh r1, [r1, 0x2]\n\ - mov r10, r1\n\ - ldr r2, [sp, 0x4]\n\ - ldrh r1, [r2]\n\ - lsls r4, r1, 10\n\ - ldrh r3, [r5]\n\ - str r3, [sp, 0x8]\n\ - mov r2, r10\n\ - _081D22C6:\n\ - subs r0, r2\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - mov r8, r0\n\ - cmp r0, 0\n\ - beq _081D22DE\n\ - subs r0, r3, r1\n\ - lsls r0, 10\n\ - mov r1, r8\n\ - bl __divsi3\n\ - str r0, [sp, 0xC]\n\ - _081D22DE:\n\ - mov r0, r8\n\ - adds r0, 0x1\n\ - lsls r0, 16\n\ - lsrs r0, 16\n\ - mov r8, r0\n\ - cmp r7, 0\n\ - bne _081D2328\n\ - mov r0, r10\n\ - subs r0, 0x38\n\ - lsls r0, 2\n\ - adds r6, r0\n\ - movs r5, 0\n\ - mov r3, r9\n\ - lsls r3, 1\n\ - mov r12, r3\n\ - ldr r0, [sp, 0x8]\n\ - add r0, r9\n\ - str r0, [sp, 0x10]\n\ - cmp r7, r8\n\ - bcs _081D23B6\n\ - movs r7, 0x1\n\ - _081D2308:\n\ - adds r2, r3, r6\n\ - asrs r1, r4, 10\n\ - asrs r0, r4, 9\n\ - ands r0, r7\n\ - adds r1, r0\n\ - add r1, r9\n\ - strh r1, [r2]\n\ - ldr r1, [sp, 0xC]\n\ - adds r4, r1\n\ - adds r6, 0x4\n\ - adds r0, r5, 0x1\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - cmp r5, r8\n\ - bcc _081D2308\n\ - b _081D23B6\n\ - _081D2328:\n\ - ldr r2, [sp, 0xC]\n\ - cmp r2, 0\n\ - ble _081D23C0\n\ - mov r0, r10\n\ - subs r0, 0x38\n\ - lsls r0, 2\n\ - adds r7, r0\n\ - movs r5, 0\n\ - mov r3, r9\n\ - lsls r3, 1\n\ - mov r12, r3\n\ - ldr r0, [sp, 0x8]\n\ - add r0, r9\n\ - str r0, [sp, 0x10]\n\ - cmp r5, r8\n\ - bcs _081D237A\n\ - ldr r0, =0x00026bff\n\ - cmp r4, r0\n\ - bgt _081D237A\n\ - mov r1, r12\n\ - str r1, [sp, 0x14]\n\ - _081D2352:\n\ - ldr r3, [sp, 0x14]\n\ - adds r2, r3, r7\n\ - asrs r1, r4, 10\n\ - asrs r0, r4, 9\n\ - movs r3, 0x1\n\ - ands r0, r3\n\ - adds r1, r0\n\ - add r1, r9\n\ - strh r1, [r2]\n\ - ldr r0, [sp, 0xC]\n\ - adds r4, r0\n\ - adds r7, 0x4\n\ - adds r0, r5, 0x1\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - cmp r5, r8\n\ - bcs _081D237A\n\ - ldr r1, =0x00026bff\n\ - cmp r4, r1\n\ - ble _081D2352\n\ - _081D237A:\n\ - mov r2, r10\n\ - adds r1, r2, r5\n\ - ldr r3, [sp]\n\ - movs r2, 0xD4\n\ - lsls r2, 2\n\ - adds r0, r3, r2\n\ - strh r1, [r0]\n\ - ldrh r0, [r0]\n\ - subs r0, 0x38\n\ - lsls r0, 2\n\ - adds r6, r0\n\ - cmp r5, r8\n\ - bcs _081D23B6\n\ - mov r3, r12\n\ - movs r7, 0x1\n\ - _081D2398:\n\ - adds r2, r3, r6\n\ - asrs r1, r4, 10\n\ - asrs r0, r4, 9\n\ - ands r0, r7\n\ - adds r1, r0\n\ - add r1, r9\n\ - strh r1, [r2]\n\ - ldr r0, [sp, 0xC]\n\ - adds r4, r0\n\ - adds r6, 0x4\n\ - adds r0, r5, 0x1\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - cmp r5, r8\n\ - bcc _081D2398\n\ - _081D23B6:\n\ - subs r0, r6, 0x4\n\ - b _081D248C\n\ - .pool\n\ - _081D23C0:\n\ - ldr r1, [sp, 0xC]\n\ - cmp r1, 0\n\ - bge _081D2464\n\ - mov r0, r10\n\ - subs r0, 0x38\n\ - lsls r0, 2\n\ - adds r6, r0\n\ - movs r5, 0\n\ - mov r2, r9\n\ - lsls r2, 1\n\ - mov r12, r2\n\ - ldr r3, [sp, 0x8]\n\ - add r3, r9\n\ - str r3, [sp, 0x10]\n\ - cmp r5, r8\n\ - bcs _081D241E\n\ - adds r3, r2, r6\n\ - asrs r1, r4, 10\n\ - asrs r0, r4, 9\n\ - movs r2, 0x1\n\ - ands r0, r2\n\ - adds r1, r0\n\ - add r1, r9\n\ - strh r1, [r3]\n\ - b _081D2414\n\ - _081D23F2:\n\ - ldr r0, [sp, 0xC]\n\ - adds r4, r0\n\ - adds r6, 0x4\n\ - adds r0, r5, 0x1\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - cmp r5, r8\n\ - bcs _081D241E\n\ - mov r1, r12\n\ - adds r3, r1, r6\n\ - asrs r2, r4, 10\n\ - asrs r0, r4, 9\n\ - movs r1, 0x1\n\ - ands r0, r1\n\ - adds r2, r0\n\ - add r2, r9\n\ - strh r2, [r3]\n\ - _081D2414:\n\ - ldr r0, =0x00026bff\n\ - cmp r4, r0\n\ - bgt _081D23F2\n\ - movs r0, 0x9B\n\ - strh r0, [r3]\n\ - _081D241E:\n\ - mov r2, r10\n\ - adds r1, r2, r5\n\ - ldr r3, [sp]\n\ - movs r2, 0xD4\n\ - lsls r2, 2\n\ - adds r0, r3, r2\n\ - strh r1, [r0]\n\ - ldrh r0, [r0]\n\ - subs r0, 0x38\n\ - lsls r0, 2\n\ - adds r7, r0\n\ - cmp r5, r8\n\ - bcs _081D245A\n\ - mov r3, r12\n\ - movs r6, 0x1\n\ - _081D243C:\n\ - adds r2, r3, r7\n\ - asrs r1, r4, 10\n\ - asrs r0, r4, 9\n\ - ands r0, r6\n\ - adds r1, r0\n\ - add r1, r9\n\ - strh r1, [r2]\n\ - ldr r0, [sp, 0xC]\n\ - adds r4, r0\n\ - adds r7, 0x4\n\ - adds r0, r5, 0x1\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - cmp r5, r8\n\ - bcc _081D243C\n\ - _081D245A:\n\ - subs r0, r7, 0x4\n\ - b _081D248C\n\ - .pool\n\ - _081D2464:\n\ - ldr r1, [sp]\n\ - movs r2, 0xD4\n\ - lsls r2, 2\n\ - adds r0, r1, r2\n\ - mov r3, r10\n\ - strh r3, [r0]\n\ - mov r0, r10\n\ - subs r0, 0x38\n\ - lsls r0, 2\n\ - adds r6, r0\n\ - adds r7, r0\n\ - ldrh r0, [r5]\n\ - adds r0, 0x1\n\ - strh r0, [r6, 0x2]\n\ - ldr r1, [sp, 0x4]\n\ - ldrh r0, [r1]\n\ - strh r0, [r7]\n\ - movs r0, 0x9B\n\ - strh r0, [r7, 0x2]\n\ - b _081D2494\n\ - _081D248C:\n\ - add r0, r12\n\ - mov r2, sp\n\ - ldrh r2, [r2, 0x10]\n\ - strh r2, [r0]\n\ - _081D2494:\n\ - add sp, 0x18\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - "); + else if (var_2C > 0) + { + arg5 += (r10 - 56) * 2; + // Less readable than the other loops, but it has to be written this way to match. + for (i = 0; i < r8; arg5[arg4] = (r4 >> 10) + ((r4 >> 9) & 1) + arg4, r4 += var_2C, arg5 += 2, i++) + { + if (r4 >= (155 << 10)) + break; + } + + arg0->unk350 = r10 + i; + arg1 += (arg0->unk350 - 56) * 2; + for (; i < r8; i++) + { + arg1[arg4] = (r4 >> 10) + ((r4 >> 9) & 1) + arg4; + r4 += var_2C; + arg1 += 2; + } + + ptr = arg1 - 2; + } + else if (var_2C < 0) + { + arg1 += (r10 - 56) * 2; + for (i = 0; i < r8; i++) + { + arg1[arg4] = (r4 >> 10) + ((r4 >> 9) & 1) + arg4; + if (r4 < (155 << 10)) + { + arg1[arg4] = 155; + break; + } + r4 += var_2C; + arg1 += 2; + } + + arg0->unk350 = r10 + i; + arg5 += (arg0->unk350 - 56) * 2; + for (; i < r8; i++) + { + arg5[arg4] = (r4 >> 10) + ((r4 >> 9) & 1) + arg4; + r4 += var_2C; + arg5 += 2; + } + + ptr = arg5 - 2; + } + else + { + arg0->unk350 = r10; + arg1 += (r10 - 56) * 2; + arg5 += (r10 - 56) * 2; + arg1[1] = arg2->unk0 + 1; + arg5[0] = arg3->unk0; + arg5[1] = 155; + return; + } + + ptr[arg4] = arg4 + var_30; } static void sub_81D24A4(struct UnknownStruct_81D1ED4 *arg0) @@ -799,18 +567,18 @@ static void sub_81D24A4(struct UnknownStruct_81D1ED4 *arg0) if (arg0->unk12C[0].unk2 < arg0->unk12C[1].unk2) { r6 = arg0->unk12C[0].unk2; - sub_81D2278(arg0, arg0->unk140, &arg0->unk12C[0], &arg0->unk12C[1], 1, NULL); + sub_81D2278(arg0, arg0->unk140[0], &arg0->unk12C[0], &arg0->unk12C[1], 1, NULL); } else { r6 = arg0->unk12C[1].unk2; - sub_81D2278(arg0, arg0->unk140, &arg0->unk12C[1], &arg0->unk12C[0], 0, NULL); + sub_81D2278(arg0, arg0->unk140[0], &arg0->unk12C[1], &arg0->unk12C[0], 0, NULL); } - sub_81D2278(arg0, arg0->unk140, &arg0->unk12C[1], &arg0->unk12C[2], 1, NULL); + sub_81D2278(arg0, arg0->unk140[0], &arg0->unk12C[1], &arg0->unk12C[2], 1, NULL); i = (arg0->unk12C[2].unk2 <= arg0->unk12C[3].unk2); - sub_81D2278(arg0, arg0->unk140, &arg0->unk12C[2], &arg0->unk12C[3], i, arg0->unk248); + sub_81D2278(arg0, arg0->unk140[0], &arg0->unk12C[2], &arg0->unk12C[3], i, arg0->unk248[0]); for (i = 56; i < r6; i++) { arg0->unk140[i - 56][0] = 0; @@ -841,15 +609,15 @@ static void sub_81D2634(struct UnknownStruct_81D1ED4 *arg0) if (arg0->unk12C[0].unk2 < arg0->unk12C[4].unk2) { r6 = arg0->unk12C[0].unk2; - sub_81D2278(arg0, arg0->unk248, &arg0->unk12C[0], &arg0->unk12C[4], 0, NULL); + sub_81D2278(arg0, arg0->unk248[0], &arg0->unk12C[0], &arg0->unk12C[4], 0, NULL); } else { r6 = arg0->unk12C[4].unk2; - sub_81D2278(arg0, arg0->unk248, &arg0->unk12C[4], &arg0->unk12C[0], 1, NULL); + sub_81D2278(arg0, arg0->unk248[0], &arg0->unk12C[4], &arg0->unk12C[0], 1, NULL); } - sub_81D2278(arg0, arg0->unk248, &arg0->unk12C[4], &arg0->unk12C[3], 0, NULL); + sub_81D2278(arg0, arg0->unk248[0], &arg0->unk12C[4], &arg0->unk12C[3], 0, NULL); for (i = 56; i < r6; i++) { @@ -1290,7 +1058,7 @@ void sub_81D3094(void *tilesDst, void *palDst, u16 boxId, u16 monId, u16 arg5, u u32 personality = GetBoxOrPartyMonData(boxId, monId, MON_DATA_PERSONALITY, NULL); LoadSpecialPokePic(&gMonFrontPicTable[species], tilesDst, species, personality, TRUE); - LZ77UnCompWram(GetFrontSpritePalFromSpeciesAndPersonality(species, trainerId, personality), palDst); + LZ77UnCompWram(GetMonSpritePalFromSpeciesAndPersonality(species, trainerId, personality), palDst); } } diff --git a/src/mirage_tower.c b/src/mirage_tower.c index 269f8ea1b..e398c2334 100644 --- a/src/mirage_tower.c +++ b/src/mirage_tower.c @@ -258,7 +258,7 @@ EWRAM_DATA static struct Struct203CF10 *sUnknown_0203CF10 = NULL; EWRAM_DATA static struct BgRegOffsets *sBgShakeOffsets = NULL; EWRAM_DATA struct MirageTowerPulseBlend *sMirageTowerPulseBlend = NULL; -IWRAM_DATA static u16 gUnknown_030012A8[8]; +static u16 gUnknown_030012A8[8]; bool8 IsMirageTowerVisible(void) { diff --git a/src/multiboot.c b/src/multiboot.c index da90a55c0..c7e14392e 100644 --- a/src/multiboot.c +++ b/src/multiboot.c @@ -1,7 +1,7 @@ #include "gba/gba.h" #include "multiboot.h" -IWRAM_DATA static u16 MultiBoot_required_data[MULTIBOOT_NCHILD]; +static u16 MultiBoot_required_data[MULTIBOOT_NCHILD]; static int MultiBootSend(struct MultiBootParam *mp, u16 data); static int MultiBootHandShake(struct MultiBootParam *mp); @@ -435,7 +435,7 @@ static int MultiBootHandShake(struct MultiBootParam *mp) #undef must_data } -static void MultiBootWaitCycles(u32 cycles) +static NOINLINE void MultiBootWaitCycles(u32 cycles) { asm("mov r2, pc"); asm("lsr r2, #24"); diff --git a/src/new_game.c b/src/new_game.c index 7a0c668a4..ee67da9be 100644 --- a/src/new_game.c +++ b/src/new_game.c @@ -37,6 +37,7 @@ #include "contest.h" #include "item_menu.h" #include "pokemon_storage_system.h" +#include "pokemon_jump.h" #include "decoration_inventory.h" #include "secret_base.h" #include "player_pc.h" @@ -45,8 +46,6 @@ #include "mevent.h" #include "union_room_chat.h" -extern void ResetPokeJumpResults(void); - extern const u8 EventScript_ResetAllMapFlags[]; // this file's functions diff --git a/src/overworld.c b/src/overworld.c index 4356752c1..2097abc53 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -186,15 +186,15 @@ static u8 GetAdjustedInitialDirection(struct InitialPlayerAvatarState *playerStr static u16 GetCenterScreenMetatileBehavior(void); // IWRAM bss vars -IWRAM_DATA static void *sUnusedOverworldCallback; -IWRAM_DATA static u8 sPlayerTradingStates[4]; +static void *sUnusedOverworldCallback; +static u8 sPlayerTradingStates[4]; // This callback is called with a player's key code. It then returns an // adjusted key code, effectively intercepting the input before anything // can process it. -IWRAM_DATA static u16 (*sPlayerKeyInterceptCallback)(u32); -IWRAM_DATA static bool8 sUnknown_03000E18; -IWRAM_DATA static u8 sRfuKeepAliveTimer; -IWRAM_DATA static u32 sUnusedVar; +static u16 (*sPlayerKeyInterceptCallback)(u32); +static bool8 sUnknown_03000E18; +static u8 sRfuKeepAliveTimer; +static u32 sUnusedVar; // IWRAM common u16 *gBGTilemapBuffers1; diff --git a/src/party_menu.c b/src/party_menu.c index 5af030d19..f851b7b4d 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -1596,8 +1596,8 @@ static void InitPartyMenu(u8 a, u8 b, u8 c, u8 d, u8 messageId, TaskFunc task, M gUnknown_0203CEC4->task = task; gUnknown_0203CEC4->exitCallback = NULL; gUnknown_0203CEC4->unk8_1 = 0; - gUnknown_0203CEC4->unk8_2 = 0xFF; - gUnknown_0203CEC4->unk9_0 = 0xFF; + gUnknown_0203CEC4->unk8_2 = 0x7F; + gUnknown_0203CEC4->unk9_0 = 0x7F; if (a == 4) gUnknown_0203CEC4->unk8_0 = TRUE; @@ -1820,7 +1820,7 @@ static bool8 AllocPartyMenuBg(void) static bool8 AllocPartyMiscGfx(void) { - int sizeout; + u32 sizeout; switch (gUnknown_0203CEC4->data[0]) { diff --git a/src/pokedex.c b/src/pokedex.c index 2588e2b73..da3f06bf1 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -3855,7 +3855,7 @@ void blockset_load_palette_to_gpu(u8 taskId) otId = ((u16)gTasks[taskId].data[13] << 16) | (u16)gTasks[taskId].data[12]; personality = ((u16)gTasks[taskId].data[15] << 16) | (u16)gTasks[taskId].data[14]; paletteNum = gSprites[gTasks[taskId].data[3]].oam.paletteNum; - lzPaletteData = GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality); + lzPaletteData = GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality); LoadCompressedPalette(lzPaletteData, 0x100 | paletteNum * 16, 32); DestroyTask(taskId); } diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c index 1eb8c0953..dc69b5d54 100755 --- a/src/pokedex_area_screen.c +++ b/src/pokedex_area_screen.c @@ -763,11 +763,11 @@ static void sub_813D6B4(void) static void CreateAreaMarkerSprites(void) { u8 spriteId; - static IWRAM_DATA s16 x; - static IWRAM_DATA s16 y; - static IWRAM_DATA s16 i; - static IWRAM_DATA s16 mapSecId; - static IWRAM_DATA s16 numSprites; + static s16 x; + static s16 y; + static s16 i; + static s16 mapSecId; + static s16 numSprites; LoadSpriteSheet(&sAreaMarkerSpriteSheet); LoadSpritePalette(&sAreaMarkerSpritePalette); diff --git a/src/pokemon.c b/src/pokemon.c index 956f99e27..4ae81c653 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2628,25 +2628,20 @@ bool8 sub_80688F8(u8 caseId, u8 battlerId) return TRUE; } -static s32 GetDeoxysStat(struct Pokemon *mon, s32 statId) +static u16 GetDeoxysStat(struct Pokemon *mon, s32 statId) { s32 ivVal, evVal; - s32 statValue; - u8 nature, statId_; + u16 statValue = 0; + u8 nature; - if (gBattleTypeFlags & BATTLE_TYPE_20) - return 0; - if (GetMonData(mon, MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS) + if (gBattleTypeFlags & BATTLE_TYPE_20 || GetMonData(mon, MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS) return 0; ivVal = GetMonData(mon, MON_DATA_HP_IV + statId, NULL); evVal = GetMonData(mon, MON_DATA_HP_EV + statId, NULL); - statValue = (u16)(((sDeoxysBaseStats[statId] * 2 + ivVal + evVal / 4) * mon->level) / 100 + 5); - + statValue = ((sDeoxysBaseStats[statId] * 2 + ivVal + evVal / 4) * mon->level) / 100 + 5; nature = GetNature(mon); - statId_ = statId; // needed to match - statValue = ModifyStatByNature(nature, statValue, statId_); - + statValue = ModifyStatByNature(nature, statValue, (u8)statId); return statValue; } @@ -3299,27 +3294,27 @@ u32 GetMonData(struct Pokemon *mon, s32 field, u8* data) ret = mon->maxHP; break; case MON_DATA_ATK: - ret = (u16)GetDeoxysStat(mon, STAT_ATK); + ret = GetDeoxysStat(mon, STAT_ATK); if (!ret) ret = mon->attack; break; case MON_DATA_DEF: - ret = (u16)GetDeoxysStat(mon, STAT_DEF); + ret = GetDeoxysStat(mon, STAT_DEF); if (!ret) ret = mon->defense; break; case MON_DATA_SPEED: - ret = (u16)GetDeoxysStat(mon, STAT_SPEED); + ret = GetDeoxysStat(mon, STAT_SPEED); if (!ret) ret = mon->speed; break; case MON_DATA_SPATK: - ret = (u16)GetDeoxysStat(mon, STAT_SPATK); + ret = GetDeoxysStat(mon, STAT_SPATK); if (!ret) ret = mon->spAttack; break; case MON_DATA_SPDEF: - ret = (u16)GetDeoxysStat(mon, STAT_SPDEF); + ret = GetDeoxysStat(mon, STAT_SPDEF); if (!ret) ret = mon->spDefense; break; @@ -6038,10 +6033,10 @@ const u32 *GetMonFrontSpritePal(struct Pokemon *mon) u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0); u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0); u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0); - return GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality); + return GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality); } -const u32 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality) +const u32 *GetMonSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality) { u32 shinyValue; diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index 52fa6db51..340327475 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -177,9 +177,9 @@ static void SpriteCB_SetDummyOnAnimEnd(struct Sprite *sprite); #define STRUCT_COUNT 4 // IWRAM bss -static IWRAM_DATA struct UnkAnimStruct sUnknown_03001240[STRUCT_COUNT]; -static IWRAM_DATA u8 sUnknown_03001270; -static IWRAM_DATA bool32 sUnknown_03001274; +static struct UnkAnimStruct sUnknown_03001240[STRUCT_COUNT]; +static u8 sUnknown_03001270; +static bool32 sUnknown_03001274; // const rom data static const u8 sSpeciesToBackAnimSet[] = @@ -861,16 +861,27 @@ u8 GetSpeciesBackAnimSet(u16 species) } #define tState data[0] -#define tPtrLO data[1] -#define tPtrHI data[2] +#define tPtrHi data[1] +#define tPtrLo data[2] #define tAnimId data[3] #define tSaved0 data[4] #define tSaved2 data[5] +// BUG: In vanilla, tPtrLo is read as an s16, so if bit 15 of the +// address were to be set it would cause the pointer to be read +// as 0xFFFFXXXX instead of the desired 0x02YYXXXX. +// By dumb luck, this is not an issue in vanilla. However, +// changing the link order revealed this bug. +#if MODERN +#define ANIM_SPRITE(taskId) ((struct Sprite *)((gTasks[taskId].tPtrHi << 16) | ((u16)gTasks[taskId].tPtrLo))) +#else +#define ANIM_SPRITE(taskId) ((struct Sprite *)((gTasks[taskId].tPtrHi << 16) | (gTasks[taskId].tPtrLo))) +#endif //MODERN + static void Task_HandleMonAnimation(u8 taskId) { u32 i; - struct Sprite *sprite = (struct Sprite*)(u32)((gTasks[taskId].tPtrLO << 0x10) | (gTasks[taskId].tPtrHI)); + struct Sprite *sprite = ANIM_SPRITE(taskId); if (gTasks[taskId].tState == 0) { @@ -900,8 +911,8 @@ static void Task_HandleMonAnimation(u8 taskId) void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, u8 frontAnimId) { u8 taskId = CreateTask(Task_HandleMonAnimation, 128); - gTasks[taskId].tPtrLO = (u32)(sprite) >> 0x10; - gTasks[taskId].tPtrHI = (u32)(sprite); + gTasks[taskId].tPtrHi = (u32)(sprite) >> 0x10; + gTasks[taskId].tPtrLo = (u32)(sprite); gTasks[taskId].tAnimId = frontAnimId; } @@ -916,8 +927,8 @@ void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet) u8 nature, taskId, animId, battlerId; taskId = CreateTask(Task_HandleMonAnimation, 128); - gTasks[taskId].tPtrLO = (u32)(sprite) >> 0x10; - gTasks[taskId].tPtrHI = (u32)(sprite); + gTasks[taskId].tPtrHi = (u32)(sprite) >> 0x10; + gTasks[taskId].tPtrLo = (u32)(sprite); battlerId = sprite->data[0]; nature = GetNature(&gPlayerParty[gBattlerPartyIndexes[battlerId]]); @@ -927,8 +938,8 @@ void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet) } #undef tState -#undef tPtrLO -#undef tPtrHI +#undef tPtrHi +#undef tPtrLo #undef tAnimId #undef tSaved0 #undef tSaved2 diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index 699862883..8f16e1ce2 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -1,10 +1,12 @@ #include "global.h" #include "alloc.h" +#include "battle_anim.h" #include "bg.h" #include "data.h" #include "decompress.h" #include "dynamic_placeholder_text_util.h" #include "event_data.h" +#include "international_string_util.h" #include "item.h" #include "link.h" #include "link_rfu.h" @@ -14,6 +16,7 @@ #include "random.h" #include "rom_8034C54.h" #include "save.h" +#include "script.h" #include "sound.h" #include "sprite.h" #include "string_util.h" @@ -63,7 +66,7 @@ struct PokemonJump2 u16 filler10; u16 unk12; u16 unk14; - u8 filler16[0x1c - 0x16]; + u32 unk18; u16 unk1C[5]; u8 txtBuff[2][0x40]; u8 strBuff[0x100]; @@ -75,6 +78,15 @@ struct PokemonJump2 u8 unk81FC[MAX_RFU_PLAYERS]; }; +struct PokemonJump1Sub +{ + u8 unk0; + u8 unk1; + u16 unk2; + u16 unk4; + u32 unk8; +}; + struct PokemonJump1 { MainCallback returnCallback; @@ -123,11 +135,7 @@ struct PokemonJump1 int unk64; int unk68; int unk6C; - u8 unk70; - u8 unk71; - u16 unk72; - u16 unk74; - u32 unk78; + struct PokemonJump1Sub unk70; u8 unk7C[MAX_RFU_PLAYERS]; u8 unk81[MAX_RFU_PLAYERS]; u8 unk86[MAX_RFU_PLAYERS]; @@ -146,19 +154,9 @@ struct PokemonJumpMons u16 unk2; }; -struct Unk802B078 -{ - u8 unk0; - u8 unk1; - u16 unk2; - u16 unk4; - u16 unk6; - int unk8; -}; - static void sub_802AA60(struct PokemonJump1 *); -void sub_802AA94(struct PokemonJump1 *); -void sub_802AB20(void); +static void sub_802AA94(struct PokemonJump1 *); +static void sub_802AB20(void); static void sub_802AB98(void); static s16 sub_802AC00(u16 species); static void sub_802AC2C(struct PokemonJump1_MonInfo *monInfo, struct Pokemon *mon); @@ -232,47 +230,85 @@ static void sub_802CB7C(struct Sprite *sprite); static void sub_802CC40(struct Sprite *sprite); static void sub_802CD08(struct Sprite *sprite); static void sub_802CDD4(struct Sprite *sprite); -void sub_802DC9C(u32); -void sub_802D074(struct PokemonJump2 *); -void sub_802D0BC(struct PokemonJump2 *); -void sub_802D0AC(void); -void sub_802D0C8(int); -bool32 sub_802D0F0(void); -void sub_802D764(void); -bool32 sub_802D788(void); -void sub_802D7E8(u16 itemId, u16 quantity); -void sub_802D884(u16 itemId); -void sub_802D8FC(u16 itemId); -bool32 sub_802D974(void); -void sub_802DA14(void); -void sub_802DC80(int, s8); -void sub_802DD88(u8); -bool32 sub_802DA44(void); -void sub_802DD64(int); -s8 sub_802DA8C(void); -int sub_802DCCC(u8); -void sub_802DD74(u16); -void sub_802DDA0(u8); -int sub_802DDB8(int); -void sub_802DDCC(void); -void sub_802DDE0(void); -void sub_802DDF4(int); -int sub_802DE08(void); -void sub_802E0AC(struct PokemonJump1_MonInfo *); -bool32 sub_802E0D0(int, struct PokemonJump1_MonInfo *); -void sub_802E138(struct PokemonJump1_82E4 *, u8 *); -bool32 sub_802E1BC(struct PokemonJump1_82E4 *, struct Unk802B078 *); -void sub_802E234(struct PokemonJump1_82E4 *, u8 , u16); -bool32 sub_802E264(struct PokemonJump1_82E4 *, int, u8 *, u16 *); -bool32 sub_802E2D0(struct PokemonJump1_82E4 *, int); -int sub_802E354(int, u16, u16); -void sub_802E3A8(void); -void sub_802D12C(u8 taskId); +static void sub_802DC9C(int id); +static void sub_802D074(struct PokemonJump2 *); +static void sub_802D0BC(struct PokemonJump2 *); +static void sub_802D0AC(void); +static void sub_802D0C8(int); +static bool32 sub_802D0F0(void); +static void sub_802D764(void); +static bool32 sub_802D788(void); +static void sub_802D7E8(u16 itemId, u16 quantity); +static void sub_802D884(u16 itemId); +static void sub_802D8FC(u16 itemId); +static bool32 sub_802D974(void); +static void sub_802DA14(void); +static void sub_802DC80(u32 id, s16 y); +static void sub_802DD88(u8 multiplayerId); +static bool32 sub_802DA44(void); +static void sub_802DD64(int); +static s8 sub_802DA8C(void); +static int sub_802DCCC(u8 flags); +static void sub_802DD74(u16); +static void sub_802DDA0(u8 multiplayerId); +static int sub_802DDB8(int multiplayerId); +static void sub_802DDCC(void); +static void sub_802DDE0(void); +static void sub_802DDF4(int); +static int sub_802DE08(void); +static void sub_802E0AC(struct PokemonJump1_MonInfo *arg0); +static bool32 sub_802E0D0(int multiplayerId, struct PokemonJump1_MonInfo *arg0); +static void sub_802E138(struct PokemonJump1_82E4 *arg0, struct PokemonJump1Sub *arg1); +static bool32 sub_802E1BC(struct PokemonJump1_82E4 *arg0, struct PokemonJump1Sub *arg1); +static void sub_802E234(struct PokemonJump1_82E4 *arg0, u8 arg1, u16 arg2); +static bool32 sub_802E264(struct PokemonJump1_82E4 *arg0, int multiplayerId, u8 *arg2, u16 *arg3); +static bool32 sub_802E2D0(struct PokemonJump1_82E4 *arg0, int multiplayerId); +static bool32 sub_802E354(u32 jumpScore, u16 jumpsInRow, u16 excellentsInRow); +static void sub_802E3A8(void); +static void sub_802D12C(u8 taskId); +static void sub_802E00C(u8 arg0); +static void sub_802E090(u8 taskId); +static void sub_802D150(void); +static void sub_802DD08(void); +static void sub_802DB8C(void); +static void sub_802DBF8(void); +static void sub_802DE1C(void); +static void sub_802DFD4(void); +static void sub_802D108(void (*func)(void)); +static void sub_802DF70(bool32 arg0); +static u32 sub_802DA9C(u32 left, u32 top, u32 width, u32 height); +static void sub_802DB18(u16 left, u16 top, u8 cursorPos); +static void sub_802D150(void); +static void sub_802D2E4(void); +static void sub_802D350(void); +static void sub_802D3BC(void); +static void sub_802D448(void); +static void sub_802D4F4(void); +static void sub_802D598(void); +static void sub_802D5E4(void); +static void sub_802D72C(void); +static void sub_802D688(void); +static void sub_802E3E4(u8 taskId); +static void sub_802E6D0(u8 taskId); +static void sub_802EB98(u8 taskId); +static void sub_802E500(u16 windowId, int width); +static void TruncateToFirstWordOnly(u8 *str); +static void sub_802EF50(u16 tileTag, u16 palTag); +static u8 sub_802EFA8(u16 tileTag, u16 palTag, s16 x, s16 y, u8 subpriority); +static void sub_802EFFC(u16 tileTag, u16 palTag, s16 x, s16 y, u8 subpriority, s16 *spriteId1, s16 *spriteId2); +static bool32 sub_802EC98(u8 spriteId); +static bool32 sub_802EE30(u8 spriteId); +static void sub_802EDCC(u8 spriteId1, u8 spriteId2, u8 spriteId3); +static void sub_802EE5C(struct Sprite *sprite); +static void sub_802E83C(u8 taskId); +static void sub_802E8C8(u8 taskId); +static void sub_802EA50(u8 taskId); +static void sub_802EAB0(u8 taskId); -extern struct PokemonJump1 *gUnknown_02022CFC; -extern struct PokemonJump2 *gUnknown_02022D00; +EWRAM_DATA static struct PokemonJump1 *gUnknown_02022CFC = NULL; +EWRAM_DATA static struct PokemonJump2 *gUnknown_02022D00 = NULL; -const struct PokemonJumpMons gPkmnJumpSpecies[] = +static const struct PokemonJumpMons gPkmnJumpSpecies[] = { { .species = SPECIES_BULBASAUR, .unk2 = 2, }, { .species = SPECIES_CHARMANDER, .unk2 = 1, }, @@ -376,65 +412,6 @@ const struct PokemonJumpMons gPkmnJumpSpecies[] = { .species = SPECIES_BAGON, .unk2 = 1, }, }; -bool32 (* const gUnknown_082FB5F4[])(void) = -{ - sub_802B248, - sub_802B2D4, - sub_802B368, - sub_802B3D4, - sub_802B4CC, - sub_802B5C8, - sub_802B664, - sub_802B6B8, - sub_802B720, -}; - -bool32 (* const gUnknown_082FB618[])(void) = -{ - sub_802B29C, - sub_802B31C, - sub_802B3B4, - sub_802B470, - sub_802B568, - sub_802B628, - sub_802B664, - sub_802B704, - sub_802B720, -}; - -extern const u16 gUnknown_082FB63C[]; -extern const u16 gUnknown_082FB64C[4]; -extern const u16 gUnknown_082FB654[]; -extern const s8 gUnknown_082FB65C[][48]; -extern const int gUnknown_082FB6EC[]; -extern const u32 gUnknown_082FB714[][2]; -extern const u16 gUnknown_082FB704[8]; -extern const struct CompressedSpriteSheet gUnknown_082FBE08[5]; -extern const struct SpritePalette gUnknown_082FBE30[2]; -extern const struct SpriteTemplate gUnknown_082FBE40; -extern const struct SpriteTemplate gUnknown_082FC00C; -extern const s16 gUnknown_082FBE58[][10]; -extern const s16 gUnknown_082FBEA8[8]; -extern const struct SpriteTemplate *gUnknown_082FBEB8[4]; -extern const struct BgTemplate gUnknown_082FE164[4]; -extern const struct WindowTemplate gUnknown_082FE174[]; -extern const u16 gPkmnJumpBgPal[]; -extern const u16 gPkmnJumpVenusaurPal[]; -extern const u16 gPkmnJumpResultsPal[]; -extern const u16 gPkmnJumpPal3[]; -extern const u32 gPkmnJumpVenusaurGfx[]; -extern const u32 gPkmnJumpBgTilemap[]; -extern const u32 gPkmnJumpBgGfx[]; -extern const u32 gPkmnJumpVenusaurTilemap[]; -extern const u32 gPkmnJumpResultsGfx[]; -extern const u32 gPkmnJumpResultsTilemap[]; - -struct -{ - int id; - void (*func)(void); -} extern const gUnknown_082FE18C[10]; - void sub_802A9A8(u16 partyIndex, MainCallback callback) { u8 taskId; @@ -470,15 +447,15 @@ static void sub_802AA48(void) static void sub_802AA60(struct PokemonJump1 *arg0) { arg0->unk5 = GetLinkPlayerCount(); - arg0->unk70 = 5; - arg0->unk72 = 0; + arg0->unk70.unk0 = 5; + arg0->unk70.unk2 = 0; sub_802AB20(); sub_802AA94(arg0); if (arg0->unk5 == MAX_RFU_PLAYERS) sub_802E3A8(); } -void sub_802AA94(struct PokemonJump1 *arg0) +static void sub_802AA94(struct PokemonJump1 *arg0) { int i; @@ -499,9 +476,9 @@ void sub_802AA94(struct PokemonJump1 *arg0) arg0->unk46 = 0; arg0->unk49 = 0; arg0->unk48 = 1; - arg0->unk78 = 0; - arg0->unk71 = 0; - arg0->unk74 = 0; + arg0->unk70.unk8 = 0; + arg0->unk70.unk1 = 0; + arg0->unk70.unk4 = 0; arg0->unk60 = 1; arg0->unk4D = 0; arg0->unk68 = 0; @@ -518,7 +495,7 @@ void sub_802AA94(struct PokemonJump1 *arg0) } } -void sub_802AB20(void) +static void sub_802AB20(void) { int i, index; @@ -666,7 +643,7 @@ static void sub_802AE50(u8 arg0) { int i; - gUnknown_02022CFC->unk70 = arg0; + gUnknown_02022CFC->unk70.unk0 = arg0; gUnknown_02022CFC->unk8 = 0; gUnknown_02022CFC->unkA = 0; gUnknown_02022CFC->unk48 = 1; @@ -693,7 +670,7 @@ static void sub_802AEA4(void) gUnknown_02022CFC->unk82E4[i].unk12 = var0; } - if (gUnknown_02022CFC->unk82E4[i].unk18 && gUnknown_02022CFC->unk8B[i] == gUnknown_02022CFC->unk70) + if (gUnknown_02022CFC->unk82E4[i].unk18 && gUnknown_02022CFC->unk8B[i] == gUnknown_02022CFC->unk70.unk0) count++; } @@ -701,6 +678,19 @@ static void sub_802AEA4(void) gUnknown_02022CFC->unk49 = 1; } +static bool32 (* const gUnknown_082FB5F4[])(void) = +{ + sub_802B248, + sub_802B2D4, + sub_802B368, + sub_802B3D4, + sub_802B4CC, + sub_802B5C8, + sub_802B664, + sub_802B6B8, + sub_802B720, +}; + static void sub_802AF80(u8 taskId) { sub_802AEA4(); @@ -713,7 +703,7 @@ static void sub_802AF80(u8 taskId) if (gUnknown_02022CFC->unk48 == 1) { - if (!gUnknown_082FB5F4[gUnknown_02022CFC->unk70]()) + if (!gUnknown_082FB5F4[gUnknown_02022CFC->unk70.unk0]()) { gUnknown_02022CFC->unk48 = 0; gUnknown_02022CFC->unk82E4[gUnknown_02022CFC->unk6].unk18 = 1; @@ -738,7 +728,7 @@ static void sub_802B008(void) static void sub_802B044(u8 arg0) { - gUnknown_02022CFC->unk70 = arg0; + gUnknown_02022CFC->unk70.unk0 = arg0; gUnknown_02022CFC->unk8 = 0; gUnknown_02022CFC->unkA = 0; gUnknown_02022CFC->unk48 = 1; @@ -749,30 +739,30 @@ static void sub_802B078(void) { int i; u16 var0; - struct Unk802B078 sp0; + struct PokemonJump1Sub sp0; var0 = gUnknown_02022CFC->unk82E4[0].unk10; if (sub_802E1BC(gUnknown_02022CFC->unk82E4, &sp0)) { if (gUnknown_02022CFC->unk82E4[gUnknown_02022CFC->unk6].unk18 == 1 - && sp0.unk0 != gUnknown_02022CFC->unk70) + && sp0.unk0 != gUnknown_02022CFC->unk70.unk0) { sub_802B044(sp0.unk0); } - if (gUnknown_02022CFC->unk78 != sp0.unk8) + if (gUnknown_02022CFC->unk70.unk8 != sp0.unk8) { - gUnknown_02022CFC->unk78 = sp0.unk8; + gUnknown_02022CFC->unk70.unk8 = sp0.unk8; gUnknown_02022CFC->unk5C = 1; - gUnknown_02022CFC->unk71 = sp0.unk1; - if (gUnknown_02022CFC->unk71) + gUnknown_02022CFC->unk70.unk1 = sp0.unk1; + if (gUnknown_02022CFC->unk70.unk1) gUnknown_02022CFC->unk4D = 1; else gUnknown_02022CFC->unk4D = 0; } - gUnknown_02022CFC->unk72 = sp0.unk2; - gUnknown_02022CFC->unk74 = sp0.unk4; + gUnknown_02022CFC->unk70.unk2 = sp0.unk2; + gUnknown_02022CFC->unk70.unk4 = sp0.unk4; gUnknown_02022CFC->unk82E4[0].unk12 = var0; } @@ -787,12 +777,25 @@ static void sub_802B078(void) } } +static bool32 (* const gUnknown_082FB618[])(void) = +{ + sub_802B29C, + sub_802B31C, + sub_802B3B4, + sub_802B470, + sub_802B568, + sub_802B628, + sub_802B664, + sub_802B704, + sub_802B720, +}; + static void sub_802B194(u8 taskId) { sub_802B078(); if (gUnknown_02022CFC->unk48) { - if (!gUnknown_082FB618[gUnknown_02022CFC->unk70]()) + if (!gUnknown_082FB618[gUnknown_02022CFC->unk70.unk0]()) { gUnknown_02022CFC->unk48 = 0; gUnknown_02022CFC->unk82E4[gUnknown_02022CFC->unk6].unk18 = 1; @@ -807,7 +810,7 @@ static void sub_802B194(u8 taskId) static void sub_802B1FC(void) { if (!gUnknown_02022CFC->unk2C) - sub_802E234(&gUnknown_02022CFC->unk82E4[gUnknown_02022CFC->unk6], gUnknown_02022CFC->unk70, gUnknown_02022CFC->unk42); + sub_802E234(&gUnknown_02022CFC->unk82E4[gUnknown_02022CFC->unk6], gUnknown_02022CFC->unk70.unk0, gUnknown_02022CFC->unk42); if (gUnknown_02022CFC->unk30 != 0x1111) { @@ -827,7 +830,7 @@ static bool32 sub_802B248(void) case 1: if (!sub_802B7E0()) { - gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unk4A; + gUnknown_02022CFC->unk70.unk2 = gUnknown_02022CFC->unk4A; gUnknown_02022CFC->unk4C = 1; return FALSE; } @@ -843,7 +846,7 @@ static bool32 sub_802B29C(void) { case 0: sub_802AE14(0); - gUnknown_02022CFC->unk24 = gUnknown_02022CFC->unk72; + gUnknown_02022CFC->unk24 = gUnknown_02022CFC->unk70.unk2; gUnknown_02022CFC->unk8++; // fall through case 1: @@ -881,7 +884,7 @@ static bool32 sub_802B31C(void) case 0: sub_802C0E8(); sub_802AE14(0); - gUnknown_02022CFC->unk4A = gUnknown_02022CFC->unk72; + gUnknown_02022CFC->unk4A = gUnknown_02022CFC->unk70.unk2; gUnknown_02022CFC->unk8++; // fall through case 1: @@ -897,7 +900,7 @@ static bool32 sub_802B368(void) { if (!sub_802B8CC()) { - gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unk4A; + gUnknown_02022CFC->unk70.unk2 = gUnknown_02022CFC->unk4A; gUnknown_02022CFC->unk4C = 1; } else if (sub_802C538()) @@ -939,17 +942,17 @@ static bool32 sub_802B3D4(void) { if (sub_802C7BC()) { - gUnknown_02022CFC->unk72 = sub_802C7E0(); + gUnknown_02022CFC->unk70.unk2 = sub_802C7E0(); gUnknown_02022CFC->unk4C = 7; } - else if (gUnknown_02022CFC->unk74 >= 200) + else if (gUnknown_02022CFC->unk70.unk4 >= 200) { - gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unkE; + gUnknown_02022CFC->unk70.unk2 = gUnknown_02022CFC->unkE; gUnknown_02022CFC->unk4C = 8; } else { - gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unkE; + gUnknown_02022CFC->unk70.unk2 = gUnknown_02022CFC->unkE; gUnknown_02022CFC->unk4C = 4; } @@ -999,7 +1002,7 @@ static bool32 sub_802B4CC(void) case 1: if (!sub_802BB84()) { - sub_802E354(gUnknown_02022CFC->unk78, gUnknown_02022CFC->unk74, gUnknown_02022CFC->unk72); + sub_802E354(gUnknown_02022CFC->unk70.unk8, gUnknown_02022CFC->unk70.unk4, gUnknown_02022CFC->unk70.unk2); gUnknown_02022CFC->unk8++; } break; @@ -1033,7 +1036,7 @@ static bool32 sub_802B568(void) case 1: if (!sub_802BB84()) { - sub_802E354(gUnknown_02022CFC->unk78, gUnknown_02022CFC->unk74, gUnknown_02022CFC->unk72); + sub_802E354(gUnknown_02022CFC->unk70.unk8, gUnknown_02022CFC->unk70.unk4, gUnknown_02022CFC->unk70.unk2); gUnknown_02022CFC->unk42 = gUnknown_02022CFC->unk45; return FALSE; } @@ -1056,7 +1059,7 @@ static bool32 sub_802B5C8(void) { sub_802AA94(gUnknown_02022CFC); gUnknown_02022CFC->unk24 = Random(); - gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unk24; + gUnknown_02022CFC->unk70.unk2 = gUnknown_02022CFC->unk24; gUnknown_02022CFC->unk4C = 0; return FALSE; } @@ -1119,7 +1122,7 @@ static bool32 sub_802B6B8(void) case 1: if (!sub_802BA58()) { - gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unkE; + gUnknown_02022CFC->unk70.unk2 = gUnknown_02022CFC->unkE; gUnknown_02022CFC->unk4C = 8; return FALSE; } @@ -1143,7 +1146,7 @@ static bool32 sub_802B720(void) switch (gUnknown_02022CFC->unk8) { case 0: - sub_802E354(gUnknown_02022CFC->unk78, gUnknown_02022CFC->unk74, gUnknown_02022CFC->unk72); + sub_802E354(gUnknown_02022CFC->unk70.unk8, gUnknown_02022CFC->unk70.unk4, gUnknown_02022CFC->unk70.unk2); sub_802D0C8(5); gUnknown_02022CFC->unk8++; break; @@ -1312,7 +1315,7 @@ static bool32 sub_802B964(void) if (!sub_802D0F0()) { sub_802DDCC(); - gUnknown_02022CFC->unk71 = 0; + gUnknown_02022CFC->unk70.unk1 = 0; sub_802C114(); gUnknown_02022CFC->unkA++; return FALSE; @@ -1330,7 +1333,7 @@ static bool32 sub_802BA58(void) switch (gUnknown_02022CFC->unkA) { case 0: - sub_802C808(gUnknown_02022CFC->unk72, &gUnknown_02022CFC->unk3E, &gUnknown_02022CFC->unk40); + sub_802C808(gUnknown_02022CFC->unk70.unk2, &gUnknown_02022CFC->unk3E, &gUnknown_02022CFC->unk40); sub_802D7E8(gUnknown_02022CFC->unk3E, gUnknown_02022CFC->unk40); gUnknown_02022CFC->unkA++; break; @@ -1610,6 +1613,9 @@ static int sub_802BF48(void) return result; } +static const u16 gUnknown_082FB63C[] = {0x1a, 0x1f, 0x24, 0x29, 0x2e, 0x33, 0x38, 0x3d}; +static const u16 gUnknown_082FB64C[] = {0, 1, 1, 2}; + static void sub_802BF7C(void) { int var0; @@ -1728,21 +1734,23 @@ static void sub_802C1BC(void) gUnknown_02022CFC->unk83AC->unk10 = 0; } +static const u16 gUnknown_082FB654[] = {SE_REGI, SE_REAPOKE, SE_W234, SE_RG_EXCELLENT}; + static void sub_802C1DC(void) { if (gUnknown_02022CFC->unk5C) { - sub_802DD64(gUnknown_02022CFC->unk78); + sub_802DD64(gUnknown_02022CFC->unk70.unk8); gUnknown_02022CFC->unk5C = 0; if (gUnknown_02022CFC->unk4D) { - int index = sub_802DCCC(gUnknown_02022CFC->unk71); + int index = sub_802DCCC(gUnknown_02022CFC->unk70.unk1); PlaySE(gUnknown_082FB654[index - 2]); gUnknown_02022CFC->unk4D = 0; } } - sub_802DD74(gUnknown_02022CFC->unk74); + sub_802DD74(gUnknown_02022CFC->unk70.unk4); sub_802C280(); sub_802C240(); } @@ -1808,6 +1816,19 @@ static void sub_802C280(void) PlaySE(SE_DANSA); } +static const s8 gUnknown_082FB65C[][48] = +{ + {-3, -6, -8, -10, -13, -15, -17, -19, -21, -23, -25, -27, -28, -29, -30, -30, -30, -28, -27, + -26, -25, -23, -22, -20, -18, -17, -15, -13, -11, -8, -6, -4, -1}, + + {-3, -6, -9, -11, -14, -16, -18, -20, -22, -24, -26, -28, -29, -30, -30, -28, -26, -24, -22, + -20, -18, -16, -14, -11, -9, -6, -4, -1}, + + {-3, -6, -9, -11, -13, -15, -17, -19, -21, -23, -25, -27, -28, -29, -30, -30, -30, -30, -29, + -29, -28, -28, -27, -27, -26, -25, -24, -22, -20, -18, -16, -14, + -12, -11, -9, -6, -4, -1}, +}; + static void sub_802C398(int multiplayerId) { int var0; @@ -1860,7 +1881,7 @@ static void sub_802C43C(void) sub_802C780(); gUnknown_02022CFC->unk54 = 0; gUnknown_02022CFC->unk58 = 1; - gUnknown_02022CFC->unk71 = 0; + gUnknown_02022CFC->unk70.unk1 = 0; } else { @@ -1883,9 +1904,9 @@ static void sub_802C43C(void) sub_802C780(); gUnknown_02022CFC->unk54 = 0; gUnknown_02022CFC->unk58 = 1; - gUnknown_02022CFC->unk71 = 0; - if (gUnknown_02022CFC->unk74 < 9999) - gUnknown_02022CFC->unk74++; + gUnknown_02022CFC->unk70.unk1 = 0; + if (gUnknown_02022CFC->unk70.unk4 < 9999) + gUnknown_02022CFC->unk70.unk4++; sub_802C688(10); sub_802AE14(3); @@ -1989,10 +2010,10 @@ static bool32 sub_802C650(void) static void sub_802C688(int arg0) { - gUnknown_02022CFC->unk78 += arg0; + gUnknown_02022CFC->unk70.unk8 += arg0; gUnknown_02022CFC->unk5C = 1; - if (gUnknown_02022CFC->unk78 >= 99990) - gUnknown_02022CFC->unk78 = 99990; + if (gUnknown_02022CFC->unk70.unk8 >= 99990) + gUnknown_02022CFC->unk70.unk8 = 99990; } static int sub_802C6B0(void) @@ -2037,7 +2058,7 @@ static int sub_802C73C(u8 *arg0) } } - gUnknown_02022CFC->unk71 = flags; + gUnknown_02022CFC->unk70.unk1 = flags; if (flags) gUnknown_02022CFC->unk4D = 1; @@ -2049,6 +2070,8 @@ static void sub_802C780(void) gUnknown_02022CFC->unk44 = 0; } +static const int gUnknown_082FB6EC[] = {0, 0, 0x32, 0x64, 0xc8, 0x1f4}; + static int sub_802C790(int arg0) { return gUnknown_082FB6EC[arg0]; @@ -2060,9 +2083,19 @@ static void sub_802C7A0(u16 arg0) gUnknown_02022CFC->unkE = arg0; } +static const u16 gUnknown_082FB704[] = {0x8a, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93}; +static const u32 gUnknown_082FB714[][2] = +{ + {0x1388, 1}, + {0x1f40, 2}, + {0x2ee0, 3}, + {0x3e80, 4}, + {0x4e20, 5}, +}; + static bool32 sub_802C7BC(void) { - if (gUnknown_02022CFC->unk78 >= gUnknown_082FB714[0][0]) + if (gUnknown_02022CFC->unk70.unk8 >= gUnknown_082FB714[0][0]) return TRUE; else return FALSE; @@ -2096,7 +2129,7 @@ static u16 sub_802C838(void) val = 0; for (i = 0; i < 5; val = gUnknown_082FB714[i][1], i++) { - if (gUnknown_02022CFC->unk78 < gUnknown_082FB714[i][0]) + if (gUnknown_02022CFC->unk70.unk8 < gUnknown_082FB714[i][0]) break; } @@ -2151,22 +2184,22 @@ static u16 sub_802C880(u16 item, u16 quantity) return quantity; } -u16 sub_802C8AC(void) +static u16 sub_802C8AC(void) { return GetLinkPlayerCount(); } -u16 sub_802C8BC(void) +static u16 sub_802C8BC(void) { return gUnknown_02022CFC->unk6; } -struct PokemonJump1_MonInfo *sub_802C8C8(u8 multiplayerId) +static struct PokemonJump1_MonInfo *sub_802C8C8(u8 multiplayerId) { return &gUnknown_02022CFC->unk82A8[multiplayerId]; } -u8 *sub_802C8E8(u8 multiplayerId) +static u8 *sub_802C8E8(u8 multiplayerId) { return gUnknown_02022CFC->unk82E4[multiplayerId].unk1C; } @@ -2196,7 +2229,325 @@ void sub_802C920(void) gSpecialVar_Result = 0; } -void sub_802C974(struct PokemonJump2 *arg0) +// Large group of data. +static const u16 gPkmnJumpPal1[] = INCBIN_U16("graphics/link_games/pkmnjump_pal1.gbapal"); +static const u16 gPkmnJumpPal2[] = INCBIN_U16("graphics/link_games/pkmnjump_pal2.gbapal"); + +static const u32 gPkmnJumpRopeGfx1[] = INCBIN_U32("graphics/link_games/pkmnjump_rope1.4bpp.lz"); +static const u32 gPkmnJumpRopeGfx2[] = INCBIN_U32("graphics/link_games/pkmnjump_rope2.4bpp.lz"); +static const u32 gPkmnJumpRopeGfx3[] = INCBIN_U32("graphics/link_games/pkmnjump_rope3.4bpp.lz"); +static const u32 gPkmnJumpRopeGfx4[] = INCBIN_U32("graphics/link_games/pkmnjump_rope4.4bpp.lz"); + +static const u32 gPkmnJumpStarGfx[] = INCBIN_U32("graphics/link_games/pkmnjump_star.4bpp.lz"); + +static const struct CompressedSpriteSheet gUnknown_082FBE08[] = +{ + {gPkmnJumpRopeGfx1, 0x600, 5}, + {gPkmnJumpRopeGfx2, 0x0c00, 6}, + {gPkmnJumpRopeGfx3, 0x0600, 7}, + {gPkmnJumpRopeGfx4, 0x0600, 8}, + {gPkmnJumpStarGfx, 0x0200, 10}, +}; + +static const struct SpritePalette gUnknown_082FBE30[] = +{ + {gPkmnJumpPal1, 5}, + {gPkmnJumpPal2, 6}, +}; + +// Forward declarations. +static const struct OamData sOamData_82FBEC8; +static const struct SpriteTemplate gUnknown_082FBF78; +static const struct SpriteTemplate gUnknown_082FBF90; +static const struct SpriteTemplate gUnknown_082FBFA8; +static const struct SpriteTemplate gUnknown_082FBFC0; + +static const struct SpriteTemplate gUnknown_082FBE40 = +{ + .tileTag = 0, + .paletteTag = 0, + .oam = &sOamData_82FBEC8, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const s16 gUnknown_082FBE58[][10] = +{ + {0x60, 0x60, 0x60, 0x72, 0x78, 0x78, 0x78, 0x72, 0x60, 0x60}, + {0x46, 0x50, 0x60, 0x72, 0x78, 0x80, 0x78, 0x72, 0x60, 0x50}, + {0x32, 0x48, 0x60, 0x72, 0x80, 0x88, 0x80, 0x72, 0x60, 0x48}, + {0x2a, 0x48, 0x60, 0x72, 0x80, 0x88, 0x80, 0x72, 0x60, 0x48}, +}; + +static const s16 gUnknown_082FBEA8[] = {0x10, 0x28, 0x48, 0x68, 0x88, 0xa8, 0xc8, 0xe0}; + +static const struct SpriteTemplate *const gUnknown_082FBEB8[] = +{ + &gUnknown_082FBF78, + &gUnknown_082FBF90, + &gUnknown_082FBFA8, + &gUnknown_082FBFC0, +}; + +static const struct OamData sOamData_82FBEC8 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct OamData sOamData_82FBED0 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 2, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct OamData sOamData_82FBED8 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct OamData sOamData_82FBEE0 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AnimCmd sSpriteAnim_82FBEE8[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBEF0[] = +{ + ANIMCMD_FRAME(8, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBEF8[] = +{ + ANIMCMD_FRAME(16, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBF00[] = +{ + ANIMCMD_FRAME(24, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBF08[] = +{ + ANIMCMD_FRAME(32, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBF10[] = +{ + ANIMCMD_FRAME(40, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBF18[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBF20[] = +{ + ANIMCMD_FRAME(16, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBF28[] = +{ + ANIMCMD_FRAME(32, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBF30[] = +{ + ANIMCMD_FRAME(48, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBF38[] = +{ + ANIMCMD_FRAME(64, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBF40[] = +{ + ANIMCMD_FRAME(80, 1), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_82FBF48[] = +{ + sSpriteAnim_82FBEE8, + sSpriteAnim_82FBEF0, + sSpriteAnim_82FBEF8, + sSpriteAnim_82FBF00, + sSpriteAnim_82FBF08, + sSpriteAnim_82FBF10 +}; + +static const union AnimCmd *const sSpriteAnimTable_82FBF60[] = +{ + sSpriteAnim_82FBF18, + sSpriteAnim_82FBF20, + sSpriteAnim_82FBF28, + sSpriteAnim_82FBF30, + sSpriteAnim_82FBF38, + sSpriteAnim_82FBF40 +}; + +static const struct SpriteTemplate gUnknown_082FBF78 = +{ + .tileTag = 5, + .paletteTag = 5, + .oam = &sOamData_82FBED0, + .anims = sSpriteAnimTable_82FBF48, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct SpriteTemplate gUnknown_082FBF90 = +{ + .tileTag = 6, + .paletteTag = 5, + .oam = &sOamData_82FBED8, + .anims = sSpriteAnimTable_82FBF60, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct SpriteTemplate gUnknown_082FBFA8 = +{ + .tileTag = 7, + .paletteTag = 5, + .oam = &sOamData_82FBEE0, + .anims = sSpriteAnimTable_82FBF48, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct SpriteTemplate gUnknown_082FBFC0 = +{ + .tileTag = 8, + .paletteTag = 5, + .oam = &sOamData_82FBEE0, + .anims = sSpriteAnimTable_82FBF48, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct OamData sOamData_82FBFD8 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AnimCmd sSpriteAnim_82FBFE0[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FBFE8[] = +{ + ANIMCMD_FRAME(0, 4), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(8, 4), + ANIMCMD_FRAME(12, 4), + ANIMCMD_LOOP(1), + ANIMCMD_FRAME(0, 4), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_82FC004[] = +{ + sSpriteAnim_82FBFE0, + sSpriteAnim_82FBFE8 +}; + +static const struct SpriteTemplate gUnknown_082FC00C = +{ + .tileTag = 10, + .paletteTag = 5, + .oam = &sOamData_82FBFD8, + .anims = sSpriteAnimTable_82FC004, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +// Back to code +static void sub_802C974(struct PokemonJump2 *arg0) { int i; @@ -2217,7 +2568,7 @@ static void sub_802C9BC(struct Sprite *sprite) sprite->data[i] = 0; } -void sub_802C9D4(struct PokemonJump2 *arg0, struct PokemonJump1_MonInfo *jumpMon, u16 x, u16 y, u8 multiplayerId) +static void sub_802C9D4(struct PokemonJump2 *arg0, struct PokemonJump1_MonInfo *jumpMon, s16 x, s16 y, u8 multiplayerId) { struct SpriteTemplate spriteTemplate; struct SpriteSheet spriteSheet; @@ -2248,7 +2599,7 @@ void sub_802C9D4(struct PokemonJump2 *arg0, struct PokemonJump1_MonInfo *jumpMon spriteSheet.size = 0x800; LoadSpriteSheet(&spriteSheet); - spritePalette.data = GetFrontSpritePalFromSpeciesAndPersonality(jumpMon->species, jumpMon->otId, jumpMon->personality); + spritePalette.data = GetMonSpritePalFromSpeciesAndPersonality(jumpMon->species, jumpMon->otId, jumpMon->personality); spritePalette.tag = multiplayerId; LoadCompressedSpritePalette(&spritePalette); @@ -2269,7 +2620,7 @@ void sub_802C9D4(struct PokemonJump2 *arg0, struct PokemonJump1_MonInfo *jumpMon arg0->unk81A8[multiplayerId] = NULL; } -void sub_802CB14(struct PokemonJump2 *arg0, int multiplayerId) +static void sub_802CB14(struct PokemonJump2 *arg0, int multiplayerId) { sub_802C9BC(arg0->unk81BC[multiplayerId]); arg0->unk81BC[multiplayerId]->data[7] = arg0->unk81A8[multiplayerId] - gSprites; @@ -2309,14 +2660,14 @@ static void sub_802CB7C(struct Sprite *sprite) } } -void sub_802CBF0(struct PokemonJump2 *arg0, int multiplayerId) +static void sub_802CBF0(struct PokemonJump2 *arg0, int multiplayerId) { arg0->unk81A8[multiplayerId]->callback = sub_802CC40; arg0->unk81A8[multiplayerId]->pos2.y = 0; sub_802C9BC(arg0->unk81A8[multiplayerId]); } -bool32 sub_802CC18(struct PokemonJump2 *arg0, int multiplayerId) +static bool32 sub_802CC18(struct PokemonJump2 *arg0, int multiplayerId) { return arg0->unk81A8[multiplayerId]->callback == sub_802CC40; } @@ -2340,13 +2691,13 @@ static void sub_802CC40(struct Sprite *sprite) } } -void sub_802CC88(struct PokemonJump2 *arg0, int multiplayerId) +static void sub_802CC88(struct PokemonJump2 *arg0, int multiplayerId) { sub_802C9BC(arg0->unk81A8[multiplayerId]); arg0->unk81A8[multiplayerId]->callback = sub_802CD08; } -void sub_802CCB0(struct PokemonJump2 *arg0) +static void sub_802CCB0(struct PokemonJump2 *arg0) { int i; u16 numPlayers = sub_802C8AC(); @@ -2370,7 +2721,7 @@ static void sub_802CD08(struct Sprite *sprite) } } -void sub_802CD3C(struct PokemonJump2 *arg0) +static void sub_802CD3C(struct PokemonJump2 *arg0) { int i; u16 numPlayers = sub_802C8AC(); @@ -2378,13 +2729,13 @@ void sub_802CD3C(struct PokemonJump2 *arg0) arg0->unk81A8[i]->subpriority = arg0->unk81FC[i]; } -void sub_802CD70(struct PokemonJump2 *arg0, int multiplayerId) +static void sub_802CD70(struct PokemonJump2 *arg0, int multiplayerId) { sub_802C9BC(arg0->unk81A8[multiplayerId]); arg0->unk81A8[multiplayerId]->callback = sub_802CDD4; } -bool32 sub_802CD98(struct PokemonJump2 *arg0) +static bool32 sub_802CD98(struct PokemonJump2 *arg0) { int i; u16 numPlayers = sub_802C8AC(); @@ -2423,7 +2774,7 @@ static void sub_802CDD4(struct Sprite *sprite) } } -void sub_802CE48(struct PokemonJump2 *arg0, s16 x, s16 y, u8 multiplayerId) +static void sub_802CE48(struct PokemonJump2 *arg0, s16 x, s16 y, u8 multiplayerId) { u8 spriteId = CreateSprite(&gUnknown_082FC00C, x, y, 1); if (spriteId != MAX_SPRITES) @@ -2433,7 +2784,7 @@ void sub_802CE48(struct PokemonJump2 *arg0, s16 x, s16 y, u8 multiplayerId) } } -void sub_802CE9C(struct PokemonJump2 *arg0) +static void sub_802CE9C(struct PokemonJump2 *arg0) { int i; int count; @@ -2456,7 +2807,7 @@ void sub_802CE9C(struct PokemonJump2 *arg0) } } -void sub_802CF50(struct PokemonJump2 *arg0, int arg1) +static void sub_802CF50(struct PokemonJump2 *arg0, int arg1) { int i, count, palNum; int priority; @@ -2493,29 +2844,18 @@ void sub_802CF50(struct PokemonJump2 *arg0, int arg1) } } -void sub_802D044(struct PokemonJump2 *arg0) +static void sub_802D044(struct PokemonJump2 *arg0) { sub_802EB24(9, 7, 120, 80, 0); sub_802CD3C(arg0); } -bool32 sub_802D068(void) +static bool32 sub_802D068(void) { return sub_802EB84(); } -void sub_802D150(void); -void sub_802DD08(void); -void sub_802DB8C(void); -void sub_802DBF8(void); -void sub_802DE1C(void); -void sub_802DFD4(void); -void sub_802D108(void (*func)(void)); -void sub_802DF70(int arg0); -u32 sub_802DA9C(u8 arg0, u8 arg1, u8 arg2, u8 arg3); -void sub_802DB18(u8 arg0, u8 arg1, u8 arg2); - -void sub_802D074(struct PokemonJump2 *arg0) +static void sub_802D074(struct PokemonJump2 *arg0) { u8 taskId; @@ -2527,20 +2867,116 @@ void sub_802D074(struct PokemonJump2 *arg0) sub_802D108(sub_802D150); } -void sub_802D0AC(void) +static void sub_802D0AC(void) { FreeAllWindowBuffers(); sub_8034CC8(); } -void sub_802D0BC(struct PokemonJump2 *arg0) +static void sub_802D0BC(struct PokemonJump2 *arg0) { arg0->unk4 = 0; arg0->unk0 = 0; arg0->unk12 = 0xFF; } -void sub_802D0C8(int arg0) +// Gfx +static const u16 gPkmnJumpPal3[] = INCBIN_U16("graphics/link_games/pkmnjump_pal3.gbapal"); + +static const u16 gPkmnJumpBgPal[] = INCBIN_U16("graphics/link_games/pkmnjump_bg.gbapal"); +static const u32 gPkmnJumpBgGfx[] = INCBIN_U32("graphics/link_games/pkmnjump_bg.4bpp.lz"); +static const u32 gPkmnJumpBgTilemap[] = INCBIN_U32("graphics/link_games/pkmnjump_bg.bin.lz"); + +static const u16 gPkmnJumpVenusaurPal[] = INCBIN_U16("graphics/link_games/pkmnjump_venusaur.gbapal"); +static const u32 gPkmnJumpVenusaurGfx[] = INCBIN_U32("graphics/link_games/pkmnjump_venusaur.4bpp.lz"); +static const u32 gPkmnJumpVenusaurTilemap[] = INCBIN_U32("graphics/link_games/pkmnjump_venusaur.bin.lz"); + +static const u16 gPkmnJumpResultsPal[] = INCBIN_U16("graphics/link_games/pkmnjump_results.gbapal"); +static const u32 gPkmnJumpResultsGfx[] = INCBIN_U32("graphics/link_games/pkmnjump_results.4bpp.lz"); +static const u32 gPkmnJumpResultsTilemap[] = INCBIN_U32("graphics/link_games/pkmnjump_results.bin.lz"); + +static const struct BgTemplate gUnknown_082FE164[] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 27, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 1, + .mapBaseIndex = 30, + .screenSize = 2, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 2, + .mapBaseIndex = 12, + .screenSize = 3, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 3, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + }, +}; + +static const struct WindowTemplate gUnknown_082FE174[] = +{ + { + .bg = 0, + .tilemapLeft = 19, + .tilemapTop = 0, + .width = 6, + .height = 2, + .paletteNum = 2, + .baseBlock = 0x13, + }, + { + .bg = 0, + .tilemapLeft = 8, + .tilemapTop = 0, + .width = 6, + .height = 2, + .paletteNum = 2, + .baseBlock = 0x1F, + }, + DUMMY_WIN_TEMPLATE, +}; + +struct +{ + int id; + void (*func)(void); +} static const gUnknown_082FE18C[] = +{ + {0x00, sub_802D150}, + {0x01, sub_802D2E4}, + {0x02, sub_802D350}, + {0x03, sub_802D3BC}, + {0x04, sub_802D448}, + {0x05, sub_802D4F4}, + {0x06, sub_802D598}, + {0x07, sub_802D5E4}, + {0x09, sub_802D72C}, + {0x08, sub_802D688}, +}; + +static void sub_802D0C8(int arg0) { int i; @@ -2551,19 +2987,19 @@ void sub_802D0C8(int arg0) } } -bool32 sub_802D0F0(void) +static bool32 sub_802D0F0(void) { return (gUnknown_02022D00->unk0 != 1); } -void sub_802D108(void (*func)(void)) +static void sub_802D108(void (*func)(void)) { SetWordTaskArg(gUnknown_02022D00->unk6, 0, (u32) func); gUnknown_02022D00->unk4 = 0; gUnknown_02022D00->unk0 = 0; } -void sub_802D12C(u8 taskId) +static void sub_802D12C(u8 taskId) { if (!gUnknown_02022D00->unk0) { @@ -2573,7 +3009,7 @@ void sub_802D12C(u8 taskId) } } -void sub_802D150(void) +static void sub_802D150(void) { switch (gUnknown_02022D00->unk4) { @@ -2624,7 +3060,7 @@ void sub_802D150(void) } } -void sub_802D2E4(void) +static void sub_802D2E4(void) { switch (gUnknown_02022D00->unk4) { @@ -2635,7 +3071,7 @@ void sub_802D2E4(void) case 1: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_802DF70(0); + sub_802DF70(FALSE); gUnknown_02022D00->unk4++; } break; @@ -2653,7 +3089,7 @@ void sub_802D2E4(void) } } -void sub_802D350(void) +static void sub_802D350(void) { switch (gUnknown_02022D00->unk4) { @@ -2664,7 +3100,7 @@ void sub_802D350(void) case 1: if (!IsDma3ManagerBusyWithBgCopy()) { - sub_802DF70(1); + sub_802DF70(TRUE); gUnknown_02022D00->unk4++; } break; @@ -2682,7 +3118,7 @@ void sub_802D350(void) } } -void sub_802D3BC(void) +static void sub_802D3BC(void) { int i, numPlayers; @@ -2708,7 +3144,7 @@ void sub_802D3BC(void) } } -void sub_802D448(void) +static void sub_802D448(void) { switch (gUnknown_02022D00->unk4) { @@ -2735,7 +3171,7 @@ void sub_802D448(void) } } -void sub_802D4F4(void) +static void sub_802D4F4(void) { switch (gUnknown_02022D00->unk4) { @@ -2761,7 +3197,7 @@ void sub_802D4F4(void) } } -void sub_802D598(void) +static void sub_802D598(void) { switch (gUnknown_02022D00->unk4) { @@ -2778,7 +3214,7 @@ void sub_802D598(void) } } -void sub_802D5E4(void) +static void sub_802D5E4(void) { switch (gUnknown_02022D00->unk4) { @@ -2804,7 +3240,7 @@ void sub_802D5E4(void) } } -void sub_802D688(void) +static void sub_802D688(void) { switch (gUnknown_02022D00->unk4) { @@ -2830,7 +3266,7 @@ void sub_802D688(void) } } -void sub_802D72C(void) +static void sub_802D72C(void) { switch (gUnknown_02022D00->unk4) { @@ -2845,7 +3281,7 @@ void sub_802D72C(void) } } -void sub_802D764(void) +static void sub_802D764(void) { gUnknown_02022D00->unkA = 0; gUnknown_02022D00->unkB = 0; @@ -2853,7 +3289,7 @@ void sub_802D764(void) sub_802DC9C(gUnknown_02022D00->unkC); } -bool32 sub_802D788(void) +static bool32 sub_802D788(void) { switch (gUnknown_02022D00->unkA) { @@ -2879,7 +3315,7 @@ bool32 sub_802D788(void) return TRUE; } -void sub_802D7E8(u16 itemId, u16 quantity) +static void sub_802D7E8(u16 itemId, u16 quantity) { CopyItemNameHandlePlural(itemId, gUnknown_02022D00->txtBuff[0], quantity); ConvertIntToDecimalStringN(gUnknown_02022D00->txtBuff[1], quantity, STR_CONV_MODE_LEFT_ALIGN, 1); @@ -2894,7 +3330,7 @@ void sub_802D7E8(u16 itemId, u16 quantity) gUnknown_02022D00->unkD = 0; } -void sub_802D884(u16 itemId) +static void sub_802D884(u16 itemId) { CopyItemName(itemId, gUnknown_02022D00->txtBuff[0]); DynamicPlaceholderTextUtil_Reset(); @@ -2907,7 +3343,7 @@ void sub_802D884(u16 itemId) gUnknown_02022D00->unkD = 0; } -void sub_802D8FC(u16 itemId) +static void sub_802D8FC(u16 itemId) { CopyItemName(itemId, gUnknown_02022D00->txtBuff[0]); DynamicPlaceholderTextUtil_Reset(); @@ -2920,7 +3356,7 @@ void sub_802D8FC(u16 itemId) gUnknown_02022D00->unkD = 0; } -bool32 sub_802D974(void) +static bool32 sub_802D974(void) { switch (gUnknown_02022D00->unkD) { @@ -2954,7 +3390,7 @@ bool32 sub_802D974(void) return TRUE; } -void sub_802DA14(void) +static void sub_802DA14(void) { if (gUnknown_02022D00->unk12 != 0xFF) { @@ -2964,12 +3400,14 @@ void sub_802DA14(void) } } -// Can't match this -/* -bool32 sub_802DA44(void) +// Can't match this without the ugly GOTO, oh well. +static bool32 sub_802DA44(void) { if (gUnknown_02022D00->unk12 == 0xFF) + { + RET_FALSE: return FALSE; + } if (gUnknown_02022D00->unkD == 0) { @@ -2978,12 +3416,1221 @@ bool32 sub_802DA44(void) RemoveWindow(gUnknown_02022D00->unk12); gUnknown_02022D00->unk12 = 0xFF; gUnknown_02022D00->unkD++; - return FALSE; + goto RET_FALSE; } } else if (gUnknown_02022D00->unkD == 1) - return FALSE; + goto RET_FALSE; return TRUE; } -*/ + +static s8 sub_802DA8C(void) +{ + return Menu_ProcessInputNoWrapClearOnChoose(); +} + +static u32 sub_802DA9C(u32 left, u32 top, u32 width, u32 height) +{ + u32 windowId; + struct WindowTemplate window; + + window.bg = 0; + window.tilemapLeft = left; + window.tilemapTop = top; + window.width = width; + window.height = height; + window.paletteNum = 0xF; + window.baseBlock = 0x43; + + windowId = AddWindow(&window); + FillWindowPixelBuffer(windowId, 0x11); + return windowId; +} + +static void sub_802DB18(u16 left, u16 top, u8 cursorPos) +{ + struct WindowTemplate window; + u8 a = cursorPos; + + window.bg = 0; + window.tilemapLeft = left; + window.tilemapTop = top; + window.width = 6; + window.height = 4; + window.paletteNum = 2; + window.baseBlock = 0x2B; + + CreateYesNoMenu(&window, 1, 0xD, a); +} + +static void sub_802DB8C(void) +{ + u8 color[] = {0, 2, 3}; + + PutWindowTilemap(0); + PutWindowTilemap(1); + FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(1, 0); + AddTextPrinterParameterized3(0, 0, 0, 1, color, 0, gText_SpacePoints2); + AddTextPrinterParameterized3(1, 0, 0, 1, color, 0, gText_SpaceTimes3); +} + +static const u8 gUnknown_082FE1DF[] = {2, 2, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0}; + +static const struct CompressedSpriteSheet gUnknown_082FE1EC = {gUnknown_082FF1F8, 0, 0x320}; +static const struct SpritePalette gUnknown_082FE1F4 = {gUnknown_082FF1D8, 0x320}; + +static const u16 gUnknown_082FE1FC[] = {0x06, 0x08, 0x10, 0x08}; +static const u16 gUnknown_082FE204[] = {0x06, 0x08, 0x0b, 0x06, 0x10, 0x08}; +static const u16 gUnknown_082FE210[] = {0x02, 0x06, 0x06, 0x08, 0x10, 0x08, 0x14, 0x06}; +static const u16 gUnknown_082FE220[] = {0x02, 0x06, 0x06, 0x08, 0x0b, 0x06, 0x10, 0x08, 0x14, 0x06}; + +static const u16 *const gUnknown_082FE234[] = +{ + gUnknown_082FE1FC, + gUnknown_082FE204, + gUnknown_082FE210, + gUnknown_082FE220, +}; + +static const s16 gUnknown_082FE244[] = {0x0058, 0x0098}; +static const s16 gUnknown_082FE248[] = {0x0058, 0x0078, 0x0098}; +static const s16 gUnknown_082FE24E[] = {0x0038, 0x0058, 0x0098, 0x00b8}; +static const s16 gUnknown_082FE256[] = {0x0038, 0x0058, 0x0078, 0x0098, 0x00b8}; + +static const s16 *const gUnknown_082FE260[] = +{ + gUnknown_082FE244, + gUnknown_082FE248, + gUnknown_082FE24E, + gUnknown_082FE256, +}; + +static void sub_802DBF8(void) +{ + int i, y, playersCount = sub_802C8AC(); + const s16 *xCoords = gUnknown_082FE260[playersCount - 2]; + + for (i = 0; i < playersCount; i++) + { + struct PokemonJump1_MonInfo *info = sub_802C8C8(i); + + y = gMonFrontPicCoords[info->species].y_offset; + sub_802C9D4(gUnknown_02022D00, info, *xCoords, y + 112, i); + sub_802CE48(gUnknown_02022D00, *xCoords, 112, i); + xCoords++; + } +} + +static void sub_802DC80(u32 id, s16 y) +{ + gUnknown_02022D00->unk81A8[id]->pos2.y = y; +} + +static void sub_802DC9C(int id) +{ + sub_802CF50(gUnknown_02022D00, id); + ChangeBgY(2, (gUnknown_082FE1DF[id] * 5) << 0xD, 0); +} + +static int sub_802DCCC(u8 flags) +{ + int i, count; + + for (i = 0, count = 0; i < 5; i++) + { + if (flags & 1) + { + sub_802CB14(gUnknown_02022D00, i); + count++; + } + flags >>= 1; + } + + sub_802E00C(count - 2); + return count; +} + +static void sub_802DD08(void) +{ + struct UnkStruct3 unkStruct; + struct UnkStruct3 *ptr = &unkStruct; // This temp variable is needed to match, don't ask me why. + + ptr->shape = 0; + ptr->size = 0; + ptr->field_0_0 = 0; + ptr->priority = 1; + ptr->field_1 = 5; + ptr->xDelta = 8; + ptr->x = 108; + ptr->y = 6; + ptr->spriteSheet = (void*) &gUnknown_082FE1EC; + ptr->spritePal = &gUnknown_082FE1F4; + + sub_8034C54(2); + sub_8034D14(0, 0, ptr); + + unkStruct.field_1 = 4; + unkStruct.x = 30; + unkStruct.y = 6; + sub_8034D14(1, 0, &unkStruct); +} + +static void sub_802DD64(int arg0) +{ + sub_8035044(0, arg0); +} + +static void sub_802DD74(u16 arg0) +{ + sub_8035044(1, arg0); +} + +static void sub_802DD88(u8 multiplayerId) +{ + sub_802CBF0(gUnknown_02022D00, multiplayerId); +} + +static void sub_802DDA0(u8 multiplayerId) +{ + sub_802CC88(gUnknown_02022D00, multiplayerId); +} + +static int sub_802DDB8(int multiplayerId) +{ + return sub_802CC18(gUnknown_02022D00, multiplayerId); +} + +static void sub_802DDCC(void) +{ + sub_802CCB0(gUnknown_02022D00); +} + +static void sub_802DDE0(void) +{ + sub_802CD3C(gUnknown_02022D00); +} + +static void sub_802DDF4(int multiplayerId) +{ + sub_802CD70(gUnknown_02022D00, multiplayerId); +} + +static int sub_802DE08(void) +{ + return sub_802CD98(gUnknown_02022D00); +} + +static void sub_802DE1C(void) +{ + struct WindowTemplate window; + int i, playersCount = sub_802C8AC(); + const u16 *winCoords = gUnknown_082FE234[playersCount - 2]; + + window.bg = 0; + window.width = 8; + window.height = 2; + window.paletteNum = 2; + window.baseBlock = 0x2B; + + for (i = 0; i < playersCount; i++) + { + window.tilemapLeft = winCoords[0]; + window.tilemapTop = winCoords[1]; + gUnknown_02022D00->unk1C[i] = AddWindow(&window); + ClearWindowTilemap(gUnknown_02022D00->unk1C[i]); + window.baseBlock += 0x10; + winCoords += 2; + } + + CopyBgTilemapBufferToVram(0); +} + +static void sub_802DED8(int multiplayerId, u8 clr1, u8 clr2, u8 clr3) +{ + u32 x; + u8 colors[3] = {clr1, clr2, clr3}; + + FillWindowPixelBuffer(gUnknown_02022D00->unk1C[multiplayerId], 0); + x = 64 - GetStringWidth(1, sub_802C8E8(multiplayerId), -1); + x /= 2; + AddTextPrinterParameterized3(gUnknown_02022D00->unk1C[multiplayerId], 1, x, 1, colors, -1, sub_802C8E8(multiplayerId)); + CopyWindowToVram(gUnknown_02022D00->unk1C[multiplayerId], 2); +} + +static void sub_802DF70(bool32 arg0) +{ + int i, var, playersCount = sub_802C8AC(); + + if (!arg0) + { + for (i = 0; i < playersCount; i++) + sub_802DED8(i, 0, 2, 3); + } + else + { + var = sub_802C8BC(); + for (i = 0; i < playersCount; i++) + { + if (var != i) + sub_802DED8(i, 0, 2, 3); + else + sub_802DED8(i, 0, 4, 5); + } + } +} + +static void sub_802DFD4(void) +{ + int i, playersCount = sub_802C8AC(); + + for (i = 0; i < playersCount; i++) + PutWindowTilemap(gUnknown_02022D00->unk1C[i]); + CopyBgTilemapBufferToVram(0); +} + +static void sub_802E00C(u8 arg0) +{ + gUnknown_02022D00->unk18 = 0; + ChangeBgX(1, (arg0 / 2) << 16, 0); + ChangeBgY(1, (((arg0 % 2) << 8) - 40) << 8, 0); + ShowBg(1); + CreateTask(sub_802E090, 4); +} + +static bool32 sub_802E058(void) +{ + if (gUnknown_02022D00->unk18 >= 32) + { + return FALSE; + } + else + { + ChangeBgY(1, 128, 1); + if (++gUnknown_02022D00->unk18 >= 32) + HideBg(1); + return TRUE; + } +} + +static void sub_802E090(u8 taskId) +{ + if (!sub_802E058()) + DestroyTask(taskId); +} + +struct MonInfoPacket +{ + u8 id; // packet id + u16 species; + u32 personality; + u32 otId; +}; + +static void sub_802E0AC(struct PokemonJump1_MonInfo *arg0) +{ + struct MonInfoPacket packet; + packet.id = 1, + packet.species = arg0->species, + packet.otId = arg0->otId, + packet.personality = arg0->personality, + sub_800FE50(&packet); +} + +static bool32 sub_802E0D0(int multiplayerId, struct PokemonJump1_MonInfo *arg0) +{ + struct MonInfoPacket packet; + + if ((gRecvCmds[multiplayerId][0] & 0xFF00) != 0x2F00) + return FALSE; + + memcpy(&packet, &gRecvCmds[multiplayerId][1], sizeof(packet)); + if (packet.id == 1) + { + arg0->species = packet.species; + arg0->otId = packet.otId; + arg0->personality = packet.personality; + return TRUE; + } + + return FALSE; +} + +struct UnkPacket2 +{ + u8 id; // packet id + u32 unk4; + u32 unk8; +}; + +static void sub_802E120(u32 arg0) +{ + struct UnkPacket2 packet; + packet.id = 2; + packet.unk4 = arg0; + sub_800FE50(&packet); +} + +struct UnkPacket3 +{ + u8 id; // packet id + u8 unk1; + u8 unk2; + u8 unk3_0:5; + u8 unk3_1:3; + u16 unk4; + u16 unk6; + u32 unk8_0:15; + u32 unk8_1:17; +}; + +static void sub_802E138(struct PokemonJump1_82E4 *arg0, struct PokemonJump1Sub *arg1) +{ + struct UnkPacket3 packet; + packet.id = 3; + packet.unk8_1 = arg1->unk8; + packet.unk3_0 = arg1->unk1; + packet.unk1 = arg1->unk0; + packet.unk6 = arg1->unk2; + packet.unk8_0 = arg1->unk4; + packet.unk2 = arg0->unk10; + packet.unk3_1 = arg0->unk14; + packet.unk4 = arg0->unkE; + sub_800FE50(&packet); +} + +static bool32 sub_802E1BC(struct PokemonJump1_82E4 *arg0, struct PokemonJump1Sub *arg1) +{ + struct UnkPacket3 packet; + + if ((gRecvCmds[0][0] & 0xFF00) != 0x2F00) + return FALSE; + + memcpy(&packet, &gRecvCmds[0][1], sizeof(packet)); + if (packet.id != 3) + return FALSE; + + arg1->unk8 = packet.unk8_1; + arg1->unk1 = packet.unk3_0; + arg1->unk0 = packet.unk1; + arg1->unk2 = packet.unk6; + arg1->unk4 = packet.unk8_0; + arg0->unk10 = packet.unk2; + arg0->unk14 = packet.unk3_1; + arg0->unkE = packet.unk4; + return TRUE; +} + +struct UnkPacket4 +{ + u8 id; // packet id + u8 unk1; + u8 unk2; + u8 unk3; + u16 unk4; + u8 unk6; + u16 unk8; +}; + +static void sub_802E234(struct PokemonJump1_82E4 *arg0, u8 arg1, u16 arg2) +{ + struct UnkPacket4 packet; + packet.id = 4; + packet.unk1 = arg0->unk10; + packet.unk2 = arg0->unk14; + packet.unk3 = arg0->unk18; + packet.unk4 = arg0->unkE; + packet.unk6 = arg1; + packet.unk8 = arg2; + sub_800FE50(&packet); +} + +static bool32 sub_802E264(struct PokemonJump1_82E4 *arg0, int multiplayerId, u8 *arg2, u16 *arg3) +{ + struct UnkPacket4 packet; + + if ((gRecvCmds[multiplayerId][0] & 0xFF00) != 0x2F00) + return FALSE; + + memcpy(&packet, &gRecvCmds[multiplayerId][1], sizeof(packet)); + if (packet.id != 4) + return FALSE; + + arg0->unk10 = packet.unk1; + arg0->unk14 = packet.unk2; + arg0->unk18 = packet.unk3; + arg0->unkE = packet.unk4; + *arg2 = packet.unk6; + *arg3 = packet.unk8; + return TRUE; +} + +static bool32 sub_802E2D0(struct PokemonJump1_82E4 *arg0, int multiplayerId) +{ + struct UnkPacket4 packet; + + if ((gRecvCmds[multiplayerId][0] & 0xFF00) != 0x2F00) + return FALSE; + + memcpy(&packet, &gRecvCmds[multiplayerId][1], sizeof(packet)); + if (packet.id != 4) + return FALSE; + + arg0->unk10 = packet.unk1; + arg0->unk14 = packet.unk2; + arg0->unk18 = packet.unk3; + arg0->unkE = packet.unk4; + return TRUE; +} + +static struct PokemonJumpResults *sub_802E32C(void) +{ + return &gSaveBlock2Ptr->pokeJump; +} + +void ResetPokeJumpResults(void) +{ + struct PokemonJumpResults *pokeJump = sub_802E32C(); + pokeJump->jumpsInRow = 0; + pokeJump->bestJumpScore = 0; + pokeJump->excellentsInRow = 0; + pokeJump->field6 = 0; + pokeJump->field8 = 0; + pokeJump->field2 = 0; +} + +static bool32 sub_802E354(u32 jumpScore, u16 jumpsInRow, u16 excellentsInRow) +{ + struct PokemonJumpResults *pokeJump = sub_802E32C(); + bool32 ret = FALSE; + + if (pokeJump->bestJumpScore < jumpScore && jumpScore <= 99990) + pokeJump->bestJumpScore = jumpScore, ret = TRUE; + if (pokeJump->jumpsInRow < jumpsInRow && jumpsInRow <= 9999) + pokeJump->jumpsInRow = jumpsInRow, ret = TRUE; + if (pokeJump->excellentsInRow < excellentsInRow && excellentsInRow <= 9999) + pokeJump->excellentsInRow = excellentsInRow, ret = TRUE; + + return ret; +} + +static void sub_802E3A8(void) +{ + struct PokemonJumpResults *pokeJump = sub_802E32C(); + if (pokeJump->field6 < 9999) + pokeJump->field6++; +} + +void sub_802E3C4(void) +{ + u8 taskId = CreateTask(sub_802E3E4, 0); + sub_802E3E4(taskId); +} + +static const struct WindowTemplate gUnknown_082FE270 = +{ + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 28, + .height = 9, + .paletteNum = 15, + .baseBlock = 0x1, +}; + +static const u8 *const gUnknown_082FE278[] = {gText_JumpsInARow, gText_BestScore2, gText_ExcellentsInARow}; + +static void sub_802E3E4(u8 taskId) +{ + struct WindowTemplate window; + int i, width, widthCurr; + s16 *data = gTasks[taskId].data; + + switch (data[0]) + { + case 0: + window = gUnknown_082FE270; + width = GetStringWidth(1, gText_PkmnJumpRecords, 0); + for (i = 0; i < ARRAY_COUNT(gUnknown_082FE278); i++) + { + widthCurr = GetStringWidth(1, gUnknown_082FE278[i], 0) + 38; + if (widthCurr > width) + width = widthCurr; + } + width = (width + 7) / 8; + if (width & 1) + width++; + window.tilemapLeft = (30 - width) / 2; + window.width = width; + data[1] = AddWindow(&window); + sub_802E500(data[1], width); + CopyWindowToVram(data[1], 3); + data[0]++; + break; + case 1: + if (!IsDma3ManagerBusyWithBgCopy()) + data[0]++; + break; + case 2: + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + { + rbox_fill_rectangle(data[1]); + CopyWindowToVram(data[1], 1); + data[0]++; + } + break; + case 3: + if (!IsDma3ManagerBusyWithBgCopy()) + { + RemoveWindow(data[1]); + DestroyTask(taskId); + EnableBothScriptContexts(); + } + break; + } +} + +static void sub_802E500(u16 windowId, int width) +{ + int i, x; + int results[3]; + struct PokemonJumpResults *pokeJump = sub_802E32C(); + results[0] = pokeJump->jumpsInRow; + results[1] = pokeJump->bestJumpScore; + results[2] = pokeJump->excellentsInRow; + + LoadUserWindowBorderGfx_(windowId, 0x21D, 0xD0); + DrawTextBorderOuter(windowId, 0x21D, 0xD); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); + AddTextPrinterParameterized(windowId, 1, gText_PkmnJumpRecords, GetStringCenterAlignXOffset(1, gText_PkmnJumpRecords, width * 8), 1, TEXT_SPEED_FF, NULL); + for (i = 0; i < ARRAY_COUNT(gUnknown_082FE278); i++) + { + AddTextPrinterParameterized(windowId, 1, gUnknown_082FE278[i], 0, 25 + (i * 16), TEXT_SPEED_FF, NULL); + ConvertIntToDecimalStringN(gStringVar1, results[i], STR_CONV_MODE_LEFT_ALIGN, 5); + TruncateToFirstWordOnly(gStringVar1); + x = (width * 8) - GetStringWidth(1, gStringVar1, 0); + AddTextPrinterParameterized(windowId, 1, gStringVar1, x, 25 + (i * 16), TEXT_SPEED_FF, NULL); + } + PutWindowTilemap(windowId); +} + +static void TruncateToFirstWordOnly(u8 *str) +{ + for (;*str != EOS; str++) + { + if (*str == CHAR_SPACE) + { + *str = EOS; + break; + } + } +} + +static const u16 gPkmnJump321StartPal1[] = INCBIN_U16("graphics/link_games/pkmnjump_321start1.gbapal"); +static const u32 gPkmnJump321StartGfx1[] = INCBIN_U32("graphics/link_games/pkmnjump_321start1.4bpp.lz"); + +static const struct CompressedSpriteSheet gUnknown_082FE6C8[] = +{ + {gPkmnJump321StartGfx1, 0xC00, 0x2000}, + {}, +}; + +static const struct SpritePalette gUnknown_082FE6D8[] = +{ + {gPkmnJump321StartPal1, 0x2000}, + {}, +}; + +static const union AnimCmd sSpriteAnim_82FE6E8[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FE6F0[] = +{ + ANIMCMD_FRAME(16, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FE6F8[] = +{ + ANIMCMD_FRAME(32, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FE700[] = +{ + ANIMCMD_FRAME(64, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FE708[] = +{ + ANIMCMD_FRAME(48, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FE710[] = +{ + ANIMCMD_FRAME(80, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_82FE718[] = +{ + sSpriteAnim_82FE6E8, + sSpriteAnim_82FE6F0, + sSpriteAnim_82FE6F8, + sSpriteAnim_82FE700, + sSpriteAnim_82FE708, + sSpriteAnim_82FE710 +}; + +static const struct SpriteTemplate gUnknown_082FE730[] = +{ + { + .tileTag = 0x2000, + .paletteTag = 0x2000, + .oam = &gUnknown_08524914, + .anims = sSpriteAnimTable_82FE718, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, +}; + +static const TaskFunc gUnknown_082FE748[][4] = +{ + { + sub_802E83C, + sub_802E8C8, + sub_802EA50, + sub_802EAB0 + }, +}; + +// There's only set of task functions. +static u32 sub_802E63C(u8 funcSetId, u8 taskPriority) +{ + u8 taskId = CreateTask(sub_802E6D0, taskPriority); + struct Task *task = &gTasks[taskId]; + + task->data[0] = 1; + task->data[1] = funcSetId; + gUnknown_082FE748[funcSetId][0](taskId); + return taskId; +} + +static bool32 sub_802E688(void) +{ + u8 taskId = FindTaskIdByFunc(sub_802E6D0); + if (taskId == 0xFF) + return FALSE; + + gTasks[taskId].data[0] = 2; + return TRUE; +} + +static bool32 sub_802E6BC(void) +{ + return FuncIsActiveTask(sub_802E6D0); +} + +static void sub_802E6D0(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (data[0]) + { + case 2: + gUnknown_082FE748[data[1]][2](taskId); + data[0] = 3; + break; + case 3: + gUnknown_082FE748[data[1]][3](taskId); + break; + case 4: + gUnknown_082FE748[data[1]][1](taskId); + DestroyTask(taskId); + break; + } +} + +static void sub_802E75C(u8 taskId, s16 *data) +{ + u8 i; + struct Sprite *sprite; + + LoadCompressedSpriteSheet(&gUnknown_082FE6C8[data[3]]); + LoadSpritePalette(&gUnknown_082FE6D8[data[4]]); + for (i = 0; i < data[8]; i++) + data[13 + i] = CreateSprite(&gUnknown_082FE730[data[2]], data[9], data[10], data[7]); + for (i = 0; i < data[8]; i++) + { + sprite = &gSprites[data[13 + i]]; + sprite->oam.priority = data[6]; + sprite->invisible = TRUE; + sprite->data[1] = data[5]; + sprite->data[3] = taskId; + sprite->data[4] = i; + sprite->data[5] = data[13]; + } +} + +static void sub_802E83C(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + data[2] = 0; + data[3] = 0; + data[4] = 0; + data[5] = 60; + data[6] = 0; + data[7] = 0; + data[8] = 3; + data[9] = 120; + data[10] = 88; + sub_802E75C(taskId, data); + + StartSpriteAnim(&gSprites[data[14]], 4); + gSprites[data[14]].pos2.x = -32; + + StartSpriteAnim(&gSprites[data[15]], 5); + gSprites[data[15]].pos2.x = 32; +} + +static void sub_802E8C8(u8 taskId) +{ + u8 i = 0; + s16 *data = gTasks[taskId].data; + + for (i = 0; i < data[8]; i++) + DestroySprite(&gSprites[data[13 + i]]); + FreeSpriteTilesByTag(gUnknown_082FE6C8[data[3]].tag); + FreeSpritePaletteByTag(gUnknown_082FE6D8[data[4]].tag); +} + +static void sub_802E938(struct Sprite *sprite) +{ + s16 *data = gTasks[sprite->data[3]].data; + + if (data[11] % data[5] != 0) + return; + if (data[11] == data[10]) + return; + + data[10] = data[11]; + switch (sprite->data[2]) + { + case 0: + sprite->invisible = FALSE; + case 1: + case 2: + PlaySE(SE_KON); + StartSpriteAnim(sprite, sprite->data[2]); + break; + case 3: + PlaySE(SE_PIN); + StartSpriteAnim(sprite, sprite->data[2]); + gSprites[data[14]].invisible = FALSE; + gSprites[data[15]].invisible = FALSE; + break; + case 4: + sprite->invisible = TRUE; + gSprites[data[14]].invisible = TRUE; + gSprites[data[15]].invisible = TRUE; + data[0] = 4; + return; + } + sprite->data[2]++; +} + +static void sub_802EA50(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + PlaySE(SE_KON); + gSprites[data[13]].callback = sub_802E938; + gSprites[data[13]].invisible = FALSE; + gTasks[taskId].data[0] = 3; +} + +static void sub_802EAB0(u8 taskId) +{ + u16 packet[6]; + s16 *data = gTasks[taskId].data; + + if (gReceivedRemoteLinkPlayers != 0) + { + if (gRecvCmds[0][1] == 0x7FFF) + data[11] = gRecvCmds[0][2]; + if (GetMultiplayerId() == 0) + { + data[12]++; + memset(packet, 0, sizeof(packet)); + packet[0] = 0x7FFF; + packet[1] = data[12]; + sub_800FE50(packet); + } + } + else + { + data[11]++; + } +} + +void sub_802EB24(s16 tileTag, s16 palTag, s16 x, s16 y, u8 subpriority) +{ + u8 taskId = CreateTask(sub_802EB98, 0x50); + gTasks[taskId].data[2] = tileTag; + gTasks[taskId].data[3] = palTag; + gTasks[taskId].data[4] = x; + gTasks[taskId].data[5] = y; + gTasks[taskId].data[6] = subpriority; +} + +bool32 sub_802EB84(void) +{ + return FuncIsActiveTask(sub_802EB98); +} + +static void sub_802EB98(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (data[0]) + { + case 0: + sub_802EF50(data[2], data[3]); + data[7] = sub_802EFA8(data[2], data[3], data[4], data[5], data[6]); + sub_802EFFC(data[2], data[3], data[4], data[5], data[6], &data[8], &data[9]); + data[0]++; + break; + case 1: + if (!sub_802EC98(data[7])) + { + sub_802EDCC(data[7], data[8], data[9]); + FreeSpriteOamMatrix(&gSprites[data[7]]); + DestroySprite(&gSprites[data[7]]); + data[0]++; + } + break; + case 2: + if (!sub_802EE30(data[8])) + { + DestroySprite(&gSprites[data[8]]); + DestroySprite(&gSprites[data[9]]); + FreeSpriteTilesByTag(data[2]); + FreeSpritePaletteByTag(data[3]); + DestroyTask(taskId); + } + break; + } +} + +static bool32 sub_802EC98(u8 spriteId) +{ + struct Sprite *sprite = &gSprites[spriteId]; + + switch (sprite->data[0]) + { + case 0: + sub_8007E18(sprite, 0x800, 0x1A); + sprite->data[0]++; + case 1: + if (sprite->data[2] == 0) + PlaySE(SE_KON2); + if (++sprite->data[2] >= 20) + { + sprite->data[2] = 0; + StartSpriteAffineAnim(sprite, 1); + sprite->data[0]++; + } + break; + case 2: + if (sprite->affineAnimEnded) + sprite->data[0]++; + break; + case 3: + if (++sprite->data[2] >= 4) + { + sprite->data[2] = 0; + sprite->data[0]++; + StartSpriteAffineAnim(sprite, 2); + } + break; + case 4: + sprite->pos1.y -= 4; + if (++sprite->data[2] >= 8) + { + if (sprite->data[4] <= 1) + { + StartSpriteAnim(sprite, sprite->data[4] + 1); + sprite->data[2] = 0; + sprite->data[0]++; + } + else + { + sprite->data[0] = 7; + return FALSE; + } + } + break; + case 5: + sprite->pos1.y += 4; + if (++sprite->data[2] >= 8) + { + sprite->data[2] = 0; + StartSpriteAffineAnim(sprite, 3); + sprite->data[0]++; + } + break; + case 6: + if (sprite->affineAnimEnded) + { + sprite->data[4]++; + sprite->data[0] = 1; + } + break; + case 7: + return FALSE; + } + + return TRUE; +} + +// First argument is unused. +static void sub_802EDCC(u8 spriteId1, u8 spriteId2, u8 spriteId3) +{ + gSprites[spriteId2].pos2.y = -40; + gSprites[spriteId3].pos2.y = -40; + gSprites[spriteId2].invisible = FALSE; + gSprites[spriteId3].invisible = FALSE; + gSprites[spriteId2].callback = sub_802EE5C; + gSprites[spriteId3].callback = sub_802EE5C; +} + +static bool32 sub_802EE30(u8 spriteId) +{ + return (gSprites[spriteId].callback == sub_802EE5C); +} + +static void sub_802EE5C(struct Sprite *sprite) +{ + int y; + s16 *data = sprite->data; + + switch (data[0]) + { + case 0: + data[4] = 64; + data[5] = sprite->pos2.y << 4; + data[0]++; + case 1: + data[5] += data[4]; + data[4]++; + sprite->pos2.y = data[5] >> 4; + if (sprite->pos2.y >= 0) + { + PlaySE(SE_KON2); + sprite->pos2.y = 0; + data[0]++; + } + break; + case 2: + data[1] += 12; + if (data[1] >= 128) + { + PlaySE(SE_KON2); + data[1] = 0; + data[0]++; + } + y = gSineTable[data[1]]; + sprite->pos2.y = -(y >> 4); + break; + case 3: + data[1] += 16; + if (data[1] >= 128) + { + PlaySE(SE_KON2); + data[1] = 0; + data[0]++; + } + sprite->pos2.y = -(gSineTable[data[1]] >> 5); + break; + case 4: + if (++data[1] > 40) + sprite->callback = SpriteCallbackDummy; + break; + } +} + +static const u16 gPkmnJump321StartPal2[] = INCBIN_U16("graphics/link_games/pkmnjump_321start2.gbapal"); +static const u32 gPkmnJump321StartGfx2[] = INCBIN_U32("graphics/link_games/pkmnjump_321start2.4bpp.lz"); + +static void sub_802EF50(u16 tileTag, u16 palTag) +{ + struct CompressedSpriteSheet sprSheet = {gPkmnJump321StartGfx2, 0xE00, 0}; + struct SpritePalette sprPal = {gPkmnJump321StartPal2, 0}; + + sprSheet.tag = tileTag; + sprPal.tag = palTag; + + LoadCompressedSpriteSheet(&sprSheet); + LoadSpritePalette(&sprPal); +} + +static const struct OamData sOamData_82FEBDC = +{ + .y = 0, + .affineMode = 3, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +static const struct OamData sOamData_82FEBE4 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0 +}; + +static const union AnimCmd sSpriteAnim_82FEBEC[] = +{ + ANIMCMD_FRAME(0, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FEBF4[] = +{ + ANIMCMD_FRAME(16, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FEBFC[] = +{ + ANIMCMD_FRAME(32, 1), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_82FEC04[] = +{ + sSpriteAnim_82FEBEC, + sSpriteAnim_82FEBF4, + sSpriteAnim_82FEBFC +}; + +static const union AnimCmd sSpriteAnim_82FEC10[] = +{ + ANIMCMD_FRAME(48, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82FEC18[] = +{ + ANIMCMD_FRAME(80, 1), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_82FEC20[] = +{ + sSpriteAnim_82FEC10, + sSpriteAnim_82FEC18 +}; + +static const union AffineAnimCmd sSpriteAffineAnim_82FEC28[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd sSpriteAffineAnim_82FEC38[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_FRAME(16, -16, 0, 8), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd sSpriteAffineAnim_82FEC50[] = +{ + AFFINEANIMCMD_FRAME(-18, 18, 0, 8), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd sSpriteAffineAnim_82FEC60[] = +{ + AFFINEANIMCMD_FRAME(6, -6, 0, 8), + AFFINEANIMCMD_FRAME(-4, 4, 0, 8), + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd *const sSpriteAffineAnimTable_82FEC80[] = +{ + sSpriteAffineAnim_82FEC28, + sSpriteAffineAnim_82FEC38, + sSpriteAffineAnim_82FEC50, + sSpriteAffineAnim_82FEC60 +}; + +static u8 sub_802EFA8(u16 tileTag, u16 palTag, s16 x, s16 y, u8 subpriority) +{ + u8 spriteId; + struct SpriteTemplate sprTemplate = + { + .tileTag = 0, + .paletteTag = 0, + .oam = &sOamData_82FEBDC, + .anims = sSpriteAnimTable_82FEC04, + .images = NULL, + .affineAnims = sSpriteAffineAnimTable_82FEC80, + .callback = SpriteCallbackDummy, + }; + + sprTemplate.tileTag = tileTag; + sprTemplate.paletteTag = palTag; + spriteId = CreateSprite(&sprTemplate, x, y, subpriority); + return spriteId; +} + +static void sub_802EFFC(u16 tileTag, u16 palTag, s16 x, s16 y, u8 subpriority, s16 *spriteId1, s16 *spriteId2) +{ + struct SpriteTemplate sprTemplate = + { + .tileTag = 0, + .paletteTag = 0, + .oam = &sOamData_82FEBE4, + .anims = sSpriteAnimTable_82FEC20, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }; + + sprTemplate.tileTag = tileTag; + sprTemplate.paletteTag = palTag; + *spriteId1 = CreateSprite(&sprTemplate, x - 32, y, subpriority); + *spriteId2 = CreateSprite(&sprTemplate, x + 32, y, subpriority); + + gSprites[*spriteId1].invisible = TRUE; + gSprites[*spriteId2].invisible = TRUE; + StartSpriteAnim(&gSprites[*spriteId2], 1); +} diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 0ddad55a6..59ec8f4f1 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -443,7 +443,7 @@ enum #define TAG_TILE_1 0x1 // IWRAM bss -IWRAM_DATA static u32 gUnknown_03000F78[98]; +static u32 gUnknown_03000F78[98]; // EWRAM DATA EWRAM_DATA static u8 sPreviousBoxOption = 0; @@ -464,6 +464,9 @@ EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static bool8 sCanOnlyMove = 0; // This file's functions. +#if !defined(NONMATCHING) && MODERN +#define static +#endif static void CreatePCMenu(u8 whichMenu, s16 *windowIdPtr); static void Cb2_EnterPSS(u8 boxOption); static u8 GetCurrentBoxOption(void); @@ -6824,7 +6827,7 @@ static void SetCursorMonData(void *pokemon, u8 mode) sPSSData->cursorMonLevel = GetLevelFromBoxMonExp(boxMon); sPSSData->cursorMonMarkings = GetBoxMonData(boxMon, MON_DATA_MARKINGS); sPSSData->cursorMonPersonality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); - sPSSData->cursorMonPalette = GetFrontSpritePalFromSpeciesAndPersonality(sPSSData->cursorMonSpecies, otId, sPSSData->cursorMonPersonality); + sPSSData->cursorMonPalette = GetMonSpritePalFromSpeciesAndPersonality(sPSSData->cursorMonSpecies, otId, sPSSData->cursorMonPersonality); gender = GetGenderFromSpeciesAndPersonality(sPSSData->cursorMonSpecies, sPSSData->cursorMonPersonality); sPSSData->cursorMonItem = GetBoxMonData(boxMon, MON_DATA_HELD_ITEM); } diff --git a/src/pokenav.c b/src/pokenav.c index be3826bed..132e4123b 100644 --- a/src/pokenav.c +++ b/src/pokenav.c @@ -318,7 +318,7 @@ void Task_RunLoopedTask_LinkMode(u8 taskId) if (sub_8087598()) return; - + task = (LoopedTask)GetWordTaskArg(taskId, 1); state = &gTasks[taskId].data[0]; action = task(*state); @@ -605,7 +605,7 @@ void sub_81C7694(u32 a0) gPokenavResources->fieldA = value; } -u16 sub_81C76AC(void) +u32 sub_81C76AC(void) { return gPokenavResources->fieldA; } diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index 94dab60bb..4422a70e3 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -64,16 +64,16 @@ static void HideLeftHeaderSubmenuSprites(bool32 isOnRightSide); static void HideLeftHeaderSprites(bool32 isOnRightSide); static void ShowLeftHeaderSprites(u32 startY, bool32 isOnRightSide); static void ShowLeftHeaderSubmenuSprites(u32 startY, bool32 isOnRightSide); -static void MoveLeftHeader(struct Sprite *sprite, int startX, int endX, int duration); +static void MoveLeftHeader(struct Sprite *sprite, s32 startX, s32 endX, s32 duration); static void SpriteCB_MoveLeftHeader(struct Sprite *sprite); static void InitPokenavMainMenuResources(void); static void InitHoennMapHeaderSprites(void); static void sub_81C7B74(void); -static u32 LoopedTask_ScrollMenuHeaderDown(int a0); -static u32 LoopedTask_ScrollMenuHeaderUp(int a0); +static u32 LoopedTask_ScrollMenuHeaderDown(s32 a0); +static u32 LoopedTask_ScrollMenuHeaderUp(s32 a0); static void sub_81C7BF8(u32 a0); static void SpriteCB_SpinningPokenav(struct Sprite* sprite); -static u32 LoopedTask_InitPokenavMenu(int a0); +static u32 LoopedTask_InitPokenavMenu(s32 a0); const u16 gSpinningPokenavPaletteData[] = INCBIN_U16("graphics/pokenav/icon2.gbapal"); const u32 gSpinningPokenavGfx[] = INCBIN_U32("graphics/pokenav/icon2.4bpp.lz"); @@ -360,7 +360,7 @@ bool32 WaitForPokenavShutdownFade(void) return TRUE; } -static u32 LoopedTask_InitPokenavMenu(int a0) +static u32 LoopedTask_InitPokenavMenu(s32 a0) { struct PokenavMainMenuResources *structPtr; @@ -440,7 +440,7 @@ bool32 MainMenuLoopedTaskIsBusy(void) return IsLoopedTaskActive(structPtr->currentTaskId); } -static u32 LoopedTask_ScrollMenuHeaderDown(int a0) +static u32 LoopedTask_ScrollMenuHeaderDown(s32 a0) { switch (a0) { @@ -461,7 +461,7 @@ static u32 LoopedTask_ScrollMenuHeaderDown(int a0) } } -static u32 LoopedTask_ScrollMenuHeaderUp(int a0) +static u32 LoopedTask_ScrollMenuHeaderUp(s32 a0) { if (ChangeBgY(0, 384, 2) <= 0) { @@ -637,7 +637,7 @@ _081C7AAE:\n\ .syntax divided"); } -void sub_81C7AC0(int a0) +void sub_81C7AC0(s32 a0) { struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0); @@ -708,7 +708,7 @@ static void sub_81C7BF8(u32 windowId) static void InitPokenavMainMenuResources(void) { - int i; + s32 i; u8 spriteId; struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0); @@ -758,13 +758,13 @@ void ResumeSpinningPokenavSprite(void) static void InitHoennMapHeaderSprites(void) { - int i, spriteId; + s32 i, spriteId; struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0); LoadCompressedSpriteSheet(&sPokenavHoennMapLeftHeaderSpriteSheet); AllocSpritePalette(1); AllocSpritePalette(2); - for (i = 0; i < (int)ARRAY_COUNT(structPtr->leftHeaderSprites); i++) + for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++) { spriteId = CreateSprite(&sPokenavLeftHeaderHoennMapSpriteTemplate, 0, 0, 1); structPtr->leftHeaderSprites[i] = &gSprites[spriteId]; @@ -859,10 +859,10 @@ void sub_81C7FC4(u32 arg0, bool32 arg1) void sub_81C7FDC(void) { - int i; + s32 i; struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0); - for (i = 0; i < (int)ARRAY_COUNT(structPtr->leftHeaderSprites); i++) + for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++) { structPtr->leftHeaderSprites[i]->invisible = TRUE; structPtr->submenuLeftHeaderSprites[i]->invisible = TRUE; @@ -881,7 +881,7 @@ bool32 sub_81C8010(void) static void ShowLeftHeaderSprites(u32 startY, bool32 isOnRightSide) { - int start, end, i; + s32 start, end, i; struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0); if (!isOnRightSide) @@ -889,7 +889,7 @@ static void ShowLeftHeaderSprites(u32 startY, bool32 isOnRightSide) else start = 256, end = 160; - for (i = 0; i < (int)ARRAY_COUNT(structPtr->leftHeaderSprites); i++) + for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++) { structPtr->leftHeaderSprites[i]->pos1.y = startY; MoveLeftHeader(structPtr->leftHeaderSprites[i], start, end, 12); @@ -898,7 +898,7 @@ static void ShowLeftHeaderSprites(u32 startY, bool32 isOnRightSide) static void ShowLeftHeaderSubmenuSprites(u32 startY, bool32 isOnRightSide) { - int start, end, i; + s32 start, end, i; struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0); if (!isOnRightSide) @@ -906,7 +906,7 @@ static void ShowLeftHeaderSubmenuSprites(u32 startY, bool32 isOnRightSide) else start = 256, end = 192; - for (i = 0; i < (int)ARRAY_COUNT(structPtr->submenuLeftHeaderSprites); i++) + for (i = 0; i < (s32)ARRAY_COUNT(structPtr->submenuLeftHeaderSprites); i++) { structPtr->submenuLeftHeaderSprites[i]->pos1.y = startY; MoveLeftHeader(structPtr->submenuLeftHeaderSprites[i], start, end, 12); @@ -915,7 +915,7 @@ static void ShowLeftHeaderSubmenuSprites(u32 startY, bool32 isOnRightSide) static void HideLeftHeaderSprites(bool32 isOnRightSide) { - int start, end, i; + s32 start, end, i; struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0); if (!isOnRightSide) @@ -923,7 +923,7 @@ static void HideLeftHeaderSprites(bool32 isOnRightSide) else start = 192, end = 256; - for (i = 0; i < (int)ARRAY_COUNT(structPtr->leftHeaderSprites); i++) + for (i = 0; i < (s32)ARRAY_COUNT(structPtr->leftHeaderSprites); i++) { MoveLeftHeader(structPtr->leftHeaderSprites[i], start, end, 12); } @@ -931,7 +931,7 @@ static void HideLeftHeaderSprites(bool32 isOnRightSide) static void HideLeftHeaderSubmenuSprites(bool32 isOnRightSide) { - int start, end, i; + s32 start, end, i; struct PokenavMainMenuResources *structPtr = GetSubstructPtr(0); if (!isOnRightSide) @@ -939,13 +939,13 @@ static void HideLeftHeaderSubmenuSprites(bool32 isOnRightSide) else start = 192, end = 256; - for (i = 0; i < (int)ARRAY_COUNT(structPtr->submenuLeftHeaderSprites); i++) + for (i = 0; i < (s32)ARRAY_COUNT(structPtr->submenuLeftHeaderSprites); i++) { MoveLeftHeader(structPtr->submenuLeftHeaderSprites[i], start, end, 12); } } -static void MoveLeftHeader(struct Sprite *sprite, int startX, int endX, int duration) +static void MoveLeftHeader(struct Sprite *sprite, s32 startX, s32 endX, s32 duration) { sprite->pos1.x = startX; sprite->data[0] = startX * 16; diff --git a/src/pokenav_match_call_data.c b/src/pokenav_match_call_data.c index 5c1fb59f7..d2d89babf 100644 --- a/src/pokenav_match_call_data.c +++ b/src/pokenav_match_call_data.c @@ -6,6 +6,7 @@ #include "battle.h" #include "gym_leader_rematch.h" #include "match_call.h" +#include "constants/region_map_sections.h" // Static type declarations @@ -17,13 +18,13 @@ typedef struct MatchCallTextDataStruct { struct MatchCallStructCommon { u8 type; - u8 v1; + u8 mapSec; u16 flag; }; struct MatchCallStruct0 { u8 type; - u8 v1; + u8 mapSec; u16 flag; const u8 *desc; const u8 *name; @@ -32,7 +33,7 @@ struct MatchCallStruct0 { struct MatchCallStruct1 { u8 type; - u8 v1; + u8 mapSec; u16 flag; u16 rematchTableIdx; const u8 *desc; @@ -42,12 +43,12 @@ struct MatchCallStruct1 { struct MatchCallSubstruct2 { u16 flag; - u8 v2; + u8 mapSec; }; struct MatchCallStruct2 { u8 type; - u8 v1; + u8 mapSec; u16 flag; u16 rematchTableIdx; const u8 *desc; @@ -57,7 +58,7 @@ struct MatchCallStruct2 { struct MatchCallStruct3 { u8 type; - u8 v1; + u8 mapSec; u16 flag; const u8 *desc; const u8 *name; @@ -75,7 +76,7 @@ struct MatchCallStruct4 { // Note: Type1 and Type5 have identical struct layouts. struct MatchCallStruct5 { u8 type; - u8 v1; + u8 mapSec; u16 flag; u16 rematchTableIdx; const u8 *desc; @@ -110,11 +111,11 @@ static bool32 MatchCallGetFlag_Type2(match_call_t); static bool32 MatchCallGetFlag_Type3(match_call_t); static bool32 MatchCallGetFlag_Type4(match_call_t); -static u8 sub_81D1714(match_call_t); -static u8 sub_81D1718(match_call_t); -static u8 sub_81D171C(match_call_t); -static u8 sub_81D1750(match_call_t); -static u8 sub_81D1754(match_call_t); +static u8 MatchCallGetMapSec_Type0(match_call_t); +static u8 MatchCallGetMapSec_Type1(match_call_t); +static u8 MatchCallGetMapSec_Type2(match_call_t); +static u8 MatchCallGetMapSec_Type3(match_call_t); +static u8 MatchCallGetMapSec_Type4(match_call_t); static bool32 MatchCall_IsRematchable_Type0(match_call_t); static bool32 MatchCall_IsRematchable_Type1(match_call_t); @@ -325,7 +326,7 @@ static const match_call_text_data_t sMrStoneTextScripts[] = { static const struct MatchCallStruct0 sMrStoneMatchCallHeader = { .type = 0, - .v1 = 10, + .mapSec = MAPSEC_RUSTBORO_CITY, .flag = 0xFFFF, .desc = gMrStoneMatchCallDesc, .name = gMrStoneMatchCallName, @@ -348,7 +349,7 @@ static const match_call_text_data_t sNormanTextScripts[] = { static const struct MatchCallStruct5 sNormanMatchCallHeader = { .type = 5, - .v1 = 7, + .mapSec = MAPSEC_PETALBURG_CITY, .flag = FLAG_ENABLE_NORMAN_MATCH_CALL, .rematchTableIdx = REMATCH_NORMAN, .desc = gNormanMatchCallDesc, @@ -359,7 +360,7 @@ static const struct MatchCallStruct5 sNormanMatchCallHeader = static const struct MatchCallStruct3 sProfBirchMatchCallHeader = { .type = 3, - .v1 = 0, + .mapSec = 0, .flag = FLAG_ENABLE_PROF_BIRCH_MATCH_CALL, .desc = gProfBirchMatchCallDesc, .name = gProfBirchMatchCallName @@ -375,7 +376,7 @@ static const match_call_text_data_t sMomTextScripts[] = { static const struct MatchCallStruct0 sMomMatchCallHeader = { .type = 0, - .v1 = 0, + .mapSec = MAPSEC_LITTLEROOT_TOWN, .flag = FLAG_ENABLE_MOM_MATCH_CALL, .desc = gMomMatchCallDesc, .name = gMomMatchCallName, @@ -396,7 +397,7 @@ static const match_call_text_data_t sStevenTextScripts[] = { static const struct MatchCallStruct0 sStevenMatchCallHeader = { .type = 0, - .v1 = 0xD5, + .mapSec = MAPSEC_NONE, .flag = FLAG_REGISTERED_STEVEN_POKENAV, .desc = gStevenMatchCallDesc, .name = gStevenMatchCallName, @@ -473,16 +474,16 @@ static const match_call_text_data_t sWallyTextScripts[] = { }; const struct MatchCallSubstruct2 sWallyAdditionalData[] = { - { FLAG_HIDE_MAUVILLE_CITY_WALLY, 0x05 }, - { FLAG_GROUDON_AWAKENED_MAGMA_HIDEOUT, 0xD5 }, - { FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY, 0x46 }, - { 0xFFFF, 0xD5 } + { FLAG_HIDE_MAUVILLE_CITY_WALLY, MAPSEC_VERDANTURF_TOWN }, + { FLAG_GROUDON_AWAKENED_MAGMA_HIDEOUT, MAPSEC_NONE }, + { FLAG_HIDE_VICTORY_ROAD_ENTRANCE_WALLY, MAPSEC_VICTORY_ROAD }, + { 0xFFFF, MAPSEC_NONE } }; static const struct MatchCallStruct2 sWallyMatchCallHeader = { .type = 2, - .v1 = 0, + .mapSec = 0, .flag = FLAG_ENABLE_WALLY_MATCH_CALL, .rematchTableIdx = REMATCH_WALLY_3, .desc = gWallyMatchCallDesc, @@ -505,7 +506,7 @@ static const match_call_text_data_t sScottTextScripts[] = { static const struct MatchCallStruct0 sScottMatchCallHeader = { .type = 0, - .v1 = 0xD5, + .mapSec = MAPSEC_NONE, .flag = FLAG_ENABLE_SCOTT_MATCH_CALL, .desc = gScottMatchCallDesc, .name = gScottMatchCallName, @@ -523,7 +524,7 @@ static const match_call_text_data_t sRoxanneTextScripts[] = { static const struct MatchCallStruct5 sRoxanneMatchCallHeader = { .type = 5, - .v1 = 10, + .mapSec = MAPSEC_RUSTBORO_CITY, .flag = FLAG_ENABLE_ROXANNE_MATCH_CALL, .rematchTableIdx = REMATCH_ROXANNE, .desc = gRoxanneMatchCallDesc, @@ -542,7 +543,7 @@ static const match_call_text_data_t sBrawlyTextScripts[] = { static const struct MatchCallStruct5 sBrawlyMatchCallHeader = { .type = 5, - .v1 = 2, + .mapSec = MAPSEC_DEWFORD_TOWN, .flag = FLAG_ENABLE_BRAWLY_MATCH_CALL, .rematchTableIdx = REMATCH_BRAWLY, .desc = gBrawlyMatchCallDesc, @@ -561,7 +562,7 @@ static const match_call_text_data_t sWattsonTextScripts[] = { static const struct MatchCallStruct5 sWattsonMatchCallHeader = { .type = 5, - .v1 = 9, + .mapSec = MAPSEC_MAUVILLE_CITY, .flag = FLAG_ENABLE_WATTSON_MATCH_CALL, .rematchTableIdx = REMATCH_WATTSON, .desc = gWattsonMatchCallDesc, @@ -580,7 +581,7 @@ static const match_call_text_data_t sFlanneryTextScripts[] = { static const struct MatchCallStruct5 sFlanneryMatchCallHeader = { .type = 5, - .v1 = 3, + .mapSec = MAPSEC_LAVARIDGE_TOWN, .flag = FLAG_ENABLE_FLANNERY_MATCH_CALL, .rematchTableIdx = REMATCH_FLANNERY, .desc = gFlanneryMatchCallDesc, @@ -599,7 +600,7 @@ static const match_call_text_data_t sWinonaTextScripts[] = { static const struct MatchCallStruct5 sWinonaMatchCallHeader = { .type = 5, - .v1 = 11, + .mapSec = MAPSEC_FORTREE_CITY, .flag = FLAG_ENABLE_WINONA_MATCH_CALL, .rematchTableIdx = REMATCH_WINONA, .desc = gWinonaMatchCallDesc, @@ -618,7 +619,7 @@ static const match_call_text_data_t sTateLizaTextScripts[] = { static const struct MatchCallStruct5 sTateLizaMatchCallHeader = { .type = 5, - .v1 = 13, + .mapSec = MAPSEC_MOSSDEEP_CITY, .flag = FLAG_ENABLE_TATE_AND_LIZA_MATCH_CALL, .rematchTableIdx = REMATCH_TATE_AND_LIZA, .desc = gTateLizaMatchCallDesc, @@ -637,7 +638,7 @@ static const match_call_text_data_t sJuanTextScripts[] = { static const struct MatchCallStruct5 sJuanMatchCallHeader = { .type = 5, - .v1 = 14, + .mapSec = MAPSEC_SOOTOPOLIS_CITY, .flag = FLAG_ENABLE_JUAN_MATCH_CALL, .rematchTableIdx = REMATCH_JUAN, .desc = gJuanMatchCallDesc, @@ -653,7 +654,7 @@ static const match_call_text_data_t sSidneyTextScripts[] = { static const struct MatchCallStruct5 sSidneyMatchCallHeader = { .type = 5, - .v1 = 15, + .mapSec = MAPSEC_EVER_GRANDE_CITY, .flag = FLAG_REMATCH_SIDNEY, .rematchTableIdx = REMATCH_SIDNEY, .desc = gEliteFourMatchCallDesc, @@ -669,7 +670,7 @@ static const match_call_text_data_t sPhoebeTextScripts[] = { static const struct MatchCallStruct5 sPhoebeMatchCallHeader = { .type = 5, - .v1 = 15, + .mapSec = MAPSEC_EVER_GRANDE_CITY, .flag = FLAG_REMATCH_PHOEBE, .rematchTableIdx = REMATCH_PHOEBE, .desc = gEliteFourMatchCallDesc, @@ -685,7 +686,7 @@ static const match_call_text_data_t sGlaciaTextScripts[] = { static const struct MatchCallStruct5 sGlaciaMatchCallHeader = { .type = 5, - .v1 = 15, + .mapSec = MAPSEC_EVER_GRANDE_CITY, .flag = FLAG_REMATCH_GLACIA, .rematchTableIdx = REMATCH_GLACIA, .desc = gEliteFourMatchCallDesc, @@ -701,7 +702,7 @@ static const match_call_text_data_t sDrakeTextScripts[] = { static const struct MatchCallStruct5 sDrakeMatchCallHeader = { .type = 5, - .v1 = 15, + .mapSec = MAPSEC_EVER_GRANDE_CITY, .flag = FLAG_REMATCH_DRAKE, .rematchTableIdx = REMATCH_DRAKE, .desc = gEliteFourMatchCallDesc, @@ -717,7 +718,7 @@ static const match_call_text_data_t sWallaceTextScripts[] = { static const struct MatchCallStruct5 sWallaceMatchCallHeader = { .type = 5, - .v1 = 15, + .mapSec = MAPSEC_EVER_GRANDE_CITY, .flag = FLAG_REMATCH_WALLACE, .rematchTableIdx = REMATCH_WALLACE, .desc = gChampionMatchCallDesc, @@ -753,24 +754,24 @@ static bool32 (*const sMatchCallGetFlagFuncs[])(match_call_t) = { MatchCallGetFlag_Type0, MatchCallGetFlag_Type1, MatchCallGetFlag_Type2, - MatchCallGetFlag_Type3, - MatchCallGetFlag_Type4 + MatchCallGetFlag_Type4, + MatchCallGetFlag_Type3 }; -static u8 (*const gUnknown_08625310[])(match_call_t) = { - sub_81D1714, - sub_81D1718, - sub_81D171C, - sub_81D1750, - sub_81D1754 +static u8 (*const sMatchCallGetMapSecFuncs[])(match_call_t) = { + MatchCallGetMapSec_Type0, + MatchCallGetMapSec_Type1, + MatchCallGetMapSec_Type2, + MatchCallGetMapSec_Type4, + MatchCallGetMapSec_Type3 }; static bool32 (*const sMatchCall_IsRematchableFunctions[])(match_call_t) = { MatchCall_IsRematchable_Type0, MatchCall_IsRematchable_Type1, MatchCall_IsRematchable_Type2, - MatchCall_IsRematchable_Type3, - MatchCall_IsRematchable_Type4 + MatchCall_IsRematchable_Type4, + MatchCall_IsRematchable_Type3 }; static bool32 (*const gUnknown_08625338[])(match_call_t) = { @@ -785,24 +786,24 @@ static u32 (*const sMatchCall_GetRematchTableIdxFunctions[])(match_call_t) = { MatchCall_GetRematchTableIdx_Type0, MatchCall_GetRematchTableIdx_Type1, MatchCall_GetRematchTableIdx_Type2, - MatchCall_GetRematchTableIdx_Type3, - MatchCall_GetRematchTableIdx_Type4 + MatchCall_GetRematchTableIdx_Type4, + MatchCall_GetRematchTableIdx_Type3 }; static void (*const sMatchCall_GetMessageFunctions[])(match_call_t, u8 *) = { MatchCall_GetMessage_Type0, MatchCall_GetMessage_Type1, MatchCall_GetMessage_Type2, - MatchCall_GetMessage_Type3, - MatchCall_GetMessage_Type4 + MatchCall_GetMessage_Type4, + MatchCall_GetMessage_Type3 }; static void (*const sMatchCall_GetNameAndDescFunctions[])(match_call_t, const u8 **, const u8 **) = { MatchCall_GetNameAndDesc_Type0, MatchCall_GetNameAndDesc_Type1, MatchCall_GetNameAndDesc_Type2, - MatchCall_GetNameAndDesc_Type3, - MatchCall_GetNameAndDesc_Type4 + MatchCall_GetNameAndDesc_Type4, + MatchCall_GetNameAndDesc_Type3 }; static const struct UnkStruct_08625388 sMatchCallCheckPageOverrides[] = { @@ -883,7 +884,7 @@ static bool32 MatchCallGetFlag_Type2(match_call_t matchCall) return FlagGet(matchCall.type2->flag); } -static bool32 MatchCallGetFlag_Type3(match_call_t matchCall) +static bool32 MatchCallGetFlag_Type4(match_call_t matchCall) { if (matchCall.type4->gender != gSaveBlock2Ptr->playerGender) return FALSE; @@ -892,12 +893,12 @@ static bool32 MatchCallGetFlag_Type3(match_call_t matchCall) return FlagGet(matchCall.type4->flag); } -static bool32 MatchCallGetFlag_Type4(match_call_t matchCall) +static bool32 MatchCallGetFlag_Type3(match_call_t matchCall) { return FlagGet(matchCall.type3->flag); } -u8 sub_81D16DC(u32 idx) +u8 MatchCallMapSecGetByIndex(u32 idx) { match_call_t matchCall; u32 i; @@ -906,20 +907,20 @@ u8 sub_81D16DC(u32 idx) return 0; matchCall = sMatchCallHeaders[idx]; i = MatchCallGetFunctionIndex(matchCall); - return gUnknown_08625310[i](matchCall); + return sMatchCallGetMapSecFuncs[i](matchCall); } -static u8 sub_81D1714(match_call_t matchCall) +static u8 MatchCallGetMapSec_Type0(match_call_t matchCall) { - return matchCall.type0->v1; + return matchCall.type0->mapSec; } -static u8 sub_81D1718(match_call_t matchCall) +static u8 MatchCallGetMapSec_Type1(match_call_t matchCall) { - return matchCall.type1->v1; + return matchCall.type1->mapSec; } -static u8 sub_81D171C(match_call_t matchCall) +static u8 MatchCallGetMapSec_Type2(match_call_t matchCall) { s32 i; @@ -928,17 +929,17 @@ static u8 sub_81D171C(match_call_t matchCall) if (!FlagGet(matchCall.type2->v10[i].flag)) break; } - return matchCall.type2->v10[i].v2; + return matchCall.type2->v10[i].mapSec; } -static u8 sub_81D1750(match_call_t matchCall) +static u8 MatchCallGetMapSec_Type4(match_call_t matchCall) { - return 0xd5; + return MAPSEC_NONE; } -static u8 sub_81D1754(match_call_t matchCall) +static u8 MatchCallGetMapSec_Type3(match_call_t matchCall) { - return 0xd5; + return MAPSEC_NONE; } bool32 MatchCall_IsRematchable(u32 idx) @@ -970,12 +971,12 @@ static bool32 MatchCall_IsRematchable_Type2(match_call_t matchCall) return gSaveBlock1Ptr->trainerRematches[matchCall.type2->rematchTableIdx] ? TRUE : FALSE; } -static bool32 MatchCall_IsRematchable_Type3(match_call_t matchCall) +static bool32 MatchCall_IsRematchable_Type4(match_call_t matchCall) { return FALSE; } -static bool32 MatchCall_IsRematchable_Type4(match_call_t matchCall) +static bool32 MatchCall_IsRematchable_Type3(match_call_t matchCall) { return FALSE; } @@ -1051,12 +1052,12 @@ static u32 MatchCall_GetRematchTableIdx_Type2(match_call_t matchCall) return matchCall.type2->rematchTableIdx; } -static u32 MatchCall_GetRematchTableIdx_Type3(match_call_t matchCall) +static u32 MatchCall_GetRematchTableIdx_Type4(match_call_t matchCall) { return REMATCH_TABLE_ENTRIES; } -static u32 MatchCall_GetRematchTableIdx_Type4(match_call_t matchCall) +static u32 MatchCall_GetRematchTableIdx_Type3(match_call_t matchCall) { return REMATCH_TABLE_ENTRIES; } @@ -1091,12 +1092,12 @@ static void MatchCall_GetMessage_Type2(match_call_t matchCall, u8 *dest) sub_81D1920(matchCall.type2->textData, dest); } -static void MatchCall_GetMessage_Type3(match_call_t matchCall, u8 *dest) +static void MatchCall_GetMessage_Type4(match_call_t matchCall, u8 *dest) { sub_81D1920(matchCall.type4->textData, dest); } -static void MatchCall_GetMessage_Type4(match_call_t matchCall, u8 *dest) +static void MatchCall_GetMessage_Type3(match_call_t matchCall, u8 *dest) { sub_8197080(dest); } @@ -1190,13 +1191,13 @@ static void MatchCall_GetNameAndDesc_Type2(match_call_t matchCall, const u8 **de *desc = matchCall.type2->desc; } -static void MatchCall_GetNameAndDesc_Type3(match_call_t matchCall, const u8 **desc, const u8 **name) +static void MatchCall_GetNameAndDesc_Type4(match_call_t matchCall, const u8 **desc, const u8 **name) { *desc = matchCall.type4->desc; *name = matchCall.type4->name; } -static void MatchCall_GetNameAndDesc_Type4(match_call_t matchCall, const u8 **desc, const u8 **name) +static void MatchCall_GetNameAndDesc_Type3(match_call_t matchCall, const u8 **desc, const u8 **name) { *desc = matchCall.type3->desc; *name = matchCall.type3->name; diff --git a/src/pokenav_unk_10.c b/src/pokenav_unk_10.c index dcdbacfb9..51dcd3687 100644 --- a/src/pokenav_unk_10.c +++ b/src/pokenav_unk_10.c @@ -1,67 +1,737 @@ #include "global.h" #include "decompress.h" #include "dynamic_placeholder_text_util.h" +#include "graphics.h" #include "international_string_util.h" #include "pokenav.h" +#include "sound.h" #include "sprite.h" #include "string_util.h" +#include "strings.h" #include "text.h" #include "trainer_pokemon_sprites.h" #include "window.h" +#include "constants/songs.h" -struct Pokenav10Struct +struct PokenavSub13 { - u32 field_0[5]; - struct Sprite *field_14; + u8 filler0[0x8]; + struct PokenavSub18 *field_8; + u16 field_C; + u16 field_E; + u16 field_10; + u16 field_12; + u32 field_14[25]; + u32 field_78[8]; + u32 (*field_98)(struct PokenavSub13 *structPtr); }; -struct Pokenav10Struct2 +struct PokenavSub14 { - u32 filler0[2]; + u32 (*field_0)(void); + u32 loopedTaskId; u16 field_8; u16 field_A; u16 field_C; - u8 filler[2]; + u16 field_E; u16 field_10; + struct Sprite *field_14; + u32 filler; + u8 tilemapBuffers[2][BG_SCREEN_SIZE]; }; -// To do: move to C. -extern const u16 gUnknown_08623FF8[]; -extern const u16 gUnknown_08624038[]; -extern const u16 gUnknown_08624018[]; -extern const u16 gUnknown_08624078[]; -extern const u16 gUnknown_08624058[]; -extern const u32 gUnknown_08624280[]; -extern const u8 gText_RibbonsF700[]; -extern const u8 *const gRibbonDescriptionPointers[][2]; -extern const u8 *const gGiftRibbonDescriptionPointers[][2]; +static u32 gUnknown_030012C0; +static u32 gUnknown_030012C4; -extern u32 gUnknown_030012C0; -extern u32 gUnknown_030012C4; - -void sub_81D0E84(struct Pokenav10Struct2 *structPtr); -void sub_81D0FF0(struct Pokenav10Struct2 *structPtr); -void sub_81D10D0(struct Pokenav10Struct2 *structPtr); +void sub_81D0E84(struct PokenavSub14 *structPtr); +void sub_81D0FF0(struct PokenavSub14 *structPtr); +void sub_81D10D0(struct PokenavSub14 *structPtr); +void sub_81D1500(struct PokenavSub14 *structPtr); +void sub_81D0EFC(struct PokenavSub14 *structPtr); +void sub_81D1148(struct PokenavSub14 *structPtr); +void sub_81D10A4(struct PokenavSub14 *structPtr); +void sub_81D1178(struct PokenavSub14 *structPtr); +void sub_81D11D8(struct PokenavSub14 *structPtr); +void sub_81D11FC(struct PokenavSub14 *structPtr); +void sub_81D0E60(struct PokenavSub14 *structPtr); +void sub_81D1448(struct PokenavSub14 *structPtr); +void sub_81D13FC(struct PokenavSub14 *structPtr); +void sub_81D0FCC(struct PokenavSub14 *structPtr); +void sub_81D12D8(struct PokenavSub14 *structPtr); +bool32 sub_81D1524(struct PokenavSub14 *structPtr); +bool32 sub_81D1234(struct PokenavSub14 *structPtr); +void sub_81D0814(struct PokenavSub13 *structPtr); +u32 sub_81D0548(struct PokenavSub13 *structPtr); +u32 sub_81D04C4(struct PokenavSub13 *structPtr); +u32 sub_81D05D4(struct PokenavSub13 *structPtr); +bool32 sub_81D05DC(struct PokenavSub13 *structPtr); +bool32 sub_81D0688(struct PokenavSub13 *structPtr); +bool32 sub_81D0664(struct PokenavSub13 *structPtr); +bool32 sub_81D061C(struct PokenavSub13 *structPtr); +bool32 sub_81D0688(struct PokenavSub13 *structPtr); +bool32 sub_81D0A58(void); u32 sub_81D06C4(void); -u32 sub_81D07D8(void); u32 sub_81D06D4(void); -void sub_81D06E4(u8 *nick, u8 *level, u8 *gender); -void sub_81D0760(u16 *species, u32 *personality, u32 *otId); u16 sub_81D1184(s32 unused0, s32 unused1); void sub_81D1258(struct Sprite *sprite, s32 arg1, s32 arg2, s32 arg3); void sub_81D1284(struct Sprite *sprite); -u32 *sub_81D0914(u32 *arg0); -u32 *sub_81D092C(u32 *arg0); void sub_81D1350(void); void sub_81D13BC(u16 *dst, u32 id); void sub_81D1370(u32 arg0, u32 id); -u16 sub_81D0944(void); -u32 sub_81D0954(void); -void sub_81D1500(struct Pokenav10Struct *structPtr); -bool32 sub_81D1524(struct Pokenav10Struct *structPtr); void sub_81D1538(struct Sprite *sprite); +u32 sub_81D0A6C(s32 state); +u32 sub_81D0C84(s32 state); +u32 sub_81D0D2C(s32 state); +u32 sub_81D0D8C(s32 state); +u32 sub_81D0E00(s32 state); +u32 sub_81D0C54(s32 state); + +struct +{ + u8 unk0; + u8 unk1; + u8 unk2; + u8 unk3; +} static const gUnknown_086237F8[] = +{ + {1, 1, 0, 0}, + {3, 4, 1, 0}, + {3, 4, 5, 0}, + {3, 4, 9, 0}, + {3, 4, 13, 0}, + {3, 4, 17, 0}, + {1, 1, 21, 0}, + {1, 1, 22, 0}, + {1, 1, 23, 0}, + {1, 1, 24, 0}, + {1, 1, 25, 1}, + {1, 1, 26, 1}, + {1, 1, 27, 1}, + {1, 1, 28, 1}, + {1, 1, 29, 1}, + {1, 1, 30, 1}, + {1, 1, 31, 1} +}; + +#include "data/text/ribbon_descriptions.h" +#include "data/text/gift_ribbon_descriptions.h" + +static const u16 gUnknown_08623FF8[] = INCBIN_U16("graphics/pokenav/ribbons_icon1.gbapal"); +static const u16 gUnknown_08624018[] = INCBIN_U16("graphics/pokenav/ribbons_icon2.gbapal"); +static const u16 gUnknown_08624038[] = INCBIN_U16("graphics/pokenav/ribbons_icon3.gbapal"); +static const u16 gUnknown_08624058[] = INCBIN_U16("graphics/pokenav/ribbons_icon4.gbapal"); +static const u16 gUnknown_08624078[] = INCBIN_U16("graphics/pokenav/ribbons_icon5.gbapal"); +static const u16 gUnknown_08624098[] = INCBIN_U16("graphics/pokenav/8624098.gbapal"); +static const u32 gUnknown_086240B8[] = INCBIN_U32("graphics/pokenav/ribbons_icon.4bpp.lz"); +static const u32 gUnknown_08624280[] = INCBIN_U32("graphics/pokenav/ribbons_icon_big.4bpp.lz"); + +static const struct BgTemplate gUnknown_08624B98[] = +{ + { + .bg = 1, + .charBaseIndex = 3, + .mapBaseIndex = 0x07, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 1, + .mapBaseIndex = 0x06, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + } +}; + +static const LoopedTask gUnknown_08624BA0[] = +{ + NULL, + sub_81D0C84, + sub_81D0D2C, + sub_81D0D8C, + sub_81D0E00, + sub_81D0C54 +}; // code +bool32 sub_81D0450(void) +{ + struct PokenavSub13 *structPtr = AllocSubstruct(13, sizeof(struct PokenavSub13)); + if (structPtr == NULL) + return FALSE; + + structPtr->field_8 = GetSubstructPtr(18); + if (structPtr->field_8 == NULL) + return FALSE; + + sub_81D0814(structPtr); + structPtr->field_98 = sub_81D04C4; + gKeyRepeatContinueDelay = 3; + gKeyRepeatStartDelay = 10; + return TRUE; +} + +u32 sub_81D04A0(void) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + return structPtr->field_98(structPtr); +} + +void sub_81D04B8(void) +{ + FreePokenavSubstruct(13); +} + +u32 sub_81D04C4(struct PokenavSub13 *structPtr) +{ + if (gMain.newAndRepeatedKeys & DPAD_UP && structPtr->field_8->unk2 != 0) + { + structPtr->field_8->unk2--; + structPtr->field_C = 0; + sub_81D0814(structPtr); + return 1; + } + else if (gMain.newAndRepeatedKeys & DPAD_DOWN && structPtr->field_8->unk2 < structPtr->field_8->unk0 - 1) + { + structPtr->field_8->unk2++; + structPtr->field_C = 0; + sub_81D0814(structPtr); + return 1; + } + else if (gMain.newKeys & A_BUTTON) + { + structPtr->field_98 = sub_81D0548; + return 2; + } + else if (gMain.newKeys & B_BUTTON) + { + structPtr->field_98 = sub_81D05D4; + return 5; + } + return 0; +} + +u32 sub_81D0548(struct PokenavSub13 *structPtr) +{ + if (gMain.newAndRepeatedKeys & DPAD_UP && sub_81D05DC(structPtr)) + return 3; + else if (gMain.newAndRepeatedKeys & DPAD_DOWN && sub_81D061C(structPtr)) + return 3; + else if (gMain.newAndRepeatedKeys & DPAD_LEFT && sub_81D0664(structPtr)) + return 3; + else if (gMain.newAndRepeatedKeys & DPAD_RIGHT && sub_81D0688(structPtr)) + return 3; + else if (gMain.newKeys & B_BUTTON) + { + structPtr->field_98 = sub_81D04C4; + return 4; + } + return 0; +} + +u32 sub_81D05D4(struct PokenavSub13 *structPtr) +{ + return 0x186ae; +} + +bool32 sub_81D05DC(struct PokenavSub13 *structPtr) +{ + if (structPtr->field_C < 25) + { + if (structPtr->field_C <= 8) + return FALSE; + + structPtr->field_C -= 9; + return TRUE; + } + if (structPtr->field_10 != 0) + { + u32 var = structPtr->field_C - 27; + structPtr->field_C = var + structPtr->field_E; + if (structPtr->field_C >= structPtr->field_10) + structPtr->field_C = structPtr->field_10 - 1; + return TRUE; + } + return FALSE; +} + +bool32 sub_81D061C(struct PokenavSub13 *structPtr) +{ + if (structPtr->field_C >= 25) + return FALSE; + if (structPtr->field_C < structPtr->field_E) + { + structPtr->field_C += 9; + if (structPtr->field_C >= structPtr->field_10) + structPtr->field_C = structPtr->field_10 - 1; + return TRUE; + } + if (structPtr->field_12 != 0) + { + int var = structPtr->field_C - structPtr->field_E; + if (var >= structPtr->field_12) + var = structPtr->field_12 - 1; + + structPtr->field_C = var + 27; + return TRUE; + } + return FALSE; +} + +bool32 sub_81D0664(struct PokenavSub13 *structPtr) +{ + u16 var = structPtr->field_C % 9; + if (var != 0) + { + structPtr->field_C--; + return TRUE; + } + + return FALSE; +} + +bool32 sub_81D0688(struct PokenavSub13 *structPtr) +{ + int r1 = structPtr->field_C % 9; + + if (r1 >= 8) + return FALSE; + + if (structPtr->field_C <= 26) + { + if (structPtr->field_C < structPtr->field_10 - 1) + { + structPtr->field_C++; + return TRUE; + } + } + else + { + if (r1 < structPtr->field_12 - 1) + { + structPtr->field_C++; + return TRUE; + } + } + return FALSE; +} + +u32 sub_81D06C4(void) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + return structPtr->field_8->unk2; +} + +u32 sub_81D06D4(void) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + return structPtr->field_8->unk0; +} + +static void GetCurrMonInfo1(u8 *nick, u8 *level, u8 *gender) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + struct PokenavSub18 *mons = structPtr->field_8; + struct PokenavMonList *monInfo = &mons->unk4[mons->unk2]; + + if (monInfo->boxId == TOTAL_BOXES_COUNT) + { + struct Pokemon *mon = &gPlayerParty[monInfo->monId]; + GetMonData(mon, MON_DATA_NICKNAME, nick); + *level = GetLevelFromMonExp(mon); + *gender = GetMonGender(mon); + } + else + { + struct BoxPokemon *boxMon = GetBoxedMonPtr(monInfo->boxId, monInfo->monId); + *gender = GetBoxMonGender(boxMon); + *level = GetLevelFromBoxMonExp(boxMon); + GetBoxMonData(boxMon, MON_DATA_NICKNAME, nick); + } + StringGetEnd10(nick); +} + +static void GetCurrMonInfo2(u16 *species, u32 *personality, u32 *otId) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + struct PokenavSub18 *mons = structPtr->field_8; + struct PokenavMonList *monInfo = &mons->unk4[mons->unk2]; + + if (monInfo->boxId == TOTAL_BOXES_COUNT) + { + struct Pokemon *mon = &gPlayerParty[monInfo->monId]; + *species = GetMonData(mon, MON_DATA_SPECIES); + *personality = GetMonData(mon, MON_DATA_PERSONALITY); + *otId = GetMonData(mon, MON_DATA_OT_ID); + } + else + { + struct BoxPokemon *boxMon = GetBoxedMonPtr(monInfo->boxId, monInfo->monId); + *species = GetBoxMonData(boxMon, MON_DATA_SPECIES); + *personality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY); + *otId = GetBoxMonData(boxMon, MON_DATA_OT_ID); + } +} + +static u32 GetCurrMonRibbonCount(void) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + struct PokenavSub18 *mons = structPtr->field_8; + struct PokenavMonList *monInfo = &mons->unk4[mons->unk2]; + + if (monInfo->boxId == TOTAL_BOXES_COUNT) + return GetMonData(&gPlayerParty[monInfo->monId], MON_DATA_RIBBON_COUNT); + else + return GetBoxMonDataAt(monInfo->boxId, monInfo->monId, MON_DATA_RIBBON_COUNT); +} + +void sub_81D0814(struct PokenavSub13 *structPtr) +{ + u32 ribbons; + s32 i, j; + struct PokenavSub18 *mons = structPtr->field_8; + struct PokenavMonList *monInfo = &mons->unk4[mons->unk2]; + + if (monInfo->boxId == TOTAL_BOXES_COUNT) + ribbons = GetMonData(&gPlayerParty[monInfo->monId], MON_DATA_RIBBONS); + else + ribbons = GetBoxMonDataAt(monInfo->boxId, monInfo->monId, MON_DATA_RIBBONS); + + structPtr->field_10 = 0; + structPtr->field_12 = 0; + for (i = 0; i < ARRAY_COUNT(gUnknown_086237F8); i++) + { + s32 r4 = ((1 << gUnknown_086237F8[i].unk0) - 1) & ribbons; + if (gUnknown_086237F8[i].unk3 == 0) + { + for (j = 0; j < r4; j++) + structPtr->field_14[structPtr->field_10++] = gUnknown_086237F8[i].unk2 + j; + } + else + { + for (j = 0; j < r4; j++) + structPtr->field_78[structPtr->field_12++] = gUnknown_086237F8[i].unk2 + j; + } + ribbons >>= gUnknown_086237F8[i].unk0; + } + + if (structPtr->field_10 != 0) + { + structPtr->field_E = ((structPtr->field_10 - 1) / 9) * 9; + structPtr->field_C = 0; + } + else + { + structPtr->field_E = 0; + structPtr->field_C = 27; + } +} + +u32 *sub_81D0914(u32 *arg0) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + *arg0 = structPtr->field_10; + return structPtr->field_14; +} + +u32 *sub_81D092C(u32 *arg0) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + *arg0 = structPtr->field_12; + return structPtr->field_78; +} + +u16 sub_81D0944(void) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + return structPtr->field_C; +} + +u32 sub_81D0954(void) +{ + struct PokenavSub13 *structPtr = GetSubstructPtr(13); + int var = structPtr->field_C; + if (var <= 24) + return structPtr->field_14[var]; + else + return structPtr->field_78[var - 27]; +} + +bool32 sub_81D0978(void) +{ + struct PokenavSub14 *structPtr = AllocSubstruct(14, sizeof(struct PokenavSub14)); + if (structPtr == NULL) + return FALSE; + + structPtr->loopedTaskId = CreateLoopedTask(sub_81D0A6C, 1); + structPtr->field_0 = sub_81D0A58; + return TRUE; +} + +void sub_81D09B0(int id) +{ + struct PokenavSub14 *structPtr = GetSubstructPtr(14); + structPtr->loopedTaskId = CreateLoopedTask(gUnknown_08624BA0[id], 1); + structPtr->field_0 = sub_81D0A58; +} + +u32 sub_81D09E0(void) +{ + struct PokenavSub14 *structPtr = GetSubstructPtr(14); + return structPtr->field_0(); +} + +void sub_81D09F4(void) +{ + struct PokenavSub14 *structPtr = GetSubstructPtr(14); + RemoveWindow(structPtr->field_A); + RemoveWindow(structPtr->field_8); + RemoveWindow(structPtr->field_C); + RemoveWindow(structPtr->field_E); + sub_81D1178(structPtr); + FreeSpriteTilesByTag(9); + FreeSpritePaletteByTag(0xF); + FreeSpritePaletteByTag(0x10); + FreeSpritePaletteByTag(0x11); + FreeSpritePaletteByTag(0x12); + FreeSpritePaletteByTag(0x13); + FreeSpriteOamMatrix(structPtr->field_14); + DestroySprite(structPtr->field_14); + FreePokenavSubstruct(14); +} + +bool32 sub_81D0A58(void) +{ + struct PokenavSub14 *structPtr = GetSubstructPtr(14); + return IsLoopedTaskActive(structPtr->loopedTaskId); +} + +u32 sub_81D0A6C(s32 state) +{ + struct PokenavSub14 *structPtr = GetSubstructPtr(14); + switch (state) + { + case 0: + InitBgTemplates(gUnknown_08624B98, ARRAY_COUNT(gUnknown_08624B98)); + decompress_and_copy_tile_data_to_vram(2, gUnknown_08DDE030, 0, 0, 0); + SetBgTilemapBuffer(2, structPtr->tilemapBuffers[0]); + CopyToBgTilemapBuffer(2, gUnknown_08DDE12C, 0, 0); + CopyPaletteIntoBufferUnfaded(gUnknown_08DDE010, 0x10, 0x20); + CopyBgTilemapBufferToVram(2); + return LT_INC_AND_PAUSE; + case 1: + if (!free_temp_tile_data_buffers_if_possible()) + { + sub_8199DF0(1, 0, 0, 1); + decompress_and_copy_tile_data_to_vram(1, gUnknown_086240B8, 0, 1, 0); + SetBgTilemapBuffer(1, structPtr->tilemapBuffers[1]); + FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 32, 20); + CopyPaletteIntoBufferUnfaded(gUnknown_08623FF8, 0x20, 0xA0); + CopyPaletteIntoBufferUnfaded(gUnknown_08624098, 0xA0, 0x20); + CopyBgTilemapBufferToVram(1); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 2: + if (!free_temp_tile_data_buffers_if_possible()) + { + sub_81D0E60(structPtr); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 3: + if (!free_temp_tile_data_buffers_if_possible()) + { + sub_81D0FCC(structPtr); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 4: + if (!free_temp_tile_data_buffers_if_possible()) + { + sub_81D10A4(structPtr); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 5: + if (!IsDma3ManagerBusyWithBgCopy()) + { + CopyBgTilemapBufferToVram(2); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 6: + if (!IsDma3ManagerBusyWithBgCopy()) + { + sub_81D1148(structPtr); + return LT_INC_AND_CONTINUE; + } + return LT_PAUSE; + case 7: + sub_81D12D8(structPtr); + sub_81C7BA4(10); + return LT_INC_AND_PAUSE; + case 8: + if (!IsDma3ManagerBusyWithBgCopy()) + { + sub_81D13FC(structPtr); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + ChangeBgX(2, 0, 0); + ChangeBgY(2, 0, 0); + ShowBg(1); + ShowBg(2); + HideBg(3); + sub_81C7AC0(1); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 9: + if (IsPaletteFadeActive()) + return LT_PAUSE; + return LT_FINISH; + } + return LT_FINISH; +} + +u32 sub_81D0C54(s32 state) +{ + switch (state) + { + case 0: + PlaySE(SE_SELECT); + sub_81C7AC0(0); + return LT_INC_AND_PAUSE; + case 1: + if (IsPaletteFadeActive()) + return LT_PAUSE; + return LT_FINISH; + } + return LT_FINISH; +} + +u32 sub_81D0C84(s32 state) +{ + struct PokenavSub14 *structPtr = GetSubstructPtr(14); + switch (state) + { + case 0: + PlaySE(SE_SELECT); + sub_81D11D8(structPtr); + return LT_INC_AND_PAUSE; + case 1: + if (!sub_81D1234(structPtr)) + { + sub_81D0FF0(structPtr); + return LT_INC_AND_CONTINUE; + } + return LT_PAUSE; + case 2: + sub_81D12D8(structPtr); + return LT_INC_AND_CONTINUE; + case 3: + sub_81D10D0(structPtr); + return LT_INC_AND_CONTINUE; + case 4: + sub_81D0E84(structPtr); + return LT_INC_AND_CONTINUE; + case 5: + if (!IsDma3ManagerBusyWithBgCopy()) + { + sub_81D11FC(structPtr); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 6: + if (sub_81D1234(structPtr)) + return LT_PAUSE; + return LT_FINISH; + } + return LT_FINISH; +} + +u32 sub_81D0D2C(s32 state) +{ + struct PokenavSub14 *structPtr = GetSubstructPtr(14); + switch (state) + { + case 0: + PlaySE(SE_SELECT); + sub_81D1448(structPtr); + return LT_INC_AND_PAUSE; + case 1: + if (!sub_81D1524(structPtr)) + { + sub_81D0EFC(structPtr); + sub_81C7BA4(11); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 2: + if (IsDma3ManagerBusyWithBgCopy()) + return LT_PAUSE; + } + return LT_FINISH; +} + +u32 sub_81D0D8C(s32 state) +{ + struct PokenavSub14 *structPtr = GetSubstructPtr(14); + switch (state) + { + case 0: + PlaySE(SE_SELECT); + sub_81D1500(structPtr); + return LT_INC_AND_PAUSE; + case 1: + if (!sub_81D1524(structPtr)) + { + sub_81D1448(structPtr); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 2: + if (!sub_81D1524(structPtr)) + { + sub_81D0EFC(structPtr); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 3: + if (IsDma3ManagerBusyWithBgCopy()) + return LT_PAUSE; + } + return LT_FINISH; +} + +u32 sub_81D0E00(s32 state) +{ + struct PokenavSub14 *structPtr = GetSubstructPtr(14); + switch (state) + { + case 0: + PlaySE(SE_SELECT); + sub_81D1500(structPtr); + return LT_INC_AND_PAUSE; + case 1: + if (!sub_81D1524(structPtr)) + { + sub_81D0E84(structPtr); + sub_81C7BA4(10); + return LT_INC_AND_PAUSE; + } + return LT_PAUSE; + case 2: + if (IsDma3ManagerBusyWithBgCopy()) + return LT_PAUSE; + } + return LT_FINISH; +} + static const struct WindowTemplate gUnknown_08624BB8 = { .bg = 2, @@ -73,18 +743,18 @@ static const struct WindowTemplate gUnknown_08624BB8 = .baseBlock = 0x14, }; -void sub_81D0E60(struct Pokenav10Struct2 *structPtr) +void sub_81D0E60(struct PokenavSub14 *structPtr) { structPtr->field_A = AddWindow(&gUnknown_08624BB8); PutWindowTilemap(structPtr->field_A); sub_81D0E84(structPtr); } -void sub_81D0E84(struct Pokenav10Struct2 *structPtr) +void sub_81D0E84(struct PokenavSub14 *structPtr) { u8 color[] = {4, 2, 3}; - ConvertIntToDecimalStringN(gStringVar1, sub_81D07D8(), STR_CONV_MODE_LEFT_ALIGN, 2); + ConvertIntToDecimalStringN(gStringVar1, GetCurrMonRibbonCount(), STR_CONV_MODE_LEFT_ALIGN, 2); DynamicPlaceholderTextUtil_Reset(); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1); DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_RibbonsF700); @@ -93,7 +763,7 @@ void sub_81D0E84(struct Pokenav10Struct2 *structPtr) CopyWindowToVram(structPtr->field_A, 2); } -void sub_81D0EFC(struct Pokenav10Struct2 *structPtr) +void sub_81D0EFC(struct PokenavSub14 *structPtr) { s32 i; u32 ribbonId = sub_81D0954(); @@ -130,7 +800,7 @@ static const struct WindowTemplate gUnknown_08624BC4 = .baseBlock = 0x54, }; -void sub_81D0FCC(struct Pokenav10Struct2 *structPtr) +void sub_81D0FCC(struct PokenavSub14 *structPtr) { structPtr->field_8 = AddWindow(&gUnknown_08624BC4); PutWindowTilemap(structPtr->field_8); @@ -141,7 +811,7 @@ static const u8 sMaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE static const u8 sFemaleIconString[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); static const u8 sGenderlessIconString[] = _("{UNK_SPACER}"); -void sub_81D0FF0(struct Pokenav10Struct2 *structPtr) +void sub_81D0FF0(struct PokenavSub14 *structPtr) { const u8 *genderTxt; u8 *txtPtr; @@ -149,7 +819,7 @@ void sub_81D0FF0(struct Pokenav10Struct2 *structPtr) u16 windowId = structPtr->field_8; FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); - sub_81D06E4(gStringVar3, &level, &gender); + GetCurrMonInfo1(gStringVar3, &level, &gender); AddTextPrinterParameterized(windowId, 1, gStringVar3, 0, 1, TEXT_SPEED_FF, NULL); switch (gender) { @@ -187,7 +857,7 @@ static const struct WindowTemplate gUnknown_08624BE8[] = {}, }; -void sub_81D10A4(struct Pokenav10Struct2 *structPtr) +void sub_81D10A4(struct PokenavSub14 *structPtr) { structPtr->field_C = AddWindow(gUnknown_08624BE8); FillWindowPixelBuffer(structPtr->field_C, PIXEL_FILL(1)); @@ -195,7 +865,7 @@ void sub_81D10A4(struct Pokenav10Struct2 *structPtr) sub_81D10D0(structPtr); } -void sub_81D10D0(struct Pokenav10Struct2 *structPtr) +void sub_81D10D0(struct PokenavSub14 *structPtr) { s32 x; u8 *txtPtr; @@ -210,18 +880,18 @@ void sub_81D10D0(struct Pokenav10Struct2 *structPtr) CopyWindowToVram(structPtr->field_C, 2); } -void sub_81D1148(struct Pokenav10Struct2 *structPtr) +void sub_81D1148(struct PokenavSub14 *structPtr) { u16 species; u32 personality, otId; - sub_81D0760(&species, &personality, &otId); + GetCurrMonInfo2(&species, &personality, &otId); ResetAllPicSprites(); structPtr->field_10 = sub_81D1184(40, 104); sub_81C7990(15, 0); } -void sub_81D1178(struct Pokenav10Struct2 *structPtr) +void sub_81D1178(struct PokenavSub14 *structPtr) { FreeAndDestroyMonPicSprite(structPtr->field_10); } @@ -231,25 +901,25 @@ u16 sub_81D1184(s32 unused0, s32 unused1) u16 species, spriteId; u32 personality, otId; - sub_81D0760(&species, &personality, &otId); + GetCurrMonInfo2(&species, &personality, &otId); spriteId = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, 40, 104, 15, 0xFFFF); gSprites[spriteId].oam.priority = 0; return spriteId; } -void sub_81D11D8(struct Pokenav10Struct2 *structPtr) +void sub_81D11D8(struct PokenavSub14 *structPtr) { sub_81D1258(&gSprites[structPtr->field_10], 40, -32, 6); } -void sub_81D11FC(struct Pokenav10Struct2 *structPtr) +void sub_81D11FC(struct PokenavSub14 *structPtr) { FreeAndDestroyMonPicSprite(structPtr->field_10); structPtr->field_10 = sub_81D1184(-32, 104); sub_81D1258(&gSprites[structPtr->field_10], -32, 40, 6); } -bool32 sub_81D1234(struct Pokenav10Struct2 *structPtr) +bool32 sub_81D1234(struct PokenavSub14 *structPtr) { return (gSprites[structPtr->field_10].callback != SpriteCallbackDummy); } @@ -286,7 +956,7 @@ void sub_81D1284(struct Sprite *sprite) } } -void sub_81D12D8(void) +void sub_81D12D8(struct PokenavSub14 *structPtr) { u32 *ptr; @@ -439,7 +1109,7 @@ static const struct SpriteTemplate gUnknown_08624D04 = .callback = SpriteCallbackDummy, }; -void sub_81D13FC(struct Pokenav10Struct *structPtr) +void sub_81D13FC(struct PokenavSub14 *structPtr) { u8 spriteId; @@ -451,7 +1121,7 @@ void sub_81D13FC(struct Pokenav10Struct *structPtr) structPtr->field_14->invisible = TRUE; } -void sub_81D1448(struct Pokenav10Struct *structPtr) +void sub_81D1448(struct PokenavSub14 *structPtr) { u32 ribbonId; s32 r4 = sub_81D0944(); @@ -471,14 +1141,14 @@ void sub_81D1448(struct Pokenav10Struct *structPtr) structPtr->field_14->callback = sub_81D1538; } -void sub_81D1500(struct Pokenav10Struct *structPtr) +void sub_81D1500(struct PokenavSub14 *structPtr) { structPtr->field_14->data[0] = 1; StartSpriteAffineAnim(structPtr->field_14, 2); structPtr->field_14->callback = sub_81D1538; } -bool32 sub_81D1524(struct Pokenav10Struct *structPtr) +bool32 sub_81D1524(struct PokenavSub14 *structPtr) { return (structPtr->field_14->callback != SpriteCallbackDummy); } diff --git a/src/pokenav_unk_2.c b/src/pokenav_unk_2.c index 3aec4685e..60aa5ea5e 100644 --- a/src/pokenav_unk_2.c +++ b/src/pokenav_unk_2.c @@ -1,6 +1,261 @@ #include "global.h" +#include "bg.h" #include "gym_leader_rematch.h" #include "pokenav.h" +#include "sprite.h" +#include "window.h" +#include "strings.h" +#include "scanline_effect.h" + +extern const u32 gPokenavOptions_Gfx[]; +extern const u16 gPokenavOptions_Pal[]; + +const u16 gUnknown_0861FC78[] = INCBIN_U16("graphics/pokenav/bg.gbapal"); +const u32 gUnknown_0861FC98[] = INCBIN_U32("graphics/pokenav/bg.4bpp.lz"); +const u32 gUnknown_0861FCAC[] = INCBIN_U32("graphics/pokenav/bg.bin.lz"); +const u16 gUnknown_0861FD4C[] = INCBIN_U16("graphics/pokenav/outline.gbapal"); +const u32 gUnknown_0861FD6C[] = INCBIN_U32("graphics/pokenav/outline.4bpp.lz"); +const u32 gUnknown_0861FFF4[] = INCBIN_U32("graphics/pokenav/outline_map.bin.lz"); +const u16 gUnknown_08620104[] = INCBIN_U16("graphics/pokenav/blue_light.gbapal"); +const u32 gUnknown_08620124[] = INCBIN_U32("graphics/pokenav/blue_light.4bpp.lz"); + +const struct BgTemplate gUnknown_08620194[3] = +{ + { + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 0x0F, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 0x17, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 3, + .mapBaseIndex = 0x1F, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + } +}; + +u32 sub_81C9C6C(s32); +u32 sub_81C9CA8(s32); +u32 sub_81C9D44(s32); +u32 sub_81C9DD8(s32); +u32 sub_81C9E58(s32); +u32 sub_81C9EC8(s32); +u32 sub_81C9EF8(s32); +u32 sub_81C9F28(s32); + +u32 (*const gUnknown_086201A0[])(s32) = +{ + NULL, + sub_81C9C6C, + sub_81C9CA8, + sub_81C9D44, + sub_81C9DD8, + sub_81C9E58, + sub_81C9EC8, + sub_81C9EF8, + sub_81C9F28 +}; + +const struct CompressedSpriteSheet gUnknown_086201C4[] = +{ + { + .data = gPokenavOptions_Gfx, + .size = 0x3400, + .tag = 0x0003 + }, + { + .data = gUnknown_08620124, + .size = 0x0100, + .tag = 0x0001 + } +}; + + const struct SpritePalette gUnknown_086201D4[] = + { + {gPokenavOptions_Pal + 0x00, 4}, + {gPokenavOptions_Pal + 0x10, 5}, + {gPokenavOptions_Pal + 0x20, 6}, + {gPokenavOptions_Pal + 0x30, 7}, + {gPokenavOptions_Pal + 0x40, 8}, + {gUnknown_08620104, 3}, + {} +}; + +const u16 gUnknown_0862020C[] = {0, 0}; +const u16 gUnknown_08620210[] = {0x20, 1}; +const u16 gUnknown_08620214[] = {0x40, 4}; +const u16 gUnknown_08620218[] = {0x60, 2}; +const u16 gUnknown_0862021C[] = {0x80, 3}; +const u16 gUnknown_08620220[] = {0xA0, 1}; +const u16 gUnknown_08620224[] = {0xC0, 1}; +const u16 gUnknown_08620228[] = {0xE0, 4}; +const u16 gUnknown_0862022C[] = {0x100, 1}; +const u16 gUnknown_08620230[] = {0x120, 2}; +const u16 gUnknown_08620234[] = {0x140, 0}; +const u16 gUnknown_08620238[] = {0x160, 0}; +const u16 gUnknown_0862023C[] = {0x180, 3}; + +struct UnkStruct_08620240 +{ + u16 unk0; + u16 unk2; + const u16 *unk4[6]; +}; + +const struct UnkStruct_08620240 gUnknown_08620240[5] = +{ + { + 0x2A, + 0x14, + {gUnknown_0862020C, gUnknown_08620210, gUnknown_0862021C, NULL, NULL, NULL} + }, + { + 0x2A, + 0x14, + {gUnknown_0862020C, gUnknown_08620210, gUnknown_08620214, gUnknown_0862021C, NULL, NULL} + }, + { + 0x2A, + 0x14, + {gUnknown_0862020C, gUnknown_08620210, gUnknown_08620214, gUnknown_08620218, gUnknown_0862021C, NULL} + }, + { + 0x38, + 0x14, + {gUnknown_08620220, gUnknown_08620224, gUnknown_0862023C, NULL, NULL, NULL} + }, + { + 0x28, + 0x10, + {gUnknown_08620228, gUnknown_0862022C, gUnknown_08620230, gUnknown_08620234, gUnknown_08620238, gUnknown_0862023C} + }, +}; + +const struct WindowTemplate gUnknown_086202CC = +{ + .bg = 1, + .tilemapLeft = 3, + .tilemapTop = 17, + .width = 0x18, + .height = 0x2, + .paletteNum = 1, + .baseBlock = 8 +}; + +const u8 *const gUnknown_086202D4[] = +{ + gUnknown_085EBCC5, + gUnknown_085EBCE8, + gUnknown_085EBD01, + gUnknown_085EBD1C, + gUnknown_085EBD34, + gUnknown_085EBD83, + gUnknown_085EBDA2, + gUnknown_085EBDBF, + gUnknown_085EBDDB, + gUnknown_085EBDEE, + gUnknown_085EBE06, + gUnknown_085EBE19, + gUnknown_085EBE2D, + gUnknown_085EBE41 +}; + +const u8 gUnknown_0862030C[] = {6, 8, 7}; + +const u8 gUnknown_0862030F[] = {6, 8, 7, 0, 0}; + +const struct OamData gUnknown_08620314 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .bpp = 0, + .shape = SPRITE_SHAPE(32x16), + .x = 0, + .size = SPRITE_SIZE(32x16), + .tileNum = 0, + .priority = 2, + .paletteNum = 0, +}; + +const union AffineAnimCmd gUnknown_0862031C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd gUnknown_0862032C[] = +{ + AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0), + AFFINEANIMCMD_FRAME(0x10, 0x10, 0, 0x12), + AFFINEANIMCMD_END, +}; + +const union AffineAnimCmd *const gUnknown_08620344[] = +{ + gUnknown_0862031C, + gUnknown_0862032C +}; + +const struct SpriteTemplate gUnknown_0862034C = +{ + .tileTag = 3, + .paletteTag = 4, + .oam = &gUnknown_08620314, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gUnknown_08620344, + .callback = SpriteCallbackDummy, +}; + +const struct OamData gUnknown_08620364 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .bpp = 0, + .shape = SPRITE_SHAPE(32x16), + .x = 0, + .size = SPRITE_SIZE(32x16), + .tileNum = 0, + .priority = 2, + .paletteNum = 0, +}; + +const struct SpriteTemplate gUnknown_0862036C = +{ + .tileTag = 1, + .paletteTag = 3, + .oam = &gUnknown_08620364, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +const struct ScanlineEffectParams gUnknown_08620384 = +{ + (void *)REG_ADDR_WIN0H, + ((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_DEST_RELOAD) << 16) | 1, + 1, + 0 +}; bool32 sub_81C98D4(void) { diff --git a/src/pokenav_unk_3.c b/src/pokenav_unk_3.c index 404743345..9b62bea78 100755 --- a/src/pokenav_unk_3.c +++ b/src/pokenav_unk_3.c @@ -34,12 +34,13 @@ static u32 sub_81CABFC(struct Pokenav3Struct *); static u32 sub_81CAC04(struct Pokenav3Struct *); static u32 sub_81CACB8(struct Pokenav3Struct *); static u32 sub_81CACF8(struct Pokenav3Struct *); -static u32 sub_81CAD20(int); +static u32 sub_81CAD20(s32); static bool32 sub_81CB1D0(void); -extern const u8 gUnknown_08622508[]; -extern const u8 gUnknown_0862250A[]; -extern const u8 *const gUnknown_08622028[][4]; +#include "data/text/match_call_messages.h" + +const u8 gUnknown_08622508[] = {0, 2}; +const u8 gUnknown_0862250A[] = {0, 1, 2}; bool32 sub_81CAAE8(void) { @@ -190,7 +191,7 @@ static u32 sub_81CACF8(struct Pokenav3Struct *state) return 0; } -static u32 sub_81CAD20(int taskState) +static u32 sub_81CAD20(s32 taskState) { int i, j; struct Pokenav3Struct *state = GetSubstructPtr(5); @@ -207,7 +208,7 @@ static u32 sub_81CAD20(int taskState) { state->unk1C[state->unkA].unk2 = j; state->unk1C[state->unkA].unk0 = 1; - state->unk1C[state->unkA].unk1 = sub_81D16DC(j); + state->unk1C[state->unkA].unk1 = MatchCallMapSecGetByIndex(j); state->unkA++; } @@ -364,7 +365,7 @@ const u8 *sub_81CAFD8(int index, int textType) var0 = state->unk1C[index].unk2; } - return gUnknown_08622028[var0][textType]; + return gMatchCallMessages[var0][textType]; } u16 sub_81CB01C(void) diff --git a/src/pokenav_unk_4.c b/src/pokenav_unk_4.c index 6fa76daf2..93dab4491 100755 --- a/src/pokenav_unk_4.c +++ b/src/pokenav_unk_4.c @@ -50,7 +50,7 @@ struct Pokenav4Struct }; static bool32 sub_81CB310(void); -static u32 sub_81CB324(int); +static u32 sub_81CB324(s32); static void sub_81CBBB8(void); static void sub_81CBC1C(void); static void sub_81CC2B4(void); @@ -93,27 +93,191 @@ static void sub_81CC330(struct Pokenav4Struct *); static struct Sprite *sub_81CC370(void); static void sub_81CC440(struct Sprite *sprite); static void sub_81CC4A4(struct Sprite *sprite); +void sub_81CC34C(struct Sprite *sprite); +u32 sub_81CB510(s32); +u32 sub_81CB588(s32); +u32 sub_81CB600(s32); +u32 sub_81CB678(s32); +u32 sub_81CB6F0(s32); +u32 sub_81CB734(s32); +u32 sub_81CB75C(s32); +u32 sub_81CB7A0(s32); +u32 sub_81CB824(s32); +u32 sub_81CB888(s32); +u32 sub_81CB93C(s32); +u32 sub_81CBAD4(s32); +u32 sub_81CB9C8(s32); +u32 sub_81CBA68(s32); +u32 sub_81CBB74(s32); -extern const LoopedTask gUnknown_08622798[]; -extern const struct BgTemplate gUnknown_0862278C[3]; -extern const u16 gUnknown_08622510[]; -extern const u32 gUnknown_08622530[]; -extern const u32 gUnknown_08622760[]; -extern const u16 gUnknown_08622700[]; -extern const u16 gUnknown_08622720[]; -extern const u8 gUnknown_086225D4[]; -extern const u16 gUnknown_086226E0[]; -extern const struct BgTemplate gUnknown_08622794; -extern const struct WindowTemplate gUnknown_086227D8; -extern const struct WindowTemplate gUnknown_086227E0; -extern const u8 *const gUnknown_086227E8[]; extern const struct WindowTemplate gUnknown_08622808; -extern const u8 gUnknown_086227F4[]; -extern const struct CompressedSpriteSheet gUnknown_08622810[1]; -extern const struct SpritePalette gUnknown_08622818[]; extern const struct SpriteTemplate gUnknown_08622830; extern const struct SpriteTemplate gUnknown_08622850; +const u16 gUnknown_08622510[] = INCBIN_U16("graphics/pokenav/ui_matchcall.gbapal"); +const u32 gUnknown_08622530[] = INCBIN_U32("graphics/pokenav/ui_matchcall.4bpp.lz"); +const u32 gUnknown_086225D4[] = INCBIN_U32("graphics/pokenav/ui_matchcall.bin.lz"); +const u16 gUnknown_08622698[] = INCBIN_U16("graphics/pokenav/arrow2.gbapal"); +const u32 gUnknown_086226B8[] = INCBIN_U32("graphics/pokenav/arrow2.4bpp.lz"); +const u16 gUnknown_086226E0[] = INCBIN_U16("graphics/pokenav/86226E0.gbapal"); +const u16 gUnknown_08622700[] = INCBIN_U16("graphics/pokenav/8622700.gbapal"); +const u16 gUnknown_08622720[] = INCBIN_U16("graphics/pokenav/pokeball_matchcall.gbapal"); +const u32 gUnknown_08622760[] = INCBIN_U32("graphics/pokenav/pokeball_matchcall.4bpp.lz"); + +const struct BgTemplate gUnknown_0862278C[3] = +{ + { + .bg = 1, + .charBaseIndex = 3, + .mapBaseIndex = 0x1F, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 0x06, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0x80 + }, + { + .bg = 3, + .charBaseIndex = 1, + .mapBaseIndex = 0x07, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + } +}; + +const LoopedTask gUnknown_08622798[] = +{ + NULL, + sub_81CB510, + sub_81CB588, + sub_81CB600, + sub_81CB678, + sub_81CB6F0, + sub_81CB734, + sub_81CB75C, + sub_81CB7A0, + sub_81CB824, + sub_81CB888, + sub_81CB93C, + sub_81CBAD4, + sub_81CB9C8, + sub_81CBA68, + sub_81CBB74 +}; + +const struct WindowTemplate gUnknown_086227D8 = +{ + .bg = 2, + .tilemapLeft = 0, + .tilemapTop = 5, + .width = 11, + .height = 2, + .paletteNum = 2, + .baseBlock = 16 +}; + +const struct WindowTemplate gUnknown_086227E0 = +{ + .bg = 2, + .tilemapLeft = 0, + .tilemapTop = 9, + .width = 11, + .height = 8, + .paletteNum = 2, + .baseBlock = 38 +}; + +const u8 *const gUnknown_086227E8[] = +{ + gUnknown_085EC017, + gUnknown_085EC01C, + gUnknown_085EC022 +}; + +const u8 gUnknown_086227F4[] = _("·{PAUSE 0x04}·{PAUSE 0x04}·{PAUSE 0x04}·{PAUSE 0x04}·\p"); + +const struct WindowTemplate gUnknown_08622808 = +{ + .bg = 1, + .tilemapLeft = 1, + .tilemapTop = 12, + .width = 0x1C, + .height = 0x04, + .paletteNum = 1, + .baseBlock = 10 +}; + +const struct CompressedSpriteSheet gUnknown_08622810[1] = +{ + {gUnknown_086226B8, 0x40, 7} +}; + +const struct SpritePalette gUnknown_08622818[] = +{ + {gUnknown_08622698, 12}, + {} +}; + +const struct OamData gUnknown_08622828 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .bpp = 0, + .shape = SPRITE_SHAPE(8x16), + .x = 0, + .size = SPRITE_SIZE(8x16), + .tileNum = 0, + .priority = 1, + .paletteNum = 0, +}; + +const struct SpriteTemplate gUnknown_08622830 = +{ + .tileTag = 7, + .paletteTag = 12, + .oam = &gUnknown_08622828, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81CC34C, +}; + +const struct OamData gUnknown_08622848 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .bpp = 0, + .shape = SPRITE_SHAPE(64x64), + .x = 0, + .size = SPRITE_SIZE(64x64), + .tileNum = 0, + .priority = 1, + .paletteNum = 0, +}; + +const struct SpriteTemplate gUnknown_08622850 = +{ + .tileTag = 8, + .paletteTag = 13, + .oam = &gUnknown_08622848, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + bool32 sub_81CB260(void) { struct Pokenav4Struct *state = AllocSubstruct(6, sizeof(struct Pokenav4Struct)); @@ -156,7 +320,7 @@ static bool32 sub_81CB310(void) return IsLoopedTaskActive(state->unk4); } -static u32 sub_81CB324(int taskState) +static u32 sub_81CB324(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -229,7 +393,7 @@ static u32 sub_81CB324(int taskState) } } -u32 sub_81CB510(int taskState) +u32 sub_81CB510(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -266,7 +430,7 @@ u32 sub_81CB510(int taskState) return 4; } -u32 sub_81CB588(int taskState) +u32 sub_81CB588(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -303,7 +467,7 @@ u32 sub_81CB588(int taskState) return 4; } -u32 sub_81CB600(int taskState) +u32 sub_81CB600(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -340,7 +504,7 @@ u32 sub_81CB600(int taskState) return 4; } -u32 sub_81CB678(int taskState) +u32 sub_81CB678(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -377,7 +541,7 @@ u32 sub_81CB678(int taskState) return 4; } -u32 sub_81CB6F0(int taskState) +u32 sub_81CB6F0(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -396,7 +560,7 @@ u32 sub_81CB6F0(int taskState) return 4; } -u32 sub_81CB734(int taskState) +u32 sub_81CB734(s32 taskState) { struct Pokenav4Struct *state; u16 var0; @@ -408,7 +572,7 @@ u32 sub_81CB734(int taskState) return 4; } -u32 sub_81CB75C(int taskState) +u32 sub_81CB75C(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -427,7 +591,7 @@ u32 sub_81CB75C(int taskState) return 4; } -u32 sub_81CB7A0(int taskState) +u32 sub_81CB7A0(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -459,7 +623,7 @@ u32 sub_81CB7A0(int taskState) return 4; } -u32 sub_81CB824(int taskState) +u32 sub_81CB824(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -485,7 +649,7 @@ u32 sub_81CB824(int taskState) return 4; } -u32 sub_81CB888(int taskState) +u32 sub_81CB888(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); u32 result = 0; @@ -549,7 +713,7 @@ u32 sub_81CB888(int taskState) return result; } -u32 sub_81CB93C(int taskState) +u32 sub_81CB93C(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -578,7 +742,7 @@ u32 sub_81CB93C(int taskState) return 4; } -u32 sub_81CB9C8(int taskState) +u32 sub_81CB9C8(s32 taskState) { int index; int var0; @@ -617,7 +781,7 @@ u32 sub_81CB9C8(int taskState) return 4; } -u32 sub_81CBA68(int taskState) +u32 sub_81CBA68(s32 taskState) { struct Pokenav4Struct *state = GetSubstructPtr(6); switch (taskState) @@ -643,7 +807,7 @@ u32 sub_81CBA68(int taskState) return 4; } -u32 sub_81CBAD4(int taskState) +u32 sub_81CBAD4(s32 taskState) { int index; int var0; @@ -682,7 +846,7 @@ u32 sub_81CBAD4(int taskState) return 4; } -u32 sub_81CBB74(int taskState) +u32 sub_81CBB74(s32 taskState) { switch (taskState) { @@ -718,7 +882,7 @@ static void sub_81CBBB8(void) template.unkE = 7; template.unk10 = sub_81CB050; template.unk14 = sub_81CBCEC; - sub_81C81D4(&gUnknown_08622794, &template, 2); + sub_81C81D4(&gUnknown_0862278C[2], &template, 2); CreateTask(sub_81CBC64, 7); } diff --git a/src/pokenav_unk_5.c b/src/pokenav_unk_5.c index eccc200d5..ccab58078 100755 --- a/src/pokenav_unk_5.c +++ b/src/pokenav_unk_5.c @@ -32,18 +32,18 @@ struct Pokenav5Struct_2 u8 cityZoomPics[22][0xC8]; }; -struct CityZoomPic +struct CityMapEntry { u16 mapSecId; - u16 unk2; - const u32 *data; + u16 index; + const u32 *tilemap; }; static u32 sub_81CC568(struct Pokenav5Struct *); static u32 sub_81CC5B4(struct Pokenav5Struct *); static u32 sub_81CC5DC(struct Pokenav5Struct *); -static u32 sub_81CC6F4(int); -static u32 sub_81CCD34(int); +static u32 sub_81CC6F4(s32); +static u32 sub_81CCD34(s32); static bool32 sub_81CC6BC(void); static void sub_81CC9EC(void); static void sub_81CC9C0(void); @@ -61,17 +61,110 @@ static void sub_81CCDE8(struct Pokenav5Struct_2 *, int, int); static void sub_81CCFA4(int); static void sub_81CCC9C(u8 taskId); static void sub_81CCF78(void); +void sub_81CCEF4(struct Sprite *sprite); +u32 sub_81CC848(s32); +u32 sub_81CC878(s32); +u32 sub_81CC8D8(s32); +u32 sub_81CC95C(s32); -extern const LoopedTask gUnknown_086230E4[]; -extern const struct BgTemplate gUnknown_086230D8[2]; -extern const struct CompressedSpriteSheet gUnknown_086230F8[1]; -extern const struct SpritePalette gUnknown_08623100[]; -extern const struct WindowTemplate gUnknown_08623110; -extern const u32 gUnknown_08622888[]; -extern const u16 gUnknown_08622868[]; extern const u16 gHoennMapZoomIcons_Pal[]; -extern const struct CityZoomPic gUnknown_08623118[22]; extern const struct SpriteTemplate gUnknown_086231D0; +extern const u32 gHoennMapZoomIcons_Gfx[]; + +const u16 gUnknown_08622868[] = INCBIN_U16("graphics/pokenav/8622868.gbapal"); +const u32 gUnknown_08622888[] = INCBIN_U32("graphics/pokenav/zoom_tiles.4bpp.lz"); + +#include "data/region_map/city_map_tilemaps.h" + + +const struct BgTemplate gUnknown_086230D8[3] = +{ + { + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 0x1F, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 0x06, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 0x00, + .screenSize = 2, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + }, +}; + +const LoopedTask gUnknown_086230E4[] = +{ + NULL, + sub_81CC848, + sub_81CC878, + sub_81CC8D8, + sub_81CC95C +}; + +const struct CompressedSpriteSheet gUnknown_086230F8[1] = +{ + {gHoennMapZoomIcons_Gfx, 0x800, 6} +}; + +const struct SpritePalette gUnknown_08623100[] = +{ + {gHoennMapZoomIcons_Pal, 11}, + {} +}; + +const struct WindowTemplate gUnknown_08623110 = +{ + .bg = 1, + .tilemapLeft = 17, + .tilemapTop = 4, + .width = 12, + .height = 13, + .paletteNum = 1, + .baseBlock = 0x4C +}; + +#include "data/region_map/city_map_entries.h" + +const struct OamData gUnknown_086231C8 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .bpp = 0, + .shape = SPRITE_SHAPE(32x8), + .x = 0, + .size = SPRITE_SIZE(32x8), + .tileNum = 0, + .priority = 1, + .paletteNum = 0, +}; + +const struct SpriteTemplate gUnknown_086231D0 = +{ + .tileTag = 6, + .paletteTag = 11, + .oam = &gUnknown_086231C8, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81CCEF4, +}; u32 sub_81CC4D4(void) { @@ -202,7 +295,7 @@ static bool8 sub_81CC6D0(void) return gSaveBlock2Ptr->regionMapZoom == 1; } -static u32 sub_81CC6F4(int taskState) +static u32 sub_81CC6F4(s32 taskState) { int var0; struct RegionMap *regionMap; @@ -215,7 +308,7 @@ static u32 sub_81CC6F4(int taskState) HideBg(2); HideBg(3); SetBgMode(1); - InitBgTemplates(gUnknown_086230D8, ARRAY_COUNT(gUnknown_086230D8)); + InitBgTemplates(gUnknown_086230D8, ARRAY_COUNT(gUnknown_086230D8) - 1); regionMap = GetSubstructPtr(16); sub_8122CF8(regionMap, &gUnknown_086230D8[1], sub_81CC6D0()); sub_81CC9C0(); @@ -278,7 +371,7 @@ static u32 sub_81CC6F4(int taskState) } } -u32 sub_81CC848(int taskState) +u32 sub_81CC848(s32 taskState) { struct Pokenav5Struct_2 *state = GetSubstructPtr(4); switch (taskState) @@ -295,7 +388,7 @@ u32 sub_81CC848(int taskState) return 4; } -u32 sub_81CC878(int taskState) +u32 sub_81CC878(s32 taskState) { switch (taskState) { @@ -321,7 +414,7 @@ u32 sub_81CC878(int taskState) return 4; } -u32 sub_81CC8D8(int taskState) +u32 sub_81CC8D8(s32 taskState) { struct Pokenav5Struct_2 *state = GetSubstructPtr(4); switch (taskState) @@ -354,7 +447,7 @@ u32 sub_81CC8D8(int taskState) return 4; } -u32 sub_81CC95C(int taskState) +u32 sub_81CC95C(s32 taskState) { switch (taskState) { @@ -518,12 +611,12 @@ static bool32 sub_81CCD24(void) return FuncIsActiveLoopedTask(sub_81CCD34); } -static u32 sub_81CCD34(int taskState) +static u32 sub_81CCD34(s32 taskState) { struct Pokenav5Struct_2 *state = GetSubstructPtr(4); - if (taskState < (int)ARRAY_COUNT(gUnknown_08623118)) + if (taskState < (int)ARRAY_COUNT(gPokenavCityMaps)) { - LZ77UnCompWram(gUnknown_08623118[taskState].data, state->cityZoomPics[taskState]); + LZ77UnCompWram(gPokenavCityMaps[taskState].tilemap, state->cityZoomPics[taskState]); return 1; } @@ -533,10 +626,10 @@ static u32 sub_81CCD34(int taskState) static void sub_81CCD70(struct Pokenav5Struct_2 *state, int mapSecId, int pos) { int i; - for (i = 0; i < (int)ARRAY_COUNT(gUnknown_08623118) && (gUnknown_08623118[i].mapSecId != mapSecId || gUnknown_08623118[i].unk2 != pos); i++) + for (i = 0; i < (int)ARRAY_COUNT(gPokenavCityMaps) && (gPokenavCityMaps[i].mapSecId != mapSecId || gPokenavCityMaps[i].index != pos); i++) ; - if (i == ARRAY_COUNT(gUnknown_08623118)) + if (i == ARRAY_COUNT(gPokenavCityMaps)) return; FillBgTilemapBufferRect_Palette0(1, 0x1041, 17, 6, 12, 11); diff --git a/src/pokenav_unk_6.c b/src/pokenav_unk_6.c new file mode 100644 index 000000000..638884d3f --- /dev/null +++ b/src/pokenav_unk_6.c @@ -0,0 +1,625 @@ +#include "global.h" +#include "data.h" +#include "decompress.h" +#include "main.h" +#include "menu_specialized.h" +#include "mon_markings.h" +#include "pokenav.h" +#include "pokemon.h" +#include "pokemon_storage_system.h" +#include "sound.h" +#include "string_util.h" +#include "strings.h" +#include "text.h" +#include "constants/songs.h" +#include "constants/species.h" + +struct PokenavSub11 +{ + u32 monPal[3][0x20]; + u8 fill[0x180]; + u32 monPicGfx[3][0x800]; + u8 unk6300; + s16 unk6302; + u32 (*unk6304)(struct PokenavSub11 *); + u8 fill2[0x6320 - 0x6308]; + u8 unk6320[3][24]; + u8 unk6368[3][64]; + struct UnknownStruct_81D1ED4 unk6428; + u8 unk6780[3]; + u8 unk6783[3]; + s8 unk6786; + s8 unk6787; + s8 unk6788; + s8 unk6789; + u8 unk678A; +}; + +void sub_81CD970(void); +void sub_81CD9F8(void); +u32 sub_81CD08C(struct PokenavSub11 *structPtr); +u32 sub_81CD19C(struct PokenavSub11 *structPtr); +u32 sub_81CD110(struct PokenavSub11 *structPtr); +u8 sub_81CD1E4(struct PokenavSub11 *structPtr); +u8 sub_81CD258(u8 arg0); +void sub_81CD824(s16 arg0, u8 arg1); +void sub_81CDA1C(s16 arg0, u8 arg1); +void sub_81CDB98(s16 arg0, u8 arg1); + +// code +bool32 sub_81CCFD8(void) +{ + struct PokenavSub11 *structPtr = AllocSubstruct(11, sizeof(struct PokenavSub11)); + + if (structPtr == NULL) + return FALSE; + + sub_81D1ED4(&structPtr->unk6428); + sub_81CD970(); + gKeyRepeatStartDelay = 20; + structPtr->unk6304 = sub_81CD08C; + return TRUE; +} + +bool32 sub_81CD024(void) +{ + struct PokenavSub11 *structPtr = AllocSubstruct(11, sizeof(struct PokenavSub11)); + + if (structPtr == NULL) + return FALSE; + + sub_81D1ED4(&structPtr->unk6428); + sub_81CD9F8(); + gKeyRepeatStartDelay = 20; + structPtr->unk6304 = sub_81CD08C; + return TRUE; +} + +u32 sub_81CD070(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + + return structPtr->unk6304(structPtr); +} + +u32 sub_81CD08C(struct PokenavSub11 *structPtr) +{ + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + u32 ret = sub_81CD1E4(structPtr); + + if (ret == 0) + { + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + structPtr->unk6304 = sub_81CD19C; + ret = 2; + } + else if (gMain.newKeys & A_BUTTON) + { + if (structPtr->unk6300 == 0) + { + if (unkPtr->unk2 == unkPtr->unk0 - 1) + { + PlaySE(SE_SELECT); + structPtr->unk6304 = sub_81CD19C; + ret = 2; + } + } + else + { + PlaySE(SE_SELECT); + ret = 5; + structPtr->unk6304 = sub_81CD110; + } + } + } + + return ret; +} + +u32 sub_81CD110(struct PokenavSub11 *structPtr) +{ + struct PokenavSub18 *unkPtr; + u8 markings; + u32 ret = 0, boxId, monId; + + if (!sub_811FBA4()) + { + structPtr->unk6783[structPtr->unk6786] = sub_81CEF14(); + unkPtr = GetSubstructPtr(18); + boxId = unkPtr->unk4[unkPtr->unk2].boxId; + monId = unkPtr->unk4[unkPtr->unk2].monId; + markings = structPtr->unk6783[structPtr->unk6786]; + + if (boxId == TOTAL_BOXES_COUNT) + SetMonData(&gPlayerParty[monId], MON_DATA_MARKINGS, &markings); + else + SetBoxMonDataAt(boxId, monId, MON_DATA_MARKINGS, &markings); + + structPtr->unk6304 = sub_81CD08C; + ret = 6; + } + + return ret; +} + +u32 sub_81CD19C(struct PokenavSub11 *structPtr) +{ + if (structPtr->unk6300 == 0) + return 0x186A2; + else + return 0x186AA; +} + +void sub_81CD1C0(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + if (structPtr->unk6300 == 0) + FreePokenavSubstruct(18); + + FreePokenavSubstruct(11); +} + +u8 sub_81CD1E4(struct PokenavSub11 *structPtr) +{ + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + u8 ret = 0; + + if (gMain.heldKeys & DPAD_UP) + { + if (structPtr->unk6300 == 0 || unkPtr->unk2 != 0) + { + PlaySE(SE_SELECT); + ret = sub_81CD258(1); + } + } + else if (gMain.heldKeys & DPAD_DOWN) + { + if (structPtr->unk6300 == 0 || unkPtr->unk2 < unkPtr->unk0 - 1) + { + PlaySE(SE_SELECT); + ret = sub_81CD258(0); + } + } + + return ret; +} + +u8 sub_81CD258(u8 arg0) +{ + u16 r7; + bool8 r6, r0; + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + + r7 = (arg0) ? structPtr->unk6788 : structPtr->unk6787; + sub_81D1F84(&structPtr->unk6428, structPtr->unk6428.unk14[structPtr->unk6786], structPtr->unk6428.unk14[r7]); + r6 = (unkPtr->unk2 != ((sub_81CDD5C() != 0) ? unkPtr->unk0 : unkPtr->unk0 - 1)); + if (arg0) + { + structPtr->unk6788 = structPtr->unk6787; + structPtr->unk6787 = structPtr->unk6786; + structPtr->unk6786 = r7; + structPtr->unk6789 = structPtr->unk6788; + + unkPtr->unk2 = (unkPtr->unk2 == 0) ? unkPtr->unk0 - 1 : unkPtr->unk2 - 1; + structPtr->unk6302 = (unkPtr->unk2 != 0) ? unkPtr->unk2 - 1 : unkPtr->unk0 - 1; + } + else + { + structPtr->unk6787 = structPtr->unk6788; + structPtr->unk6788 = structPtr->unk6786; + structPtr->unk6786 = r7; + structPtr->unk6789 = structPtr->unk6787; + + unkPtr->unk2 = (unkPtr->unk2 < unkPtr->unk0 - 1) ? unkPtr->unk2 + 1 : 0; + structPtr->unk6302 = (unkPtr->unk2 < unkPtr->unk0 - 1) ? unkPtr->unk2 + 1 : 0; + } + + r0 = (unkPtr->unk2 != ((sub_81CDD5C() != 0) ? unkPtr->unk0 : unkPtr->unk0 - 1)); + + if (!r6) + return 3; + else if (!r0) + return 4; + else + return 1; +} + +bool32 sub_81CD3C4(void) +{ + s32 var; + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + + switch (structPtr->unk678A) + { + case 0: + sub_81CD824(unkPtr->unk2, 0); + break; + case 1: + sub_81CDA1C(unkPtr->unk2, 0); + break; + case 2: + sub_81CDB98(unkPtr->unk2, 0); + break; + case 3: + if (unkPtr->unk0 == 1) + { + structPtr->unk6786 = 0; + structPtr->unk6787 = 0; + structPtr->unk6788 = 0; + structPtr->unk678A = 0; + return TRUE; + } + else + { + structPtr->unk6786 = 0; + structPtr->unk6787 = 1; + structPtr->unk6788 = 2; + } + break; + // These were probably ternaries just like cases 7-9, but couldn't match it any other way. + case 4: + var = unkPtr->unk2 + 1; + if (var >= unkPtr->unk0) + var = 0; + sub_81CD824(var, 1); + break; + case 5: + var = unkPtr->unk2 + 1; + if (var >= unkPtr->unk0) + var = 0; + sub_81CDA1C(var, 1); + break; + case 6: + var = unkPtr->unk2 + 1; + if (var >= unkPtr->unk0) + var = 0; + sub_81CDB98(var, 1); + break; + case 7: + sub_81CD824((unkPtr->unk2 - 1 >= 0) ? unkPtr->unk2 - 1 : unkPtr->unk0 - 1, 2); + break; + case 8: + sub_81CDA1C((unkPtr->unk2 - 1 >= 0) ? unkPtr->unk2 - 1 : unkPtr->unk0 - 1, 2); + break; + case 9: + sub_81CDB98((unkPtr->unk2 - 1 >= 0) ? unkPtr->unk2 - 1 : unkPtr->unk0 - 1, 2); + structPtr->unk678A = 0; + return TRUE; + } + + structPtr->unk678A++; + return FALSE; +} + +bool32 sub_81CD548(u8 arg0) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + + switch (arg0) + { + case 0: + sub_81CD824(structPtr->unk6302, structPtr->unk6789); + break; + case 1: + sub_81CDA1C(structPtr->unk6302, structPtr->unk6789); + break; + case 2: + sub_81CDB98(structPtr->unk6302, structPtr->unk6789); + return TRUE; + } + + return FALSE; +} + +u8 *sub_81CD5CC(u8 *dst, const u8 *src, s16 n) +{ + while (*src != EOS) + *dst++ = *src++, n--; + + while (n-- > 0) + *dst++ = CHAR_SPACE; + + *dst = EOS; + return dst; +} + +u8 *sub_81CD624(u8 *str, u16 id, bool8 arg3) +{ + u16 boxId, monId, gender, species, level, lvlDigits; + struct BoxPokemon *boxMon; + u8 *txtPtr, *str_; + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + + boxId = unkPtr->unk4[id].boxId; + monId = unkPtr->unk4[id].monId; + *(str++) = EXT_CTRL_CODE_BEGIN; + *(str++) = 4; + *(str++) = 8; + *(str++) = 0; + *(str++) = 9; + + if (GetBoxOrPartyMonData(boxId, monId, MON_DATA_IS_EGG, NULL)) + return StringCopyPadded(str, gText_EggNickname, CHAR_SPACE, 12); + + GetBoxOrPartyMonData(boxId, monId, MON_DATA_NICKNAME, str); + StringGetEnd10(str); + species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES, NULL); + if (boxId == TOTAL_BOXES_COUNT) + { + level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL); + gender = GetMonGender(&gPlayerParty[monId]); + } + else + { + boxMon = GetBoxedMonPtr(boxId, monId); + gender = GetBoxMonGender(boxMon); + level = GetLevelFromBoxMonExp(boxMon); + } + + if ((species == SPECIES_NIDORAN_F || species == SPECIES_NIDORAN_M) && !StringCompare(str, gSpeciesNames[species])) + gender = MON_GENDERLESS; + + str_ = str; // For some reason, a variable is needed to match. + while (*str_ != EOS) + *(str_++); + + *(str_++) = EXT_CTRL_CODE_BEGIN; + *(str_++) = 0x12; + *(str_++) = 0x3C; + switch (gender) + { + default: + *(str_++) = 0x77; + break; + case MON_MALE: + *(str_++) = EXT_CTRL_CODE_BEGIN; + *(str_++) = EXT_CTRL_CODE_COLOR; + *(str_++) = 4; + *(str_++) = EXT_CTRL_CODE_BEGIN; + *(str_++) = 3; + *(str_++) = 5; + *(str_++) = CHAR_MALE; + break; + case MON_FEMALE: + *(str_++) = EXT_CTRL_CODE_BEGIN; + *(str_++) = EXT_CTRL_CODE_COLOR; + *(str_++) = 6; + *(str_++) = EXT_CTRL_CODE_BEGIN; + *(str_++) = 3; + *(str_++) = 7; + *(str_++) = CHAR_FEMALE; + break; + } + + *(str_++) = EXT_CTRL_CODE_BEGIN; + *(str_++) = 4; + *(str_++) = 8; + *(str_++) = 0; + *(str_++) = 9; + *(str_++) = CHAR_SLASH; + *(str_++) = CHAR_SPECIAL_F9; + *(str_++) = 5; + txtPtr = str_; + str_ = ConvertIntToDecimalStringN(str_, level, STR_CONV_MODE_LEFT_ALIGN, 3); + lvlDigits = str_ - txtPtr; + *(str_++) = CHAR_SPACE; + if (!arg3) + { + lvlDigits = 3 - lvlDigits; + while (lvlDigits-- != 0) + *(str_++) = CHAR_SPACE; + } + + *str_ = EOS; + return str_; +} + +void sub_81CD824(s16 arg0, u8 arg1) +{ + u16 boxId, i; + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + + if (arg0 != (sub_81CDD5C() != 0 ? unkPtr->unk0 : unkPtr->unk0 - 1)) + { + sub_81CD624(structPtr->unk6368[arg1], arg0, FALSE); + boxId = unkPtr->unk4[arg0].boxId; + structPtr->unk6320[arg1][0] = EXT_CTRL_CODE_BEGIN; + structPtr->unk6320[arg1][1] = 4; + structPtr->unk6320[arg1][2] = 8; + structPtr->unk6320[arg1][3] = 0; + structPtr->unk6320[arg1][4] = 9; + if (boxId == TOTAL_BOXES_COUNT) + sub_81CD5CC(&structPtr->unk6320[arg1][5], gText_InParty, 8); + else + sub_81CD5CC(&structPtr->unk6320[arg1][5], GetBoxNamePtr(boxId), 8); + } + else + { + for (i = 0; i < 12; i++) + structPtr->unk6368[arg1][i] = CHAR_SPACE; + structPtr->unk6368[arg1][i] = EOS; + + for (i = 0; i < 8; i++) + structPtr->unk6320[arg1][i] = CHAR_SPACE; + structPtr->unk6320[arg1][i] = EOS; + } +} + +void sub_81CD970(void) +{ + u16 i, count; + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + struct PokenavSub18 *unkPtr = AllocSubstruct(18, sizeof(struct PokenavSub18)); + + structPtr->unk6300 = 0; + for (i = 0, count = 0; i < CalculatePlayerPartyCount(); i++) + { + if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) + { + unkPtr->unk4[count].boxId = TOTAL_BOXES_COUNT; + unkPtr->unk4[count].monId = i; + unkPtr->unk4[count].unk6 = 0; + count++; + } + } + + unkPtr->unk4[count].boxId = 0; + unkPtr->unk4[count].monId = 0; + unkPtr->unk4[count].unk6 = 0; + unkPtr->unk2 = 0; + unkPtr->unk0 = count + 1; + structPtr->unk678A = 0; +} + +void sub_81CD9F8(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + structPtr->unk6300 = 1; + structPtr->unk678A = 0; +} + +void sub_81CDA1C(s16 arg0, u8 arg1) +{ + u16 boxId, monId, i; + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + + if (arg0 != (sub_81CDD5C() != 0 ? unkPtr->unk0 : unkPtr->unk0 - 1)) + { + boxId = unkPtr->unk4[arg0].boxId; + monId = unkPtr->unk4[arg0].monId; + structPtr->unk6428.unk0[arg1][0] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_COOL, NULL); + structPtr->unk6428.unk0[arg1][1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_TOUGH, NULL); + structPtr->unk6428.unk0[arg1][2] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SMART, NULL); + structPtr->unk6428.unk0[arg1][3] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_CUTE, NULL); + structPtr->unk6428.unk0[arg1][4] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_BEAUTY, NULL); + structPtr->unk6780[arg1] = (GetBoxOrPartyMonData(boxId, monId, MON_DATA_SHEEN, NULL) != 255) + ? GetBoxOrPartyMonData(boxId, monId, MON_DATA_SHEEN, NULL) / 29u + : 9; + structPtr->unk6783[arg1] = GetBoxOrPartyMonData(boxId, monId, MON_DATA_MARKINGS, NULL); + sub_81D2754(structPtr->unk6428.unk0[arg1], structPtr->unk6428.unk14[arg1]); + } + else + { + for (i = 0; i < 5; i++) + { + structPtr->unk6428.unk0[arg1][i] = 0; + structPtr->unk6428.unk14[arg1][i].unk0 = 155; + structPtr->unk6428.unk14[arg1][i].unk2 = 91; + } + } +} + +void sub_81CDB98(s16 arg0, u8 arg1) +{ + u16 boxId, monId, species; + u32 personality, tid; + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + + if (arg0 == (sub_81CDD5C() != 0 ? unkPtr->unk0 : unkPtr->unk0 - 1)) + return; + + boxId = unkPtr->unk4[arg0].boxId; + monId = unkPtr->unk4[arg0].monId; + species = GetBoxOrPartyMonData(boxId, monId, MON_DATA_SPECIES2, NULL); + tid = GetBoxOrPartyMonData(boxId, monId, MON_DATA_OT_ID, NULL); + personality = GetBoxOrPartyMonData(boxId, monId, MON_DATA_PERSONALITY, NULL); + LoadSpecialPokePic(&gMonFrontPicTable[species], structPtr->monPicGfx[arg1], species, personality, TRUE); + LZ77UnCompWram(GetMonSpritePalFromSpeciesAndPersonality(species, tid, personality), structPtr->monPal[arg1]); +} + +u16 sub_81CDC50(void) +{ + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + return unkPtr->unk0; +} + +u16 sub_81CDC60(void) +{ + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + return unkPtr->unk2; +} + +struct UnknownStruct_81D1ED4 *sub_81CDC70(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + return &structPtr->unk6428; +} + +u8 sub_81CDC84(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + return structPtr->unk6786; +} + +u8 sub_81CDC9C(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + return structPtr->unk6302; +} + +void *sub_81CDCB4(u8 id) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + return structPtr->monPicGfx[id]; +} + +void *sub_81CDCD4(u8 id) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + return structPtr->monPal[id]; +} + +u8 sub_81CDCEC(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + return structPtr->unk6789; +} + +u8 *sub_81CDD04(u8 id) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + return structPtr->unk6368[id]; +} + +u8 *sub_81CDD24(u8 id) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + return structPtr->unk6320[id]; +} + +u16 sub_81CDD48(void) +{ + struct PokenavSub18 *unkPtr = GetSubstructPtr(18); + return unkPtr->unk4[unkPtr->unk2].unk6; +} + +bool32 sub_81CDD5C(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + if (structPtr->unk6300 == 1) + return TRUE; + else + return FALSE; +} + +u8 sub_81CDD7C(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + if (structPtr->unk6300 == 1) + return structPtr->unk6783[structPtr->unk6786]; + else + return 0; +} + +u8 sub_81CDDB0(void) +{ + struct PokenavSub11 *structPtr = GetSubstructPtr(11); + return structPtr->unk6780[structPtr->unk6786]; +} diff --git a/src/pokenav_unk_7.c b/src/pokenav_unk_7.c new file mode 100644 index 000000000..90b677fa7 --- /dev/null +++ b/src/pokenav_unk_7.c @@ -0,0 +1,884 @@ +#include "global.h" +#include "bg.h" +#include "window.h" +#include "pokenav.h" +#include "decompress.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "menu.h" +#include "menu_specialized.h" +#include "mon_markings.h" +#include "palette.h" +#include "pokenav.h" +#include "scanline_effect.h" +#include "string_util.h" +#include "strings.h" +#include "text.h" + +u32 sub_81CE37C(s32); +u32 sub_81CE2D0(s32); +u32 sub_81CE4D8(s32); +u32 sub_81CE5E4(s32); +u32 sub_81CE6BC(s32); +u32 sub_81CE700(s32); + +BSS_DATA u8 gUnknown_030012BC; + +const u16 gUnknown_086231E8[] = INCBIN_U16("graphics/pokenav/86231E8.gbapal"); +const u16 gUnknown_08623208[] = INCBIN_U16("graphics/pokenav/8623208.gbapal"); +const u32 gUnknown_08623228[] = INCBIN_U32("graphics/pokenav/8623228.4bpp.lz"); +const u32 gUnknown_0862323C[] = INCBIN_U32("graphics/pokenav/862323C.bin.lz"); +const u16 gUnknown_08623338[] = INCBIN_U16("graphics/pokenav/8623338.gbapal"); + +const struct BgTemplate gUnknown_08623358[3] = +{ + { + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 0x1F, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 3, + .mapBaseIndex = 0x1D, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 2, + .mapBaseIndex = 0x1E, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + } +}; + +const struct WindowTemplate gUnknown_08623364 = +{ + .bg = 1, + .tilemapLeft = 13, + .tilemapTop = 1, + .width = 13, + .height = 4, + .paletteNum = 15, + .baseBlock = 2 +}; + +const struct WindowTemplate gUnknown_0862336C = +{ + .bg = 1, + .tilemapLeft = 1, + .tilemapTop = 6, + .width = 7, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x36 +}; + +const struct WindowTemplate gUnknown_08623374 = +{ + .bg = 1, + .tilemapLeft = 1, + .tilemapTop = 0x1C, + .width = 5, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x44 +}; + +const struct WindowTemplate gUnknown_0862337C = +{ + .bg = 1, + .tilemapLeft = 13, + .tilemapTop = 0x1C, + .width = 3, + .height = 2, + .paletteNum = 15, + .baseBlock = 0x44 +}; + +const LoopedTask gUnknown_08623384[] = +{ + NULL, + sub_81CE37C, + sub_81CE2D0, + sub_81CE4D8, + sub_81CE5E4, + sub_81CE6BC, + sub_81CE700 +}; + +struct Pokenav7Struct +{ + u32 loopedTaskId; + u8 tilemapBuffers[3][BG_SCREEN_SIZE]; + u8 filler[2]; + u8 unk1806[10]; + u32 (*unk1810)(void); + s16 unk1814; + u8 unk1816; + u16 unk1818; + u16 unk181A; + void *unk181C; + u8 unk1820; + u8 unk1821; + u8 unk1822; + u8 unk1823; + struct PokemonMarkMenu monMarks; + struct Sprite *unk28dc; + struct Sprite *unk28e0[10]; + u8 unk2908; + u8 filler2[0x38ac - 0x2909]; +}; + +extern s8 sub_81CDC84(void); // This function's declaration here is different than its definition in pokenav_unk_6. u8/s8 + +u32 sub_81CDE94(s32 state); +u32 sub_81CDE80(void); +void sub_81CED30(u8 var); +void sub_81CE9E4(void); +void sub_81CE934(void); +bool32 sub_81CE754(u8 a0, u16 a1, bool8 a2); +void sub_81CEE44(void); +void sub_81CEE90(void); +void sub_81CEEC8(void); +void sub_81CEE68(void); +void sub_81CEE74(bool8 showBg); + +// code +bool32 sub_81CDDD4(void) +{ + struct Pokenav7Struct *structPtr = AllocSubstruct(0xC, sizeof(struct Pokenav7Struct)); + + if (structPtr == NULL) + return FALSE; + + structPtr->unk1816 = 0xFF; + structPtr->loopedTaskId = CreateLoopedTask(sub_81CDE94, 1); + structPtr->unk1810 = sub_81CDE80; + structPtr->unk2908 = 0; + return TRUE; +} + +void sub_81CDE2C(int id) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + structPtr->loopedTaskId = CreateLoopedTask(gUnknown_08623384[id], 1); + structPtr->unk1810 = sub_81CDE80; +} + +u32 sub_81CDE64(void) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + return structPtr->unk1810(); +} + +u32 sub_81CDE80(void) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + return IsLoopedTaskActive(structPtr->loopedTaskId); +} + +u32 sub_81CDE94(s32 state) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + switch (state) + { + case 0: + if (sub_81CD3C4() != TRUE) + return 2; + return 0; + case 1: + InitBgTemplates(gUnknown_08623358, ARRAY_COUNT(gUnknown_08623358)); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + ChangeBgX(2, 0, 0); + ChangeBgY(2, 0, 0); + ChangeBgX(3, 0, 0); + ChangeBgY(3, 0, 0); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG3); + SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(11, 4)); + decompress_and_copy_tile_data_to_vram(3, gPokenavCondition_Gfx, 0, 0, 0); + return 0; + case 2: + if (free_temp_tile_data_buffers_if_possible()) + return 2; + decompress_and_copy_tile_data_to_vram(2, gUnknown_08623228, 0, 0, 0); + return 0; + case 3: + if (free_temp_tile_data_buffers_if_possible()) + return 2; + + LZ77UnCompVram(gPokenavCondition_Tilemap, structPtr->tilemapBuffers[0]); + SetBgTilemapBuffer(3, structPtr->tilemapBuffers[0]); + if (sub_81CDD5C() == TRUE) + CopyToBgTilemapBufferRect(3, gPokenavOptions_Tilemap, 0, 5, 9, 4); + + CopyBgTilemapBufferToVram(3); + CopyPaletteIntoBufferUnfaded(gPokenavCondition_Pal, 0x10, 0x20); + CopyPaletteIntoBufferUnfaded(gUnknown_08623208, 0xF0, 0x20); + structPtr->unk1814 = -80; + return 0; + case 4: + if (free_temp_tile_data_buffers_if_possible()) + return 2; + + LZ77UnCompVram(gUnknown_0862323C, structPtr->tilemapBuffers[2]); + SetBgTilemapBuffer(2, structPtr->tilemapBuffers[2]); + CopyBgTilemapBufferToVram(2); + CopyPaletteIntoBufferUnfaded(gUnknown_086231E8, 0x30, 0x20); + sub_81D21DC(2); + return 0; + case 5: + sub_8199DF0(1, 0, 0, 1); + sub_8199DF0(1, 17, 1, 1); + CpuFill32(0, structPtr->tilemapBuffers[1], BG_SCREEN_SIZE); + SetBgTilemapBuffer(1, structPtr->tilemapBuffers[1]); + return 0; + case 6: + if (free_temp_tile_data_buffers_if_possible()) + return 2; + + structPtr->unk1820 = AddWindow(&gUnknown_08623364); + if (sub_81CDD5C() == TRUE) + { + structPtr->unk1821 = AddWindow(&gUnknown_0862336C); + structPtr->unk1822 = AddWindow(&gUnknown_08623374); + structPtr->unk1823 = AddWindow(&gUnknown_0862337C); + } + DeactivateAllTextPrinters(); + return 0; + case 7: + sub_81CED30(0); + return 0; + case 8: + sub_81CE9E4(); + return 0; + case 9: + if (sub_81CDD5C() == TRUE) + sub_81CE934(); + return 0; + case 10: + sub_81CE754(0, sub_81CDC84(), TRUE); + return 0; + case 11: + sub_81CE754(1, sub_81CDC84(), TRUE); + return 0; + case 12: + sub_81CE754(2, sub_81CDC84(), TRUE); + return 0; + case 13: + if (sub_81CE754(3, sub_81CDC84(), TRUE) != TRUE) + return 2; + PutWindowTilemap(structPtr->unk1820); + if (sub_81CDD5C() == TRUE) + { + PutWindowTilemap(structPtr->unk1821); + PutWindowTilemap(structPtr->unk1822); + PutWindowTilemap(structPtr->unk1823); + } + return 0; + case 14: + ShowBg(1); + HideBg(2); + ShowBg(3); + if (sub_81CDD5C() == TRUE) + sub_81C7BA4(4); + return 0; + case 15: + sub_81C7AC0(1); + if (!sub_81CDD5C()) + { + LoadLeftHeaderGfxForIndex(6); + sub_81C7FA0(1, TRUE, 0); + sub_81C7FA0(6, TRUE, 0); + } + return 0; + case 16: + if (IsPaletteFadeActive()) + return 2; + if (!sub_81CDD5C() && sub_81C8010()) + return 2; + SetVBlankCallback_(sub_81CEE44); + return 0; + case 17: + sub_81CEE90(); + sub_81D20AC(sub_81CDC70()); + return 0; + case 18: + if (sub_81D20BC(sub_81CDC70())) + return 2; + return 0; + case 19: + sub_81CEE74(TRUE); + return 0; + case 20: + if (!sub_81D3178(sub_81CDC70(), &structPtr->unk1814)) + { + sub_81D3464(structPtr->unk28e0); + if (sub_81CDD5C() == TRUE || sub_81CDC60() != sub_81CDC50()) + sub_81D3480(structPtr->unk28e0, structPtr->unk1816, sub_81CDDB0()); + + return 4; + } + return 2; + } + + return 4; +} + +u32 sub_81CE2D0(s32 state) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + switch (state) + { + case 0: + sub_81CEEC8(); + sub_81D3520(structPtr->unk28e0); + return 1; + case 1: + if (sub_81D31A4(sub_81CDC70(), &structPtr->unk1814)) + return 2; + sub_81CEE74(FALSE); + return 1; + case 2: + sub_81C7AC0(0); + if (!sub_81CDD5C()) + sub_81C78A0(); + return 0; + case 3: + if (IsPaletteFadeActive() || MainMenuLoopedTaskIsBusy()) + return 2; + sub_81D354C(structPtr->unk28e0); + HideBg(1); + HideBg(2); + HideBg(3); + return 1; + } + + return 4; +} + +u32 sub_81CE37C(s32 state) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + struct UnknownStruct_81D1ED4 *unkPtr = sub_81CDC70(); + + switch (state) + { + case 0: + sub_81CD548(0); + return 1; + case 1: + sub_81CD548(1); + return 1; + case 2: + sub_81CD548(2); + sub_81D3520(structPtr->unk28e0); + return 1; + case 3: + sub_81D2074(unkPtr); + return 1; + case 4: + if (!sub_81D3150(&structPtr->unk1814)) + { + sub_81CED30(sub_81CDC84()); + return 1; + } + return 2; + case 5: + sub_81CE754(0, sub_81CDC84(), FALSE); + return 1; + case 6: + sub_81CE754(1, sub_81CDC84(), FALSE); + return 1; + case 7: + sub_81CE754(2, sub_81CDC84(), FALSE); + return 1; + case 8: + if (sub_81CE754(3, sub_81CDC84(), FALSE) == TRUE) + return 1; + return 2; + case 9: + unkPtr = sub_81CDC70(); + if (!sub_81D3178(unkPtr, &structPtr->unk1814)) + { + sub_81D3464(structPtr->unk28e0); + if (sub_81CDD5C() != TRUE && sub_81CDC60() == sub_81CDC50()) + return 1; + + sub_81D3480(structPtr->unk28e0, structPtr->unk1816, sub_81CDDB0()); + return 1; + } + return 2; + } + + return 4; +} + +u32 sub_81CE4D8(s32 state) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + switch (state) + { + case 0: + sub_81CD548(0); + return 1; + case 1: + sub_81CD548(1); + return 1; + case 2: + sub_81CD548(2); + return 1; + case 3: + sub_81CED30(sub_81CDC84()); + return 1; + case 4: + sub_81CE754(0, sub_81CDC84(), FALSE); + return 1; + case 5: + sub_81CE754(1, sub_81CDC84(), FALSE); + return 1; + case 6: + sub_81CE754(2, sub_81CDC84(), FALSE); + return 1; + case 7: + if (sub_81CE754(3, sub_81CDC84(), FALSE) == TRUE) + return 1; + return 2; + case 8: + if (!sub_81D3178(sub_81CDC70(), &structPtr->unk1814)) + { + sub_81D3464(structPtr->unk28e0); + sub_81D3480(structPtr->unk28e0, structPtr->unk1816, sub_81CDDB0()); + return 1; + } + return 2; + } + + return 4; +} + +u32 sub_81CE5E4(s32 state) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + switch (state) + { + case 0: + sub_81CD548(0); + return 1; + case 1: + sub_81CD548(1); + return 1; + case 2: + sub_81CD548(2); + sub_81D3520(structPtr->unk28e0); + return 1; + case 3: + if (!sub_81D31A4(sub_81CDC70(), &structPtr->unk1814)) + return 1; + return 2; + case 4: + sub_81CE754(0, sub_81CDC84(), FALSE); + return 1; + case 5: + sub_81CE754(1, sub_81CDC84(), FALSE); + return 1; + case 6: + sub_81CE754(2, sub_81CDC84(), FALSE); + return 1; + case 7: + if (sub_81CE754(3, sub_81CDC84(), FALSE) == TRUE) + return 1; + return 2; + } + + return 4; +} + +u32 sub_81CE6BC(s32 state) +{ + switch (state) + { + case 0: + sub_811FAA4(sub_81CDD7C(), 0xb0, 0x20); + return 1; + case 1: + sub_81C7BA4(5); + return 1; + case 2: + if (IsDma3ManagerBusyWithBgCopy_() == TRUE) + return 2; + return 1; + } + + return 4; +} + +u32 sub_81CE700(s32 state) +{ + switch (state) + { + case 0: + sub_811FAF8(); + return 1; + case 1: + sub_81C7BA4(4); + return 1; + case 2: + if (IsDma3ManagerBusyWithBgCopy_() == TRUE) + return 2; + return 1; + } + + return 4; +} + +u8 *sub_81CE738(u8 *dst, u16 num) +{ + u8 *txtPtr = ConvertIntToDecimalStringN(dst, num, STR_CONV_MODE_RIGHT_ALIGN, 4); + txtPtr = StringCopy(txtPtr, gText_Number2); + + return txtPtr; +} + +bool32 sub_81CE754(u8 a0, u16 a1, bool8 a2) +{ + u8 text[32]; + const u8 *str; + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + switch (a0) + { + case 0: + FillWindowPixelBuffer(structPtr->unk1820, 0); + if (sub_81CDD5C() == TRUE) + FillWindowPixelBuffer(structPtr->unk1821, 0); + break; + case 1: + if (sub_81CDC60() != sub_81CDC50() - 1 || sub_81CDD5C() == TRUE) + { + str = sub_81CDD04(a1); + AddTextPrinterParameterized(structPtr->unk1820, 1, str, 0, 1, 0, NULL); + } + break; + case 2: + if (sub_81CDD5C() == TRUE) + { + str = sub_81CDD24(a1); + AddTextPrinterParameterized(structPtr->unk1820, 1, str, 0, 17, 0, NULL); + text[0] = EXT_CTRL_CODE_BEGIN; + text[1] = 4; + text[2] = 8; + text[3] = 0; + text[4] = 9; + StringCopy(text + 5, gText_Number2); + AddTextPrinterParameterized(structPtr->unk1821, 1, text, 4, 1, 0, NULL); + ConvertIntToDecimalStringN(text + 5, sub_81CDD48(), STR_CONV_MODE_RIGHT_ALIGN, 4); + AddTextPrinterParameterized(structPtr->unk1821, 1, text, 28, 1, 0, NULL); + } + break; + case 3: + switch (structPtr->unk2908) + { + case 0: + if (a2) + CopyWindowToVram(structPtr->unk1820, 3); + else + CopyWindowToVram(structPtr->unk1820, 2); + + if (sub_81CDD5C() == TRUE) + { + structPtr->unk2908++; + return FALSE; + } + else + { + structPtr->unk2908 = 0; + return TRUE; + } + case 1: + if (a2) + CopyWindowToVram(structPtr->unk1821, 3); + else + CopyWindowToVram(structPtr->unk1821, 2); + + structPtr->unk2908 = 0; + return TRUE; + } + } + + return FALSE; +} + +void sub_81CE934(void) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + CopyWindowToVram(structPtr->unk1822, 3); + CopyWindowToVram(structPtr->unk1823, 3); +} + +void sub_81CE964(struct Sprite *sprite) +{ + if (sprite->data[0] == sub_81CDC60()) + StartSpriteAnim(sprite, 0); + else + StartSpriteAnim(sprite, 1); +} + +void sub_81CE990(struct Sprite *sprite) +{ + if (sub_81CDC60() == sub_81CDC50() - 1) + sprite->oam.paletteNum = IndexOfSpritePaletteTag(0x65); + else + sprite->oam.paletteNum = IndexOfSpritePaletteTag(0x66); +} + +void sub_81CE9C8(struct Sprite *sprite) +{ + StartSpriteAnim(sprite, sub_81CDD7C()); +} + +void sub_81CE9E4(void) +{ + struct SpriteSheet sprSheets[4]; + struct SpriteTemplate sprTemplate; + struct SpritePalette sprPals[3]; + struct SpriteSheet sprSheet; + struct Sprite *sprite; + u16 i, spriteId; + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + sub_81D321C(sprSheets, &sprTemplate, sprPals); + if (sub_81CDD5C() == TRUE) + { + structPtr->monMarks.baseTileTag = 0x6A; + structPtr->monMarks.basePaletteTag = 0x6A; + sub_811F90C(&structPtr->monMarks); + sub_811FA90(); + sprite = sub_811FF94(0x69, 0x69, gUnknown_08623338); + sprite->oam.priority = 3; + sprite->pos1.x = 192; + sprite->pos1.y = 32; + sprite->callback = sub_81CE9C8; + structPtr->unk28dc = sprite; + sub_81C7990(IndexOfSpritePaletteTag(0x69), 0); + } + else + { + LoadSpriteSheets(sprSheets); + Pokenav_AllocAndLoadPalettes(sprPals); + for (i = 0; i < sub_81CDC50() - 1; i++) + { + spriteId = CreateSprite(&sprTemplate, 226, (i * 20) + 8, 0); + if (spriteId != MAX_SPRITES) + { + structPtr->unk1806[i] = spriteId; + gSprites[spriteId].data[0] = i; + gSprites[spriteId].callback = sub_81CE964; + } + else + { + structPtr->unk1806[i] = 0xFF; + } + } + + sprTemplate.tileTag = 0x67; + sprTemplate.callback = SpriteCallbackDummy; + for (; i < 6; i++) + { + spriteId = CreateSprite(&sprTemplate, 230, (i * 20) + 8, 0); + if (spriteId != MAX_SPRITES) + { + structPtr->unk1806[i] = spriteId; + gSprites[spriteId].oam.size = 0; + } + else + { + structPtr->unk1806[i] = 0xFF; + } + } + + sprTemplate.tileTag = 0x66; + sprTemplate.callback = sub_81CE990; + spriteId = CreateSprite(&sprTemplate, 222, (i * 20) + 8, 0); + if (spriteId != MAX_SPRITES) + { + structPtr->unk1806[i] = spriteId; + gSprites[spriteId].oam.shape = 1; + gSprites[spriteId].oam.size = 2; + } + else + { + structPtr->unk1806[i] = 0xFF; + } + } + + sub_81D32B0(&sprSheet, &sprPals[0]); + LoadSpriteSheet(&sprSheet); + sprPals[1].data = NULL; + Pokenav_AllocAndLoadPalettes(sprPals); +} + +void sub_81CEBF4(struct Pokenav7Struct *structPtr) +{ + u8 i; + + if (sub_81CDD5C() == TRUE) + { + DestroySprite(structPtr->unk28dc); + FreeSpriteTilesByTag(0x6A); + FreeSpriteTilesByTag(0x69); + FreeSpritePaletteByTag(0x6A); + FreeSpritePaletteByTag(0x69); + } + else + { + for (i = 0; i < 7; i++) + DestroySprite(&gSprites[structPtr->unk1806[i]]); + + FreeSpriteTilesByTag(0x65); + FreeSpriteTilesByTag(0x66); + FreeSpriteTilesByTag(0x67); + FreeSpritePaletteByTag(0x65); + FreeSpritePaletteByTag(0x66); + } + + if (structPtr->unk1816 != 0xFF) + { + DestroySprite(&gSprites[structPtr->unk1816]); + FreeSpriteTilesByTag(0x64); + FreeSpritePaletteByTag(0x64); + } +} + +void sub_81CECA0(void) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + RemoveWindow(structPtr->unk1820); + if (sub_81CDD5C() == TRUE) + { + RemoveWindow(structPtr->unk1821); + RemoveWindow(structPtr->unk1822); + RemoveWindow(structPtr->unk1823); + } + else + { + sub_81C7FDC(); + } + + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP); + sub_81CEBF4(structPtr); + sub_81CEE68(); + FreePokenavSubstruct(0xC); +} + +void sub_81CED10(struct Sprite *sprite) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + sprite->pos1.x = structPtr->unk1814 + 38; +} + +void sub_81CED30(u8 var) +{ + struct SpriteTemplate sprTemplate; + struct SpriteSheet sprSheet; + struct SpritePalette sprPal; + u8 spriteId; + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + if (structPtr->unk1816 == 0xFF) + { + sub_81D31D0(&sprSheet, &sprTemplate, &sprPal); + sprSheet.data = sub_81CDCB4(var); + sprPal.data = sub_81CDCD4(var); + structPtr->unk1818 = LoadSpritePalette(&sprPal); + structPtr->unk181A = LoadSpriteSheet(&sprSheet); + spriteId = CreateSprite(&sprTemplate, 38, 104, 0); + structPtr->unk1816 = spriteId; + if (spriteId == MAX_SPRITES) + { + FreeSpriteTilesByTag(0x64); + FreeSpritePaletteByTag(0x64); + structPtr->unk1816 = 0xFF; + } + else + { + structPtr->unk1816 = spriteId; + gSprites[structPtr->unk1816].callback = sub_81CED10; + structPtr->unk181C = (void*)(VRAM) + 0x10000 + (structPtr->unk181A * 32); + structPtr->unk1818 = (structPtr->unk1818 * 16) + 0x100; + } + } + else + { + DmaCopy16Defvars(3, sub_81CDCB4(var), structPtr->unk181C, 0x800); + LoadPalette(sub_81CDCD4(var), structPtr->unk1818, 0x20); + } +} + +void sub_81CEE44(void) +{ + struct UnknownStruct_81D1ED4 *unk = sub_81CDC70(); + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); + sub_81D2108(unk); + ScanlineEffect_InitHBlankDmaTransfer(); +} + +void sub_81CEE68(void) +{ + SetPokenavVBlankCallback(); +} + +void sub_81CEE74(bool8 showBg) +{ + if (showBg) + ShowBg(2); + else + HideBg(2); +} + +void sub_81CEE90(void) +{ + struct UnknownStruct_81D1ED4 *unk = sub_81CDC70(); + u8 id = sub_81CDC84(); + + gUnknown_030012BC = id; + sub_81D1F84(unk, unk->unk14[3], unk->unk14[id]); + sub_81D2074(unk); +} + +void sub_81CEEC8(void) +{ + struct UnknownStruct_81D1ED4 *unk = sub_81CDC70(); + + if (sub_81CDD5C() || sub_81CDC60() != sub_81CDC50() - 1) + sub_81D1F84(unk, unk->unk14[sub_81CDC84()], unk->unk14[3]); +} + +u8 sub_81CEF14(void) +{ + struct Pokenav7Struct *structPtr = GetSubstructPtr(0xC); + + if (sub_81CDD5C() == 1) + return structPtr->monMarks.markings; + else + return 0; +} diff --git a/src/pokenav_unk_8.c b/src/pokenav_unk_8.c new file mode 100644 index 000000000..bcafc14d0 --- /dev/null +++ b/src/pokenav_unk_8.c @@ -0,0 +1,189 @@ +#include "global.h" +#include "pokenav.h" +#include "bg.h" +#include "window.h" + +u32 sub_81CF134(void); +u32 sub_81CF1C4(void); +u32 sub_81CF1D8(void); +u32 sub_81CF278(void); +u32 sub_81CF578(s32); +u32 sub_81CF5F0(s32); +u32 sub_81CF668(s32); +u32 sub_81CF6E0(s32); +u32 sub_81CF758(s32); +u32 sub_81CF798(s32); + +const u32 gUnknown_086233A0[] = {0x16, 0x17, 0x18, 0x21, 0x2F}; + +u32 (*const gUnknown_086233B4[])(void) = +{ + sub_81CF134, + sub_81CF1C4, + sub_81CF1D8, + sub_81CF278 +}; + +const u16 gUnknown_086233C4[] = INCBIN_U16("graphics/pokenav/condition_search2.gbapal"); +const u32 gUnknown_086233E4[] = INCBIN_U32("graphics/pokenav/condition_search2.4bpp.lz"); +const u32 gUnknown_086234AC[] = INCBIN_U32("graphics/pokenav/condition_search2.bin.lz"); +const u16 gUnknown_08623570[] = INCBIN_U16("graphics/pokenav/8623570.gbapal"); + +const struct BgTemplate gUnknown_08623590 = +{ + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 0x06, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 +}; + +const struct BgTemplate gUnknown_08623594 = +{ + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 0x07, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 +}; + +const LoopedTask gUnknown_08623598[] = +{ + NULL, + sub_81CF578, + sub_81CF5F0, + sub_81CF668, + sub_81CF6E0, + sub_81CF758, + sub_81CF798 +}; + +const struct WindowTemplate gUnknown_086235B4 = +{ + .bg = 1, + .tilemapLeft = 1, + .tilemapTop = 6, + .width = 7, + .height = 2, + .paletteNum = 1, + .baseBlock = 20 +}; + +const u8 gUnknown_086235BC[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); +const u8 gUnknown_086235C8[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); +const u8 gUnknown_086235D4[] = _("{UNK_SPACER}"); + +struct PokenavSub7 +{ + u32 (*unk0)(struct PokenavSub7 *); + u32 loopedTaskId; + u8 fill1[12]; + u32 unk14; + u32 unk18; + u32 unk1C; + struct PokenavSub18 *unkPtr; +}; + +u32 sub_81CF010(struct PokenavSub7 *structPtr); +u32 sub_81CF030(struct PokenavSub7 *structPtr); +u32 sub_81CF0B8(struct PokenavSub7 *structPtr); +u32 sub_81CF0B0(struct PokenavSub7 *structPtr); +u32 sub_81CF11C(s32 state); + +bool32 sub_81CEF3C(void) +{ + struct PokenavSub7 *structPtr = AllocSubstruct(7, sizeof(struct PokenavSub7)); + if (structPtr == NULL) + return FALSE; + + structPtr->unkPtr = AllocSubstruct(18, sizeof(struct PokenavSub18)); + if (structPtr->unkPtr == NULL) + return FALSE; + + structPtr->unk0 = sub_81CF010; + structPtr->loopedTaskId = CreateLoopedTask(sub_81CF11C, 1); + structPtr->unk18 = 0; + structPtr->unk14 = gUnknown_086233A0[sub_81C76AC()]; + return TRUE; +} + +bool32 sub_81CEF98(void) +{ + struct PokenavSub7 *structPtr = AllocSubstruct(7, sizeof(struct PokenavSub7)); + if (structPtr == NULL) + return FALSE; + + structPtr->unkPtr = GetSubstructPtr(18); + structPtr->unk0 = sub_81CF030; + structPtr->unk18 = 1; + structPtr->unk14 = gUnknown_086233A0[sub_81C76AC()]; + return TRUE; +} + +u32 sub_81CEFDC(void) +{ + struct PokenavSub7 *structPtr = GetSubstructPtr(7); + return structPtr->unk0(structPtr); +} + +void sub_81CEFF0(void) +{ + struct PokenavSub7 *structPtr = GetSubstructPtr(7); + if (structPtr->unk1C == 0) + FreePokenavSubstruct(18); + FreePokenavSubstruct(7); +} + +bool32 sub_81CF010(struct PokenavSub7 *structPtr) +{ + if (!IsLoopedTaskActive(structPtr->loopedTaskId)) + structPtr->unk0 = sub_81CF030; + return FALSE; +} + +u32 sub_81CF030(struct PokenavSub7 *structPtr) +{ + if (gMain.newAndRepeatedKeys & DPAD_UP) + return 1; + else if (gMain.newAndRepeatedKeys & DPAD_DOWN) + return 2; + else if (gMain.newKeys & DPAD_LEFT) + return 3; + else if (gMain.newKeys & DPAD_RIGHT) + return 4; + else if (gMain.newKeys & B_BUTTON) + { + structPtr->unk1C = 0; + structPtr->unk0 = sub_81CF0B0; + return 5; + } + else if (gMain.newKeys & A_BUTTON) + { + structPtr->unkPtr->unk2 = GetSelectedMatchCall(); + structPtr->unk1C = 1; + structPtr->unk0 = sub_81CF0B8; + return 6; + } + else + return 0; +} + +u32 sub_81CF0B0(struct PokenavSub7 *structPtr) +{ + return 0x186A3; +} + +u32 sub_81CF0B8(struct PokenavSub7 *structPtr) +{ + return 0x186A9; +} + +u32 sub_81CF0C0(void) +{ + struct PokenavSub7 *structPtr = GetSubstructPtr(7); + return structPtr->unk18; +} diff --git a/src/pokenav_unk_9.c b/src/pokenav_unk_9.c new file mode 100644 index 000000000..2927d7211 --- /dev/null +++ b/src/pokenav_unk_9.c @@ -0,0 +1,74 @@ +#include "global.h" +#include "pokenav.h" +#include "bg.h" +#include "window.h" + +u32 sub_81CFB8C(void); +u32 sub_81CFC2C(void); +u32 sub_81CFC40(void); +u32 sub_81CFFFC(s32); +u32 sub_81D0074(s32); +u32 sub_81D00EC(s32); +u32 sub_81D0164(s32); +u32 sub_81D01DC(s32); +u32 sub_81D021C(s32); + +u32 (*const gUnknown_086235D8[])(void) = +{ + sub_81CFB8C, + sub_81CFC2C, + sub_81CFC40 +}; + +const u16 gUnknown_086235E4[] = INCBIN_U16("graphics/pokenav/ui_ribbons.gbapal"); +const u32 gUnknown_08623604[] = INCBIN_U32("graphics/pokenav/ui_ribbons.4bpp.lz"); +const u32 gUnknown_086236CC[] = INCBIN_U32("graphics/pokenav/ui_ribbons.bin.lz"); +const u16 gUnknown_08623790[] = INCBIN_U16("graphics/pokenav/8623790.gbapal"); + +const struct BgTemplate gUnknown_086237B0 = +{ + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 0x06, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 +}; + +const struct BgTemplate gUnknown_086237B4 = +{ + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 0x07, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 +}; + +const LoopedTask gUnknown_086237B8[] = +{ + NULL, + sub_81CFFFC, + sub_81D0074, + sub_81D00EC, + sub_81D0164, + sub_81D01DC, + sub_81D021C +}; + +const struct WindowTemplate gUnknown_086237D4 = +{ + .bg = 1, + .tilemapLeft = 1, + .tilemapTop = 6, + .width = 7, + .height = 2, + .paletteNum = 1, + .baseBlock = 20 +}; + +const u8 gUnknown_086237DC[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_RED}{WHITE}{GREEN}♂{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); +const u8 gUnknown_086237E8[] = _("{COLOR_HIGHLIGHT_SHADOW}{LIGHT_GREEN}{WHITE}{BLUE}♀{COLOR_HIGHLIGHT_SHADOW}{DARK_GREY}{WHITE}{LIGHT_GREY}"); +const u8 gUnknown_086237F4[] = _("{UNK_SPACER}"); diff --git a/src/random.c b/src/random.c index f0b2d9e5f..b570a7bc3 100644 --- a/src/random.c +++ b/src/random.c @@ -8,8 +8,8 @@ EWRAM_DATA static u8 sUnknown = 0; EWRAM_DATA static u32 sRandCount = 0; // IWRAM common -IWRAM_DATA u32 gRngValue; -IWRAM_DATA u32 gRng2Value; +u32 gRngValue; +u32 gRng2Value; u16 Random(void) { diff --git a/src/record_mixing.c b/src/record_mixing.c index 85b52e478..6cb145c80 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -82,21 +82,21 @@ union PlayerRecords // Static RAM declarations -static IWRAM_DATA bool8 gUnknown_03001130; -static IWRAM_DATA struct SecretBase *sSecretBasesSave; -static IWRAM_DATA TVShow *sTvShowsSave; -static IWRAM_DATA PokeNews *sPokeNewsSave; -static IWRAM_DATA OldMan *sOldManSave; -static IWRAM_DATA struct EasyChatPair *sEasyChatPairsSave; -static IWRAM_DATA struct RecordMixingDayCareMail *gUnknown_03001148; -static IWRAM_DATA void *sBattleTowerSave; -static IWRAM_DATA LilycoveLady *sLilycoveLadySave; -static IWRAM_DATA void *sApprenticesSave; -static IWRAM_DATA void *sBattleTowerSave_Duplicate; -static IWRAM_DATA u32 sRecordStructSize; -static IWRAM_DATA u8 gUnknown_03001160; -static IWRAM_DATA u32 filler_03001164; -static IWRAM_DATA struct PlayerHallRecords *gUnknown_03001168[3]; +static bool8 gUnknown_03001130; +static struct SecretBase *sSecretBasesSave; +static TVShow *sTvShowsSave; +static PokeNews *sPokeNewsSave; +static OldMan *sOldManSave; +static struct EasyChatPair *sEasyChatPairsSave; +static struct RecordMixingDayCareMail *gUnknown_03001148; +static void *sBattleTowerSave; +static LilycoveLady *sLilycoveLadySave; +static void *sApprenticesSave; +static void *sBattleTowerSave_Duplicate; +static u32 sRecordStructSize; +static u8 gUnknown_03001160; +static u32 filler_03001164; +static struct PlayerHallRecords *gUnknown_03001168[3]; static EWRAM_DATA struct RecordMixingDayCareMail gUnknown_02039F9C = {0}; static EWRAM_DATA union PlayerRecords *sReceivedRecords = NULL; diff --git a/src/recorded_battle.c b/src/recorded_battle.c index ac97dfcd6..9e03d57f6 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -100,8 +100,8 @@ EWRAM_DATA static u8 sApprenticeId = 0; EWRAM_DATA static u16 sEasyChatSpeech[6] = {0}; EWRAM_DATA static u8 sBattleOutcome = 0; -IWRAM_DATA static u8 sRecordMixFriendLanguage; -IWRAM_DATA static u8 sApprenticeLanguage; +static u8 sRecordMixFriendLanguage; +static u8 sApprenticeLanguage; // this file's functions static u8 sub_8185278(u8 *arg0, u8 *arg1, u8 *arg2); diff --git a/src/reset_rtc_screen.c b/src/reset_rtc_screen.c index adf22dfed..0197fa3ff 100644 --- a/src/reset_rtc_screen.c +++ b/src/reset_rtc_screen.c @@ -142,7 +142,7 @@ static const union AnimCmd sSpriteAnim_85104CC[] = static const union AnimCmd sSpriteAnim_85104D4[] = { - ANIMCMD_FRAME(0, 158, .vFlip = TRUE), + ANIMCMD_FRAME(0, 30, .vFlip = TRUE), ANIMCMD_JUMP(0), }; diff --git a/src/reset_save_heap.c b/src/reset_save_heap.c index 95d63a323..beba742f5 100644 --- a/src/reset_save_heap.c +++ b/src/reset_save_heap.c @@ -14,7 +14,7 @@ void sub_81700F8(void) imeBackup = REG_IME; REG_IME = 0; - RegisterRamReset(0x00000001); + RegisterRamReset(RESET_EWRAM); ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_FORCED_BLANK); REG_IME = imeBackup; gMain.inBattle = FALSE; diff --git a/src/rom_8034C54.c b/src/rom_8034C54.c index a3707017e..42817fc2b 100644 --- a/src/rom_8034C54.c +++ b/src/rom_8034C54.c @@ -43,9 +43,9 @@ static bool32 SharesPalWithAnyActive(u32 id); static void sub_8035648(void); // iwram -static IWRAM_DATA s32 gUnknown_03000DD4; -static IWRAM_DATA s32 gUnknown_03000DD8; -static IWRAM_DATA s32 gUnknown_03000DDC; +static s32 gUnknown_03000DD4; +static s32 gUnknown_03000DD8; +static s32 gUnknown_03000DDC; // ewram static EWRAM_DATA struct UnkStruct1 *gUnknown_02022E10 = {0}; diff --git a/src/roulette.c b/src/roulette.c index 25c079cda..662522aae 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -3994,8 +3994,8 @@ static void sub_8144514(struct Sprite *sprite) if (gUnknown_0203AB88->var94 > 40.f) return; - gUnknown_0203AB88->var98 = -(4.0f / (float)gUnknown_0203AB88->var86); - gUnknown_0203AB88->var90 = -(gUnknown_0203AB88->var8C / (float)gUnknown_0203AB88->var86); + gUnknown_0203AB88->var98 = -(4.0f / (float)(gUnknown_0203AB88->var86)); + gUnknown_0203AB88->var90 = -(gUnknown_0203AB88->var8C / (float)(gUnknown_0203AB88->var86)); sprite->animNum = 2; sprite->animBeginning = TRUE; sprite->animEnded = FALSE; @@ -4010,8 +4010,8 @@ static void sub_81445D8(struct Sprite *sprite) return; m4aSongNumStartOrChange(SE_TAMAKORO_E); - gUnknown_0203AB88->var98 = -(20.0f / (float)gUnknown_0203AB88->var84); - gUnknown_0203AB88->var90 = ((1.0f - gUnknown_0203AB88->var8C) / (float)gUnknown_0203AB88->var84); + gUnknown_0203AB88->var98 = -(20.0f / (float)(gUnknown_0203AB88->var84)); + gUnknown_0203AB88->var90 = ((1.0f - gUnknown_0203AB88->var8C) / (float)(gUnknown_0203AB88->var84)); sprite->animNum = 1; sprite->animBeginning = TRUE; sprite->animEnded = FALSE; diff --git a/src/roulette_util.c b/src/roulette_util.c index 9531302d9..f1f04a73a 100755 --- a/src/roulette_util.c +++ b/src/roulette_util.c @@ -408,7 +408,8 @@ void UpdatePulseBlend(struct PulseBlend *pulseBlend) } } break; - case 2: // Flip back and forth + case (MODERN ? -2 : 2): // Flip back and forth + // This code is never reached in vanilla if (pulseBlendPalette->fadeDirection) pulseBlendPalette->blendCoeff = 0; else diff --git a/src/rtc.c b/src/rtc.c index 37a06fe7e..b135a675a 100644 --- a/src/rtc.c +++ b/src/rtc.c @@ -4,10 +4,10 @@ #include "text.h" // iwram bss -IWRAM_DATA static u16 sErrorStatus; -IWRAM_DATA static struct SiiRtcInfo sRtc; -IWRAM_DATA static u8 sProbeResult; -IWRAM_DATA static u16 sSavedIme; +static u16 sErrorStatus; +static struct SiiRtcInfo sRtc; +static u8 sProbeResult; +static u16 sSavedIme; // iwram common struct Time gLocalTime; diff --git a/src/save.c b/src/save.c index 45a75b5dc..cdfd2ae1d 100644 --- a/src/save.c +++ b/src/save.c @@ -626,7 +626,10 @@ static u16 CalculateChecksum(void *data, u16 size) u32 checksum = 0; for (i = 0; i < (size / 4); i++) - checksum += *((u32 *)data)++; + { + checksum += *((u32 *)data); + data += sizeof(u32); + } return ((checksum >> 16) + checksum); } diff --git a/src/scrcmd.c b/src/scrcmd.c index 8d597b887..57cd3edbe 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -62,7 +62,7 @@ static EWRAM_DATA u16 sMovingNpcMapBank = 0; static EWRAM_DATA u16 sMovingNpcMapId = 0; static EWRAM_DATA u16 sFieldEffectScriptId = 0; -IWRAM_DATA u8 gUnknown_03000F30; +static u8 gUnknown_03000F30; extern const SpecialFunc gSpecials[]; extern const u8 *gStdScripts[]; diff --git a/src/script.c b/src/script.c index 27476dba3..34484561c 100644 --- a/src/script.c +++ b/src/script.c @@ -10,12 +10,12 @@ extern const u8* gUnknown_020375C0; // ewram bss -IWRAM_DATA static u8 sScriptContext1Status; -IWRAM_DATA static u32 sUnusedVariable1; -IWRAM_DATA static struct ScriptContext sScriptContext1; -IWRAM_DATA static u32 sUnusedVariable2; -IWRAM_DATA static struct ScriptContext sScriptContext2; -IWRAM_DATA static bool8 sScriptContext2Enabled; +static u8 sScriptContext1Status; +static u32 sUnusedVariable1; +static struct ScriptContext sScriptContext1; +static u32 sUnusedVariable2; +static struct ScriptContext sScriptContext2; +static bool8 sScriptContext2Enabled; extern ScrCmdFunc gScriptCmdTable[]; extern ScrCmdFunc gScriptCmdTableEnd[]; diff --git a/src/script_menu.c b/src/script_menu.c index 082253e35..b17d3df38 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1017,8 +1017,8 @@ const u8 *const gUnknown_0858BBEC[] = EWRAM_DATA u8 gUnknown_02039F90 = 0; -IWRAM_DATA u8 gUnknown_03001124[7]; -IWRAM_DATA u32 filler_0300112c; +static u8 gUnknown_03001124[7]; +static u32 filler_0300112c; static void Task_HandleMultichoiceInput(u8); static void Task_HandleYesNoInput(u8); diff --git a/src/secret_base.c b/src/secret_base.c index ac35a090a..12cb8cd61 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -71,7 +71,7 @@ static EWRAM_DATA struct SecretBaseRegistryMenu *sRegistryMenu = NULL; static void Task_ShowSecretBaseRegistryMenu(u8 taskId); static void BuildRegistryMenuItems(u8 taskId); -static void RegistryMenu_OnCursorMove(int unused, bool8 flag, struct ListMenu *menu); +static void RegistryMenu_OnCursorMove(s32 unused, bool8 flag, struct ListMenu *menu); static void FinalizeRegistryMenu(u8 taskId); static void AddRegistryMenuScrollArrows(u8 taskId); static void HandleRegistryMenuInput(u8 taskId); @@ -932,7 +932,7 @@ static void BuildRegistryMenuItems(u8 taskId) gMultiuseListMenuTemplate.maxShowed = data[3]; } -static void RegistryMenu_OnCursorMove(int unused, bool8 flag, struct ListMenu *menu) +static void RegistryMenu_OnCursorMove(s32 unused, bool8 flag, struct ListMenu *menu) { if (flag != TRUE) PlaySE(SE_SELECT); diff --git a/src/shop.c b/src/shop.c index 7f1a8f27e..bf15568fb 100755 --- a/src/shop.c +++ b/src/shop.c @@ -87,8 +87,8 @@ static void Task_ReturnToItemListAfterItemPurchase(u8 taskId); static void Task_ReturnToItemListAfterDecorationPurchase(u8 taskId); static void Task_HandleShopMenuBuy(u8 taskId); static void Task_HandleShopMenuSell(u8 taskId); -static void BuyMenuPrintItemDescriptionAndShowItemIcon(int item, bool8 onInit, struct ListMenu *list); -static void BuyMenuPrintPriceInList(u8 windowId, int item, u8 y); +static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, struct ListMenu *list); +static void BuyMenuPrintPriceInList(u8 windowId, s32 item, u8 y); static const struct YesNoFuncTable sShopPurchaseYesNoFuncs = { @@ -521,7 +521,7 @@ static void BuyMenuSetListEntry(struct ListMenuItem *menuItem, u16 item, u8 *nam menuItem->id = item; } -static void BuyMenuPrintItemDescriptionAndShowItemIcon(int item, bool8 onInit, struct ListMenu *list) +static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, struct ListMenu *list) { const u8 *description; if (onInit != TRUE) @@ -550,7 +550,7 @@ static void BuyMenuPrintItemDescriptionAndShowItemIcon(int item, bool8 onInit, s BuyMenuPrint(2, description, 3, 1, 0, 0); } -static void BuyMenuPrintPriceInList(u8 windowId, int item, u8 y) +static void BuyMenuPrintPriceInList(u8 windowId, s32 item, u8 y) { u8 x; diff --git a/src/slot_machine.c b/src/slot_machine.c index b853daa39..003ac3327 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -350,7 +350,7 @@ static EWRAM_DATA struct SpriteSheet *sUnknown_0203AB30 = NULL; static EWRAM_DATA struct SlotMachineEwramStruct *sSlotMachine = NULL; // IWRAM bss -static IWRAM_DATA struct SpriteFrameImage *gUnknown_03001188[26]; +static struct SpriteFrameImage *gUnknown_03001188[26]; // Const rom data. extern const struct UnkStruct1 *const gUnknown_083ED048[]; diff --git a/src/sound.c b/src/sound.c index 16f024858..dba4354df 100644 --- a/src/sound.c +++ b/src/sound.c @@ -19,11 +19,11 @@ EWRAM_DATA struct MusicPlayerInfo* gMPlay_PokemonCry = NULL; EWRAM_DATA u8 gPokemonCryBGMDuckingCounter = 0; // iwram bss -IWRAM_DATA static u16 sCurrentMapMusic; -IWRAM_DATA static u16 sNextMapMusic; -IWRAM_DATA static u8 sMapMusicState; -IWRAM_DATA static u8 sMapMusicFadeInSpeed; -IWRAM_DATA static u16 sFanfareCounter; +static u16 sCurrentMapMusic; +static u16 sNextMapMusic; +static u8 sMapMusicState; +static u8 sMapMusicFadeInSpeed; +static u16 sFanfareCounter; // iwram common bool8 gDisableMusic; diff --git a/src/sprite.c b/src/sprite.c index d2ea7889c..e25eac62e 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -285,10 +285,10 @@ static const struct OamDimensions sOamDimensions[3][4] = }; // iwram bss -IWRAM_DATA static u16 sSpriteTileRangeTags[MAX_SPRITES]; -IWRAM_DATA static u16 sSpriteTileRanges[MAX_SPRITES * 2]; -IWRAM_DATA static struct AffineAnimState sAffineAnimStates[OAM_MATRIX_COUNT]; -IWRAM_DATA static u16 sSpritePaletteTags[16]; +static u16 sSpriteTileRangeTags[MAX_SPRITES]; +static u16 sSpriteTileRanges[MAX_SPRITES * 2]; +static struct AffineAnimState sAffineAnimStates[OAM_MATRIX_COUNT]; +static u16 sSpritePaletteTags[16]; // iwram common u32 gOamMatrixAllocBitmap; diff --git a/src/starter_choose.c b/src/starter_choose.c index 886daa45a..5524d407b 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -51,7 +51,7 @@ void sub_81346DC(struct Sprite *sprite); void sub_813473C(struct Sprite *sprite); void StarterPokemonSpriteCallback(struct Sprite *sprite); -static IWRAM_DATA u16 sStarterChooseWindowId; +static u16 sStarterChooseWindowId; // .rodata const u16 gBirchBagGrassPal[][16] = diff --git a/src/text.c b/src/text.c index 91a82b19f..7e4fa7104 100644 --- a/src/text.c +++ b/src/text.c @@ -462,6 +462,108 @@ u8 GetLastTextColor(u8 colorType) } } +#ifdef NONMATCHING + +#define GLYPH_COPY(fromY_, toY_, fromX_, toX_, unk) \ +{ \ + u32 i, j, *ptr, toY, fromX, toX, r5, toOrr, bits; \ + u8 *dst; \ + \ + j = fromX_; \ + i = fromY_; \ + ptr = unk; \ + toX = toX_; \ + toY = toY_; \ + fromX = fromX_; \ + \ + for (; i < toY; i++) \ + { \ + r5 = *(ptr++); \ + for (j = fromX; j < toX; j++) \ + { \ + toOrr = r5 & 0xF; \ + if (toOrr) \ + { \ + dst = windowTiles + ((j / 8) * 32) + ((j & 7) / 2) + ((i / 8) * widthOffset) + ((i & 7) * 4); \ + bits = ((j & 1) << 2); \ + *dst = ((toOrr << bits) | (*dst & (0xF0 >> bits))); \ + } \ + r5 >>= 4; \ + } \ + } \ +} + +void CopyGlyphToWindow(struct TextPrinter *textPrinter) +{ + struct Window *win; + struct WindowTemplate *winTempl; + struct Struct_03002F90 *unkStruct; + u32 currX, widthOffset, currY; + s32 r4, r0; + u8 *windowTiles; + + win = &gWindows[textPrinter->printerTemplate.windowId]; + winTempl = &win->window; + + r4 = (winTempl->width * 8) - textPrinter->printerTemplate.currentX; + if (r4 > gUnknown_03002F90.unk80) + r4 = gUnknown_03002F90.unk80; + + r0 = (winTempl->height * 8) - textPrinter->printerTemplate.currentY; + if (r0 > gUnknown_03002F90.unk81) + r0 = gUnknown_03002F90.unk81; + + currX = textPrinter->printerTemplate.currentX; + currY = textPrinter->printerTemplate.currentY; + unkStruct = &gUnknown_03002F90; + windowTiles = win->tileData; + widthOffset = winTempl->width * 32; + + if (r4 <= 8) + { + if (r0 <= 8) + { + GLYPH_COPY(currY, currY + r0, currX, currX + r4, unkStruct->unk0); + } + else + { + u32 temp; + GLYPH_COPY(currY, currY + 8, currX, currX + r4, unkStruct->unk0); + + temp = currY + 8; + GLYPH_COPY(temp, (temp - 8) + r0, currX, currX + r4, unkStruct->unk40); + } + } + else + { + if (r0 <= 8) + { + u32 temp; + GLYPH_COPY(currY, currY + r0, currX, currX + 8, unkStruct->unk0); + + temp = currX + 8; + GLYPH_COPY(currY, currY + r0, temp, (temp - 8) + r4, unkStruct->unk20); + } + else + { + u32 temp; + GLYPH_COPY(currY, currY + 8, currX, currX + 8, unkStruct->unk0); + + temp = currX + 8; + GLYPH_COPY(currY, currY + 8, temp, temp - 8 + r4, unkStruct->unk20); + + temp = currY + 8; + GLYPH_COPY(temp, temp - 8 + r0, currX, currX + 8, unkStruct->unk40); + { + u32 tempX, tempY; + tempX = currX + 8; + tempY = currY + 8; + GLYPH_COPY(tempY, tempY - 8 + r0, tempX, tempX - 8 + r4, unkStruct->unk60); + } + } + } +} +#else NAKED void CopyGlyphToWindow(struct TextPrinter *x) { @@ -1164,6 +1266,7 @@ _080052AA:\n\ bx r0\n\ .pool"); } +#endif // NONMATCHING void ClearTextSpan(struct TextPrinter *textPrinter, u32 width) { diff --git a/src/trade.c b/src/trade.c index f7650ff03..94accc43c 100644 --- a/src/trade.c +++ b/src/trade.c @@ -158,6 +158,9 @@ static EWRAM_DATA struct { /*0xFE*/ u8 unk_FE; } *gUnknown_020322A0 = {NULL}; +#if !defined(NONMATCHING) && MODERN +#define static +#endif static bool32 sub_8077260(void); static void sub_80773D0(void); static void sub_807811C(void); @@ -2779,7 +2782,7 @@ static void sub_8079398(void) } } -static void DisplayMessageAndContinueTask(void) +static void Wait2SecondsAndCreateYesNoMenu(void) { gUnknown_0203229C->unk_A8++; @@ -2918,7 +2921,7 @@ static void sub_80795AC(void) sub_80781C8(); break; case 14: - DisplayMessageAndContinueTask(); + Wait2SecondsAndCreateYesNoMenu(); break; case 15: sub_8079034(); diff --git a/src/trainer_pokemon_sprites.c b/src/trainer_pokemon_sprites.c index 6824e8747..047783a85 100644 --- a/src/trainer_pokemon_sprites.c +++ b/src/trainer_pokemon_sprites.c @@ -104,7 +104,7 @@ static void LoadPicPaletteByTagOrSlot(u16 species, u32 otId, u32 personality, u8 if (paletteTag == 0xFFFF) { sCreatingSpriteTemplate.paletteTag = 0xFFFF; - LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x100 + paletteSlot * 0x10, 0x20); + LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x100 + paletteSlot * 0x10, 0x20); } else { @@ -130,7 +130,7 @@ static void LoadPicPaletteByTagOrSlot(u16 species, u32 otId, u32 personality, u8 static void LoadPicPaletteBySlot(u16 species, u32 otId, u32 personality, u8 paletteSlot, bool8 isTrainer) { if (!isTrainer) - LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality), paletteSlot * 0x10, 0x20); + LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality), paletteSlot * 0x10, 0x20); else LoadCompressedPalette(gTrainerFrontPicPaletteTable[species].data, paletteSlot * 0x10, 0x20); } diff --git a/src/tv.c b/src/tv.c index dfd26fd0d..b4c8463fd 100644 --- a/src/tv.c +++ b/src/tv.c @@ -56,9 +56,9 @@ struct { u16 move; } sTV_SecretBaseVisitMonsTemp[10]; -IWRAM_DATA u8 sTVShowMixingNumPlayers; -IWRAM_DATA u8 sTVShowNewsMixingNumPlayers; -IWRAM_DATA s8 sTVShowMixingCurSlot; +static u8 sTVShowMixingNumPlayers; +static u8 sTVShowNewsMixingNumPlayers; +static s8 sTVShowMixingCurSlot; EWRAM_DATA u16 sPokemonAnglerSpecies = 0; EWRAM_DATA u16 sPokemonAnglerAttemptCounters = 0; @@ -69,10 +69,9 @@ EWRAM_DATA ALIGNED(4) u8 sTVShowState = 0; EWRAM_DATA u8 sTVSecretBaseSecretsRandomValues[3] = {}; // Static ROM declarations - -extern const u8 *const sTVBravoTrainerTextGroup[]; -extern const u8 *const sTVBravoTrainerBattleTowerTextGroup[]; - +#if !defined(NONMATCHING) && MODERN +#define static +#endif void ClearPokemonNews(void); u8 GetTVChannelByShowType(u8 kind); u8 FindFirstActiveTVShowThatIsNotAMassOutbreak(void); diff --git a/src/union_room.c b/src/union_room.c index 6e7c0965d..01288c8cc 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -1,53 +1,54 @@ #include "global.h" -#include "window.h" +#include "alloc.h" +#include "battle.h" +#include "berry_crush.h" #include "bg.h" -#include "random.h" -#include "string_util.h" -#include "task.h" +#include "cable_club.h" +#include "data.h" +#include "decompress.h" +#include "dodrio_berry_picking.h" +#include "dynamic_placeholder_text_util.h" +#include "easy_chat.h" #include "event_data.h" +#include "event_obj_lock.h" +#include "field_control_avatar.h" +#include "field_player_avatar.h" +#include "field_screen_effect.h" +#include "field_weather.h" +#include "international_string_util.h" +#include "librfu.h" #include "link.h" #include "link_rfu.h" -#include "librfu.h" -#include "alloc.h" -#include "menu.h" #include "list_menu.h" +#include "load_save.h" +#include "menu.h" #include "menu_helpers.h" +#include "mevent.h" +#include "mystery_gift.h" +#include "overworld.h" +#include "palette.h" +#include "party_menu.h" +#include "pokemon_jump.h" +#include "random.h" #include "script.h" +#include "script_pokemon_util_80F87D8.h" #include "sound.h" -#include "constants/songs.h" -#include "constants/game_stat.h" -#include "constants/maps.h" -#include "constants/species.h" -#include "constants/rgb.h" -#include "constants/battle_frontier.h" +#include "start_menu.h" +#include "string_util.h" +#include "strings.h" +#include "task.h" #include "trade.h" #include "trainer_card.h" -#include "overworld.h" -#include "battle.h" -#include "load_save.h" -#include "cable_club.h" -#include "field_control_avatar.h" -#include "party_menu.h" -#include "field_weather.h" -#include "palette.h" -#include "decompress.h" -#include "start_menu.h" -#include "data.h" -#include "field_screen_effect.h" -#include "script_pokemon_util_80F87D8.h" -#include "international_string_util.h" -#include "field_player_avatar.h" -#include "strings.h" -#include "mevent.h" -#include "dynamic_placeholder_text_util.h" #include "union_room.h" -#include "easy_chat.h" -#include "event_obj_lock.h" #include "union_room_chat.h" -#include "berry_crush.h" -#include "mystery_gift.h" #include "union_room_player_avatar.h" -#include "pokemon_jump.h" +#include "window.h" +#include "constants/battle_frontier.h" +#include "constants/game_stat.h" +#include "constants/maps.h" +#include "constants/rgb.h" +#include "constants/songs.h" +#include "constants/species.h" EWRAM_DATA u8 gUnknown_02022C20[12] = {}; EWRAM_DATA u8 gUnknown_02022C2C = 0; @@ -60,9 +61,9 @@ EWRAM_DATA u8 gUnknown_02022C3E = 0; EWRAM_DATA struct TradeUnkStruct gUnknown_02022C40 = {}; // IWRAM vars -IWRAM_DATA struct UnkStruct_Leader *gUnknown_03000DA0; -IWRAM_DATA struct UnkStruct_Group *gUnknown_03000DA4; -IWRAM_DATA struct UnkStruct_URoom *gUnknown_03000DA8; +static struct UnkStruct_Leader *gUnknown_03000DA0; +static struct UnkStruct_Group *gUnknown_03000DA4; +static struct UnkStruct_URoom *gUnknown_03000DA8; // this file's functions void sub_80173E0(u8 windowId, u8 arg1, const u8 *str, u8 arg3, u8 arg4, u8 arg5); @@ -98,7 +99,6 @@ bool32 sub_8017678(struct UnkStruct_Shared *arg0, struct UnkStruct_Shared *arg1) u32 sub_8018120(struct TradeUnkStruct *arg0, u8 multiplayerId); void sub_801807C(struct TradeUnkStruct *arg0); void sub_801AC54(void); -void sub_802493C(u8 monId, MainCallback callback); void sub_80149D8(void); void MG_DrawTextBorder(u8 windowId); s8 mevent_message_print_and_prompt_yes_no(u8 *textState, u8 *arg1, u8 arg2, const u8 *str); diff --git a/src/union_room_battle.c b/src/union_room_battle.c index 321b49092..79d12291d 100644 --- a/src/union_room_battle.c +++ b/src/union_room_battle.c @@ -40,7 +40,7 @@ struct UnkStruct_2022C6C s16 a0; }; -IWRAM_DATA struct UnkStruct_3000DAC * gUnknown_03000DAC; +static struct UnkStruct_3000DAC * gUnknown_03000DAC; EWRAM_DATA struct UnkStruct_2022C6C * gUnknown_02022C6C = NULL; diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index f28b651cc..655f38def 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -85,6 +85,10 @@ struct UsePokeblockStruct /*0x7FD0*/ struct UsePokeblockSubStruct info; }; +#define TAG_TILE_CONDITION_UP_DOWN 0 +#define TAG_PAL_CONDITION_UP_DOWN 0 +#define TAG_PAL_POKEBLOCK_CONDITION 1 + extern void sub_81D21DC(u8); // this file's functions @@ -130,26 +134,12 @@ static u8 sub_8168048(void); void sub_8168180(struct Sprite *sprite); void sub_81681B4(struct Sprite *sprite); void sub_8168168(struct Sprite *sprite); +void sub_8168374(struct Sprite *sprite); -extern const struct BgTemplate gUnknown_085DFCCC[4]; -extern const struct WindowTemplate gUnknown_085DFCDC[]; -extern const struct WindowTemplate sUsePokeblockYesNoWinTemplate[]; -extern const u8* sContestStatNames[]; -extern const u32 gUnknown_085DFCB0[]; -extern const u8 gUnknown_085DFCC4[]; -extern const struct SpriteSheet gSpriteSheet_ConditionUpDown; -extern const struct SpritePalette gSpritePalette_ConditionUpDown; -extern const struct SpriteTemplate gSpriteTemplate_085DFD5C; -extern const s16 gUnknown_085DFD28[][2]; -extern const u32 gUnknown_085DFB60[]; -extern const u32 gUnknown_085DFA80[]; -extern const u32 gUnknown_085DFA60[]; -extern const u32 gUnknown_085DFC0C[]; extern const u16 gUnknown_086231E8[]; extern const u16 gUnknown_08623208[]; -extern const u8 gUnknown_085DFCC9[]; -extern const struct SpritePalette gUnknown_085DFDB8; -extern const struct SpriteTemplate gUnknown_085DFDA0; +extern const struct SpritePalette gSpritePalette_085DFDB8; +extern const struct SpriteTemplate gSpriteTemplate_085DFDA0; // ram variables EWRAM_DATA struct UsePokeblockSubStruct *gUnknown_0203BC90 = NULL; @@ -165,6 +155,245 @@ EWRAM_DATA struct UsePokeblockStruct *gUnknown_0203BCAC = NULL; // const rom data // todo: make it static once the file is decompiled +const u32 gUnknown_085DFA60[] = INCBIN_U32("graphics/interface/85DFA60.bin"); +const u32 gUnknown_085DFA80[] = INCBIN_U32("graphics/interface/85DFA80.4bpp"); +const u32 gUnknown_085DFB60[] = INCBIN_U32("graphics/interface/85DFB60.bin"); +const u32 gUnknown_085DFC0C[] = INCBIN_U32("graphics/interface/85DFC0C.bin"); + +const u32 gUnknown_085DFCB0[] = +{ + MON_DATA_COOL, + MON_DATA_TOUGH, + MON_DATA_SMART, + MON_DATA_CUTE, + MON_DATA_BEAUTY +}; + +const u8 gUnknown_085DFCC4[] = +{ + 0, // Spicy/Cool + 4, // Dry/Beauty + 3, // Sweet/Cute + 2, // Bitter/Smart + 1 // Sour/Tough +}; + +const u8 gUnknown_085DFCC9[] = +{ + 0, + 8, + 1 +}; + +const struct BgTemplate gUnknown_085DFCCC[4] = +{ + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 0x1F, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 0x1E, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 3, + .mapBaseIndex = 0x1D, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0x100 + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 0x17, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + } +}; + +const struct WindowTemplate gUnknown_085DFCDC[] = +{ + { + .bg = 0, + .tilemapLeft = 0xD, + .tilemapTop = 1, + .width = 0xD, + .height = 4, + .paletteNum = 0xF, + .baseBlock = 1 + }, + { + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 0xE, + .width = 0xB, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x35 + }, + { + .bg = 0, + .tilemapLeft = 1, + .tilemapTop = 0x11, + .width = 0x1C, + .height = 2, + .paletteNum = 0xF, + .baseBlock = 0x4B + }, + DUMMY_WIN_TEMPLATE +}; + +const struct WindowTemplate sUsePokeblockYesNoWinTemplate = +{ + .bg = 0, + .tilemapLeft = 0x18, + .tilemapTop = 0xB, + .width = 5, + .height = 4, + .paletteNum = 0xF, + .baseBlock = 0x83 +}; + +const u8 *const sContestStatNames[] = +{ + gText_Coolness, + gText_Toughness, + gText_Smartness, + gText_Cuteness, + gText_Beauty3 +}; + +const struct SpriteSheet gSpriteSheet_ConditionUpDown = +{ + gUsePokeblockUpDown_Gfx, 0x200, TAG_TILE_CONDITION_UP_DOWN +}; + +const struct SpritePalette gSpritePalette_ConditionUpDown = +{ + gUsePokeblockUpDown_Pal, TAG_PAL_CONDITION_UP_DOWN +}; + +const s16 gUnknown_085DFD28[][2] = +{ + {0x9C, 0x24}, + {0x75, 0x3B}, + {0x75, 0x76}, + {0xC5, 0x76}, + {0xC5, 0x3B} +}; + +const struct OamData gOamData_085DFD3C = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .bpp = 0, + .shape = SPRITE_SHAPE(32x16), + .x = 0, + .size = SPRITE_SIZE(32x16), + .tileNum = 0, + .priority = 1, + .paletteNum = 0, +}; + +const union AnimCmd gSpriteAnim_085DFD44[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_085DFD4C[] = +{ + ANIMCMD_FRAME(8, 5), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_085DFD54[] = +{ + gSpriteAnim_085DFD44, + gSpriteAnim_085DFD4C +}; + +const struct SpriteTemplate gSpriteTemplate_085DFD5C = +{ + .tileTag = 0, + .paletteTag = 0, + .oam = &gOamData_085DFD3C, + .anims = gSpriteAnimTable_085DFD54, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +const struct OamData gOamData_085DFD74 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .bpp = 0, + .shape = SPRITE_SHAPE(64x32), + .x = 0, + .size = SPRITE_SIZE(64x32), + .tileNum = 0, + .priority = 1, + .paletteNum = 0, +}; + +const union AnimCmd gSpriteAnim_085DFD7C[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_085DFD84[] = +{ + ANIMCMD_FRAME(32, 5), + ANIMCMD_END +}; + +const union AnimCmd gSpriteAnim_085DFD8C[] = +{ + ANIMCMD_FRAME(64, 5), + ANIMCMD_END +}; + +const union AnimCmd *const gSpriteAnimTable_085DFD94[] = +{ + gSpriteAnim_085DFD7C, + gSpriteAnim_085DFD84, + gSpriteAnim_085DFD8C +}; + +const struct SpriteTemplate gSpriteTemplate_085DFDA0 = +{ + .tileTag = 1, + .paletteTag = 1, + .oam = &gOamData_085DFD74, + .anims = gSpriteAnimTable_085DFD94, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8168374, +}; + +const struct SpritePalette gSpritePalette_085DFDB8 = +{ + gUsePokeblockCondition_Pal, TAG_PAL_POKEBLOCK_CONDITION +}; + // code void ChooseMonToGivePokeblock(struct Pokeblock *pokeblock, void (*callback)(void)) { @@ -618,7 +847,7 @@ void sub_8166D44(void) AddTextPrinterParameterized(2, 1, gStringVar4, 0, 1, 0, NULL); PutWindowTilemap(2); CopyWindowToVram(2, 3); - CreateYesNoMenu(sUsePokeblockYesNoWinTemplate, 151, 14, 0); + CreateYesNoMenu(&sUsePokeblockYesNoWinTemplate, 151, 14, 0); } s8 sub_8166DE4(void) @@ -1373,7 +1602,7 @@ static void sub_8168248(void) struct CompressedSpriteSheet spriteSheet; struct SpritePalette spritePalette; - spritePalette = gUnknown_085DFDB8; + spritePalette = gSpritePalette_085DFDB8; spriteSheet.data = gUsePokeblockCondition_Gfx; spriteSheet.size = 0x800; spriteSheet.tag = 1; @@ -1388,7 +1617,7 @@ static void sub_8168294(void) int yStart = 17; int var = 8; struct Sprite **sprites = gUnknown_0203BCAC->field_7B44; - const struct SpriteTemplate *template = &gUnknown_085DFDA0; + const struct SpriteTemplate *template = &gSpriteTemplate_085DFDA0; for (i = 0, xDiff = 64, xStart = -96; i < 2; i++) { diff --git a/sym_bss.txt b/sym_bss.txt index 037c8d892..4c974c3f6 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -47,17 +47,8 @@ .include "src/multiboot.o" .include "src/mirage_tower.o" .include "src/berry_fix_program.o" - - @ pokenav -gUnknown_030012BC: @ 30012BC - .space 0x4 - -gUnknown_030012C0: @ 30012C0 - .space 0x4 - -gUnknown_030012C4: @ 30012C4 - .space 0x4 - + .include "src/pokenav_unk_7.o" + .include "src/pokenav_unk_10.o" .include "src/ereader_helpers.o" .include "src/faraway_island.o" .include "asm/m4a_1.o" diff --git a/sym_common.txt b/sym_common.txt index 17dbf5c41..f277ed0f2 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -45,29 +45,8 @@ .space 0x44 -gUnknown_03006370: @ 3006370 - .space 0x10 - + .include "ereader_screen.o" .include "m4a.o" .include "agb_flash.o" - -gRfuState: @ 3007868 - .space 0x8 - -gUnknown_03007870: @ 3007870 - .space 0x10 - -gUnknown_03007880: @ 3007880 - .space 0x10 - -gUnknown_03007890: @ 3007890 - .space 0x4 - -gUnknown_03007894: @ 3007894 - .space 0x4 - -gUnknown_03007898: @ 3007898 - .space 0x8 - -gUnknown_030078A0: @ 30078A0 - .space 0xC + .include "librfu_stwi.o" + .include "librfu.o" diff --git a/sym_ewram.txt b/sym_ewram.txt index 5fbcba779..3de0c45cb 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -18,14 +18,7 @@ .include "src/berry_crush.o" .include "src/berry_powder.o" .include "src/dodrio_berry_picking.o" - - @ pokemon_jump -gUnknown_02022CFC: @ 2022CFC - .space 0x4 - -gUnknown_02022D00: @ 2022D00 - .space 0x4 - + .include "src/pokemon_jump.o" .include "src/main_menu.o" .include "src/battle_controllers.o" .include "src/rom_8034C54.o" diff --git a/tools/aif2pcm/Makefile b/tools/aif2pcm/Makefile index e5cb6ad31..af7d19fe9 100644 --- a/tools/aif2pcm/Makefile +++ b/tools/aif2pcm/Makefile @@ -6,7 +6,10 @@ LIBS = -lm SRCS = main.c extended.c -.PHONY: clean +.PHONY: all clean + +all: aif2pcm + @: aif2pcm: $(SRCS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS) diff --git a/tools/bin2c/Makefile b/tools/bin2c/Makefile index 73f78980e..ab11e1b61 100644 --- a/tools/bin2c/Makefile +++ b/tools/bin2c/Makefile @@ -2,10 +2,13 @@ CC = gcc CFLAGS = -Wall -Wextra -Werror -std=c11 -O2 -.PHONY: clean +.PHONY: all clean SRCS = bin2c.c +all: bin2c + @: + bin2c: $(SRCS) $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) diff --git a/tools/gbafix/Makefile b/tools/gbafix/Makefile index f12c8cc4f..5b410da08 100644 --- a/tools/gbafix/Makefile +++ b/tools/gbafix/Makefile @@ -1,8 +1,11 @@ CC = gcc -.PHONY: clean +.PHONY: all clean SRCS = gbafix.c +all: gbafix + @: + gbafix: $(SRCS) $(CC) $(SRCS) -o $@ $(LDFLAGS) diff --git a/tools/gbafix/elf.h b/tools/gbafix/elf.h new file mode 100644 index 000000000..79d3b974b --- /dev/null +++ b/tools/gbafix/elf.h @@ -0,0 +1,3147 @@ +/* +From musl include/elf.h + +Copyright © 2005-2014 Rich Felker, et al. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef _ELF_H +#define _ELF_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +typedef uint16_t Elf32_Half; +typedef uint16_t Elf64_Half; + +typedef uint32_t Elf32_Word; +typedef int32_t Elf32_Sword; +typedef uint32_t Elf64_Word; +typedef int32_t Elf64_Sword; + +typedef uint64_t Elf32_Xword; +typedef int64_t Elf32_Sxword; +typedef uint64_t Elf64_Xword; +typedef int64_t Elf64_Sxword; + +typedef uint32_t Elf32_Addr; +typedef uint64_t Elf64_Addr; + +typedef uint32_t Elf32_Off; +typedef uint64_t Elf64_Off; + +typedef uint16_t Elf32_Section; +typedef uint16_t Elf64_Section; + +typedef Elf32_Half Elf32_Versym; +typedef Elf64_Half Elf64_Versym; + +#define EI_NIDENT (16) + +typedef struct { + unsigned char e_ident[EI_NIDENT]; + Elf32_Half e_type; + Elf32_Half e_machine; + Elf32_Word e_version; + Elf32_Addr e_entry; + Elf32_Off e_phoff; + Elf32_Off e_shoff; + Elf32_Word e_flags; + Elf32_Half e_ehsize; + Elf32_Half e_phentsize; + Elf32_Half e_phnum; + Elf32_Half e_shentsize; + Elf32_Half e_shnum; + Elf32_Half e_shstrndx; +} Elf32_Ehdr; + +typedef struct { + unsigned char e_ident[EI_NIDENT]; + Elf64_Half e_type; + Elf64_Half e_machine; + Elf64_Word e_version; + Elf64_Addr e_entry; + Elf64_Off e_phoff; + Elf64_Off e_shoff; + Elf64_Word e_flags; + Elf64_Half e_ehsize; + Elf64_Half e_phentsize; + Elf64_Half e_phnum; + Elf64_Half e_shentsize; + Elf64_Half e_shnum; + Elf64_Half e_shstrndx; +} Elf64_Ehdr; + +#define EI_MAG0 0 +#define ELFMAG0 0x7f + +#define EI_MAG1 1 +#define ELFMAG1 'E' + +#define EI_MAG2 2 +#define ELFMAG2 'L' + +#define EI_MAG3 3 +#define ELFMAG3 'F' + + +#define ELFMAG "\177ELF" +#define SELFMAG 4 + +#define EI_CLASS 4 +#define ELFCLASSNONE 0 +#define ELFCLASS32 1 +#define ELFCLASS64 2 +#define ELFCLASSNUM 3 + +#define EI_DATA 5 +#define ELFDATANONE 0 +#define ELFDATA2LSB 1 +#define ELFDATA2MSB 2 +#define ELFDATANUM 3 + +#define EI_VERSION 6 + + +#define EI_OSABI 7 +#define ELFOSABI_NONE 0 +#define ELFOSABI_SYSV 0 +#define ELFOSABI_HPUX 1 +#define ELFOSABI_NETBSD 2 +#define ELFOSABI_LINUX 3 +#define ELFOSABI_GNU 3 +#define ELFOSABI_SOLARIS 6 +#define ELFOSABI_AIX 7 +#define ELFOSABI_IRIX 8 +#define ELFOSABI_FREEBSD 9 +#define ELFOSABI_TRU64 10 +#define ELFOSABI_MODESTO 11 +#define ELFOSABI_OPENBSD 12 +#define ELFOSABI_ARM 97 +#define ELFOSABI_STANDALONE 255 + +#define EI_ABIVERSION 8 + +#define EI_PAD 9 + + + +#define ET_NONE 0 +#define ET_REL 1 +#define ET_EXEC 2 +#define ET_DYN 3 +#define ET_CORE 4 +#define ET_NUM 5 +#define ET_LOOS 0xfe00 +#define ET_HIOS 0xfeff +#define ET_LOPROC 0xff00 +#define ET_HIPROC 0xffff + + + +#define EM_NONE 0 +#define EM_M32 1 +#define EM_SPARC 2 +#define EM_386 3 +#define EM_68K 4 +#define EM_88K 5 +#define EM_860 7 +#define EM_MIPS 8 +#define EM_S370 9 +#define EM_MIPS_RS3_LE 10 + +#define EM_PARISC 15 +#define EM_VPP500 17 +#define EM_SPARC32PLUS 18 +#define EM_960 19 +#define EM_PPC 20 +#define EM_PPC64 21 +#define EM_S390 22 + +#define EM_V800 36 +#define EM_FR20 37 +#define EM_RH32 38 +#define EM_RCE 39 +#define EM_ARM 40 +#define EM_FAKE_ALPHA 41 +#define EM_SH 42 +#define EM_SPARCV9 43 +#define EM_TRICORE 44 +#define EM_ARC 45 +#define EM_H8_300 46 +#define EM_H8_300H 47 +#define EM_H8S 48 +#define EM_H8_500 49 +#define EM_IA_64 50 +#define EM_MIPS_X 51 +#define EM_COLDFIRE 52 +#define EM_68HC12 53 +#define EM_MMA 54 +#define EM_PCP 55 +#define EM_NCPU 56 +#define EM_NDR1 57 +#define EM_STARCORE 58 +#define EM_ME16 59 +#define EM_ST100 60 +#define EM_TINYJ 61 +#define EM_X86_64 62 +#define EM_PDSP 63 + +#define EM_FX66 66 +#define EM_ST9PLUS 67 +#define EM_ST7 68 +#define EM_68HC16 69 +#define EM_68HC11 70 +#define EM_68HC08 71 +#define EM_68HC05 72 +#define EM_SVX 73 +#define EM_ST19 74 +#define EM_VAX 75 +#define EM_CRIS 76 +#define EM_JAVELIN 77 +#define EM_FIREPATH 78 +#define EM_ZSP 79 +#define EM_MMIX 80 +#define EM_HUANY 81 +#define EM_PRISM 82 +#define EM_AVR 83 +#define EM_FR30 84 +#define EM_D10V 85 +#define EM_D30V 86 +#define EM_V850 87 +#define EM_M32R 88 +#define EM_MN10300 89 +#define EM_MN10200 90 +#define EM_PJ 91 +#define EM_OR1K 92 +#define EM_OPENRISC 92 +#define EM_ARC_A5 93 +#define EM_ARC_COMPACT 93 +#define EM_XTENSA 94 +#define EM_VIDEOCORE 95 +#define EM_TMM_GPP 96 +#define EM_NS32K 97 +#define EM_TPC 98 +#define EM_SNP1K 99 +#define EM_ST200 100 +#define EM_IP2K 101 +#define EM_MAX 102 +#define EM_CR 103 +#define EM_F2MC16 104 +#define EM_MSP430 105 +#define EM_BLACKFIN 106 +#define EM_SE_C33 107 +#define EM_SEP 108 +#define EM_ARCA 109 +#define EM_UNICORE 110 +#define EM_EXCESS 111 +#define EM_DXP 112 +#define EM_ALTERA_NIOS2 113 +#define EM_CRX 114 +#define EM_XGATE 115 +#define EM_C166 116 +#define EM_M16C 117 +#define EM_DSPIC30F 118 +#define EM_CE 119 +#define EM_M32C 120 +#define EM_TSK3000 131 +#define EM_RS08 132 +#define EM_SHARC 133 +#define EM_ECOG2 134 +#define EM_SCORE7 135 +#define EM_DSP24 136 +#define EM_VIDEOCORE3 137 +#define EM_LATTICEMICO32 138 +#define EM_SE_C17 139 +#define EM_TI_C6000 140 +#define EM_TI_C2000 141 +#define EM_TI_C5500 142 +#define EM_TI_ARP32 143 +#define EM_TI_PRU 144 +#define EM_MMDSP_PLUS 160 +#define EM_CYPRESS_M8C 161 +#define EM_R32C 162 +#define EM_TRIMEDIA 163 +#define EM_QDSP6 164 +#define EM_8051 165 +#define EM_STXP7X 166 +#define EM_NDS32 167 +#define EM_ECOG1X 168 +#define EM_MAXQ30 169 +#define EM_XIMO16 170 +#define EM_MANIK 171 +#define EM_CRAYNV2 172 +#define EM_RX 173 +#define EM_METAG 174 +#define EM_MCST_ELBRUS 175 +#define EM_ECOG16 176 +#define EM_CR16 177 +#define EM_ETPU 178 +#define EM_SLE9X 179 +#define EM_L10M 180 +#define EM_K10M 181 +#define EM_AARCH64 183 +#define EM_AVR32 185 +#define EM_STM8 186 +#define EM_TILE64 187 +#define EM_TILEPRO 188 +#define EM_MICROBLAZE 189 +#define EM_CUDA 190 +#define EM_TILEGX 191 +#define EM_CLOUDSHIELD 192 +#define EM_COREA_1ST 193 +#define EM_COREA_2ND 194 +#define EM_ARC_COMPACT2 195 +#define EM_OPEN8 196 +#define EM_RL78 197 +#define EM_VIDEOCORE5 198 +#define EM_78KOR 199 +#define EM_56800EX 200 +#define EM_BA1 201 +#define EM_BA2 202 +#define EM_XCORE 203 +#define EM_MCHP_PIC 204 +#define EM_KM32 210 +#define EM_KMX32 211 +#define EM_EMX16 212 +#define EM_EMX8 213 +#define EM_KVARC 214 +#define EM_CDP 215 +#define EM_COGE 216 +#define EM_COOL 217 +#define EM_NORC 218 +#define EM_CSR_KALIMBA 219 +#define EM_Z80 220 +#define EM_VISIUM 221 +#define EM_FT32 222 +#define EM_MOXIE 223 +#define EM_AMDGPU 224 +#define EM_RISCV 243 +#define EM_BPF 247 +#define EM_NUM 248 + +#define EM_ALPHA 0x9026 + +#define EV_NONE 0 +#define EV_CURRENT 1 +#define EV_NUM 2 + +typedef struct { + Elf32_Word sh_name; + Elf32_Word sh_type; + Elf32_Word sh_flags; + Elf32_Addr sh_addr; + Elf32_Off sh_offset; + Elf32_Word sh_size; + Elf32_Word sh_link; + Elf32_Word sh_info; + Elf32_Word sh_addralign; + Elf32_Word sh_entsize; +} Elf32_Shdr; + +typedef struct { + Elf64_Word sh_name; + Elf64_Word sh_type; + Elf64_Xword sh_flags; + Elf64_Addr sh_addr; + Elf64_Off sh_offset; + Elf64_Xword sh_size; + Elf64_Word sh_link; + Elf64_Word sh_info; + Elf64_Xword sh_addralign; + Elf64_Xword sh_entsize; +} Elf64_Shdr; + + + +#define SHN_UNDEF 0 +#define SHN_LORESERVE 0xff00 +#define SHN_LOPROC 0xff00 +#define SHN_BEFORE 0xff00 + +#define SHN_AFTER 0xff01 + +#define SHN_HIPROC 0xff1f +#define SHN_LOOS 0xff20 +#define SHN_HIOS 0xff3f +#define SHN_ABS 0xfff1 +#define SHN_COMMON 0xfff2 +#define SHN_XINDEX 0xffff +#define SHN_HIRESERVE 0xffff + + + +#define SHT_NULL 0 +#define SHT_PROGBITS 1 +#define SHT_SYMTAB 2 +#define SHT_STRTAB 3 +#define SHT_RELA 4 +#define SHT_HASH 5 +#define SHT_DYNAMIC 6 +#define SHT_NOTE 7 +#define SHT_NOBITS 8 +#define SHT_REL 9 +#define SHT_SHLIB 10 +#define SHT_DYNSYM 11 +#define SHT_INIT_ARRAY 14 +#define SHT_FINI_ARRAY 15 +#define SHT_PREINIT_ARRAY 16 +#define SHT_GROUP 17 +#define SHT_SYMTAB_SHNDX 18 +#define SHT_NUM 19 +#define SHT_LOOS 0x60000000 +#define SHT_GNU_ATTRIBUTES 0x6ffffff5 +#define SHT_GNU_HASH 0x6ffffff6 +#define SHT_GNU_LIBLIST 0x6ffffff7 +#define SHT_CHECKSUM 0x6ffffff8 +#define SHT_LOSUNW 0x6ffffffa +#define SHT_SUNW_move 0x6ffffffa +#define SHT_SUNW_COMDAT 0x6ffffffb +#define SHT_SUNW_syminfo 0x6ffffffc +#define SHT_GNU_verdef 0x6ffffffd +#define SHT_GNU_verneed 0x6ffffffe +#define SHT_GNU_versym 0x6fffffff +#define SHT_HISUNW 0x6fffffff +#define SHT_HIOS 0x6fffffff +#define SHT_LOPROC 0x70000000 +#define SHT_HIPROC 0x7fffffff +#define SHT_LOUSER 0x80000000 +#define SHT_HIUSER 0x8fffffff + +#define SHF_WRITE (1 << 0) +#define SHF_ALLOC (1 << 1) +#define SHF_EXECINSTR (1 << 2) +#define SHF_MERGE (1 << 4) +#define SHF_STRINGS (1 << 5) +#define SHF_INFO_LINK (1 << 6) +#define SHF_LINK_ORDER (1 << 7) +#define SHF_OS_NONCONFORMING (1 << 8) + +#define SHF_GROUP (1 << 9) +#define SHF_TLS (1 << 10) +#define SHF_COMPRESSED (1 << 11) +#define SHF_MASKOS 0x0ff00000 +#define SHF_MASKPROC 0xf0000000 +#define SHF_ORDERED (1 << 30) +#define SHF_EXCLUDE (1U << 31) + +typedef struct { + Elf32_Word ch_type; + Elf32_Word ch_size; + Elf32_Word ch_addralign; +} Elf32_Chdr; + +typedef struct { + Elf64_Word ch_type; + Elf64_Word ch_reserved; + Elf64_Xword ch_size; + Elf64_Xword ch_addralign; +} Elf64_Chdr; + +#define ELFCOMPRESS_ZLIB 1 +#define ELFCOMPRESS_LOOS 0x60000000 +#define ELFCOMPRESS_HIOS 0x6fffffff +#define ELFCOMPRESS_LOPROC 0x70000000 +#define ELFCOMPRESS_HIPROC 0x7fffffff + + +#define GRP_COMDAT 0x1 + +typedef struct { + Elf32_Word st_name; + Elf32_Addr st_value; + Elf32_Word st_size; + unsigned char st_info; + unsigned char st_other; + Elf32_Section st_shndx; +} Elf32_Sym; + +typedef struct { + Elf64_Word st_name; + unsigned char st_info; + unsigned char st_other; + Elf64_Section st_shndx; + Elf64_Addr st_value; + Elf64_Xword st_size; +} Elf64_Sym; + +typedef struct { + Elf32_Half si_boundto; + Elf32_Half si_flags; +} Elf32_Syminfo; + +typedef struct { + Elf64_Half si_boundto; + Elf64_Half si_flags; +} Elf64_Syminfo; + +#define SYMINFO_BT_SELF 0xffff +#define SYMINFO_BT_PARENT 0xfffe +#define SYMINFO_BT_LOWRESERVE 0xff00 + +#define SYMINFO_FLG_DIRECT 0x0001 +#define SYMINFO_FLG_PASSTHRU 0x0002 +#define SYMINFO_FLG_COPY 0x0004 +#define SYMINFO_FLG_LAZYLOAD 0x0008 + +#define SYMINFO_NONE 0 +#define SYMINFO_CURRENT 1 +#define SYMINFO_NUM 2 + +#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4) +#define ELF32_ST_TYPE(val) ((val) & 0xf) +#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) + +#define ELF64_ST_BIND(val) ELF32_ST_BIND (val) +#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val) +#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type)) + +#define STB_LOCAL 0 +#define STB_GLOBAL 1 +#define STB_WEAK 2 +#define STB_NUM 3 +#define STB_LOOS 10 +#define STB_GNU_UNIQUE 10 +#define STB_HIOS 12 +#define STB_LOPROC 13 +#define STB_HIPROC 15 + +#define STT_NOTYPE 0 +#define STT_OBJECT 1 +#define STT_FUNC 2 +#define STT_SECTION 3 +#define STT_FILE 4 +#define STT_COMMON 5 +#define STT_TLS 6 +#define STT_NUM 7 +#define STT_LOOS 10 +#define STT_GNU_IFUNC 10 +#define STT_HIOS 12 +#define STT_LOPROC 13 +#define STT_HIPROC 15 + +#define STN_UNDEF 0 + +#define ELF32_ST_VISIBILITY(o) ((o) & 0x03) +#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o) + +#define STV_DEFAULT 0 +#define STV_INTERNAL 1 +#define STV_HIDDEN 2 +#define STV_PROTECTED 3 + + + + +typedef struct { + Elf32_Addr r_offset; + Elf32_Word r_info; +} Elf32_Rel; + +typedef struct { + Elf64_Addr r_offset; + Elf64_Xword r_info; +} Elf64_Rel; + + + +typedef struct { + Elf32_Addr r_offset; + Elf32_Word r_info; + Elf32_Sword r_addend; +} Elf32_Rela; + +typedef struct { + Elf64_Addr r_offset; + Elf64_Xword r_info; + Elf64_Sxword r_addend; +} Elf64_Rela; + + + +#define ELF32_R_SYM(val) ((val) >> 8) +#define ELF32_R_TYPE(val) ((val) & 0xff) +#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff)) + +#define ELF64_R_SYM(i) ((i) >> 32) +#define ELF64_R_TYPE(i) ((i) & 0xffffffff) +#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type)) + + + +typedef struct { + Elf32_Word p_type; + Elf32_Off p_offset; + Elf32_Addr p_vaddr; + Elf32_Addr p_paddr; + Elf32_Word p_filesz; + Elf32_Word p_memsz; + Elf32_Word p_flags; + Elf32_Word p_align; +} Elf32_Phdr; + +typedef struct { + Elf64_Word p_type; + Elf64_Word p_flags; + Elf64_Off p_offset; + Elf64_Addr p_vaddr; + Elf64_Addr p_paddr; + Elf64_Xword p_filesz; + Elf64_Xword p_memsz; + Elf64_Xword p_align; +} Elf64_Phdr; + + + +#define PT_NULL 0 +#define PT_LOAD 1 +#define PT_DYNAMIC 2 +#define PT_INTERP 3 +#define PT_NOTE 4 +#define PT_SHLIB 5 +#define PT_PHDR 6 +#define PT_TLS 7 +#define PT_NUM 8 +#define PT_LOOS 0x60000000 +#define PT_GNU_EH_FRAME 0x6474e550 +#define PT_GNU_STACK 0x6474e551 +#define PT_GNU_RELRO 0x6474e552 +#define PT_LOSUNW 0x6ffffffa +#define PT_SUNWBSS 0x6ffffffa +#define PT_SUNWSTACK 0x6ffffffb +#define PT_HISUNW 0x6fffffff +#define PT_HIOS 0x6fffffff +#define PT_LOPROC 0x70000000 +#define PT_HIPROC 0x7fffffff + + +#define PN_XNUM 0xffff + + +#define PF_X (1 << 0) +#define PF_W (1 << 1) +#define PF_R (1 << 2) +#define PF_MASKOS 0x0ff00000 +#define PF_MASKPROC 0xf0000000 + + + +#define NT_PRSTATUS 1 +#define NT_FPREGSET 2 +#define NT_PRPSINFO 3 +#define NT_PRXREG 4 +#define NT_TASKSTRUCT 4 +#define NT_PLATFORM 5 +#define NT_AUXV 6 +#define NT_GWINDOWS 7 +#define NT_ASRS 8 +#define NT_PSTATUS 10 +#define NT_PSINFO 13 +#define NT_PRCRED 14 +#define NT_UTSNAME 15 +#define NT_LWPSTATUS 16 +#define NT_LWPSINFO 17 +#define NT_PRFPXREG 20 +#define NT_SIGINFO 0x53494749 +#define NT_FILE 0x46494c45 +#define NT_PRXFPREG 0x46e62b7f +#define NT_PPC_VMX 0x100 +#define NT_PPC_SPE 0x101 +#define NT_PPC_VSX 0x102 +#define NT_386_TLS 0x200 +#define NT_386_IOPERM 0x201 +#define NT_X86_XSTATE 0x202 +#define NT_S390_HIGH_GPRS 0x300 +#define NT_S390_TIMER 0x301 +#define NT_S390_TODCMP 0x302 +#define NT_S390_TODPREG 0x303 +#define NT_S390_CTRS 0x304 +#define NT_S390_PREFIX 0x305 +#define NT_S390_LAST_BREAK 0x306 +#define NT_S390_SYSTEM_CALL 0x307 +#define NT_S390_TDB 0x308 +#define NT_ARM_VFP 0x400 +#define NT_ARM_TLS 0x401 +#define NT_ARM_HW_BREAK 0x402 +#define NT_ARM_HW_WATCH 0x403 +#define NT_ARM_SYSTEM_CALL 0x404 +#define NT_ARM_SVE 0x405 +#define NT_METAG_CBUF 0x500 +#define NT_METAG_RPIPE 0x501 +#define NT_METAG_TLS 0x502 +#define NT_VERSION 1 + + + + +typedef struct { + Elf32_Sword d_tag; + union { + Elf32_Word d_val; + Elf32_Addr d_ptr; + } d_un; +} Elf32_Dyn; + +typedef struct { + Elf64_Sxword d_tag; + union { + Elf64_Xword d_val; + Elf64_Addr d_ptr; + } d_un; +} Elf64_Dyn; + + + +#define DT_NULL 0 +#define DT_NEEDED 1 +#define DT_PLTRELSZ 2 +#define DT_PLTGOT 3 +#define DT_HASH 4 +#define DT_STRTAB 5 +#define DT_SYMTAB 6 +#define DT_RELA 7 +#define DT_RELASZ 8 +#define DT_RELAENT 9 +#define DT_STRSZ 10 +#define DT_SYMENT 11 +#define DT_INIT 12 +#define DT_FINI 13 +#define DT_SONAME 14 +#define DT_RPATH 15 +#define DT_SYMBOLIC 16 +#define DT_REL 17 +#define DT_RELSZ 18 +#define DT_RELENT 19 +#define DT_PLTREL 20 +#define DT_DEBUG 21 +#define DT_TEXTREL 22 +#define DT_JMPREL 23 +#define DT_BIND_NOW 24 +#define DT_INIT_ARRAY 25 +#define DT_FINI_ARRAY 26 +#define DT_INIT_ARRAYSZ 27 +#define DT_FINI_ARRAYSZ 28 +#define DT_RUNPATH 29 +#define DT_FLAGS 30 +#define DT_ENCODING 32 +#define DT_PREINIT_ARRAY 32 +#define DT_PREINIT_ARRAYSZ 33 +#define DT_NUM 34 +#define DT_LOOS 0x6000000d +#define DT_HIOS 0x6ffff000 +#define DT_LOPROC 0x70000000 +#define DT_HIPROC 0x7fffffff +#define DT_PROCNUM DT_MIPS_NUM + +#define DT_VALRNGLO 0x6ffffd00 +#define DT_GNU_PRELINKED 0x6ffffdf5 +#define DT_GNU_CONFLICTSZ 0x6ffffdf6 +#define DT_GNU_LIBLISTSZ 0x6ffffdf7 +#define DT_CHECKSUM 0x6ffffdf8 +#define DT_PLTPADSZ 0x6ffffdf9 +#define DT_MOVEENT 0x6ffffdfa +#define DT_MOVESZ 0x6ffffdfb +#define DT_FEATURE_1 0x6ffffdfc +#define DT_POSFLAG_1 0x6ffffdfd + +#define DT_SYMINSZ 0x6ffffdfe +#define DT_SYMINENT 0x6ffffdff +#define DT_VALRNGHI 0x6ffffdff +#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) +#define DT_VALNUM 12 + +#define DT_ADDRRNGLO 0x6ffffe00 +#define DT_GNU_HASH 0x6ffffef5 +#define DT_TLSDESC_PLT 0x6ffffef6 +#define DT_TLSDESC_GOT 0x6ffffef7 +#define DT_GNU_CONFLICT 0x6ffffef8 +#define DT_GNU_LIBLIST 0x6ffffef9 +#define DT_CONFIG 0x6ffffefa +#define DT_DEPAUDIT 0x6ffffefb +#define DT_AUDIT 0x6ffffefc +#define DT_PLTPAD 0x6ffffefd +#define DT_MOVETAB 0x6ffffefe +#define DT_SYMINFO 0x6ffffeff +#define DT_ADDRRNGHI 0x6ffffeff +#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) +#define DT_ADDRNUM 11 + + + +#define DT_VERSYM 0x6ffffff0 + +#define DT_RELACOUNT 0x6ffffff9 +#define DT_RELCOUNT 0x6ffffffa + + +#define DT_FLAGS_1 0x6ffffffb +#define DT_VERDEF 0x6ffffffc + +#define DT_VERDEFNUM 0x6ffffffd +#define DT_VERNEED 0x6ffffffe + +#define DT_VERNEEDNUM 0x6fffffff +#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) +#define DT_VERSIONTAGNUM 16 + + + +#define DT_AUXILIARY 0x7ffffffd +#define DT_FILTER 0x7fffffff +#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1) +#define DT_EXTRANUM 3 + + +#define DF_ORIGIN 0x00000001 +#define DF_SYMBOLIC 0x00000002 +#define DF_TEXTREL 0x00000004 +#define DF_BIND_NOW 0x00000008 +#define DF_STATIC_TLS 0x00000010 + + + +#define DF_1_NOW 0x00000001 +#define DF_1_GLOBAL 0x00000002 +#define DF_1_GROUP 0x00000004 +#define DF_1_NODELETE 0x00000008 +#define DF_1_LOADFLTR 0x00000010 +#define DF_1_INITFIRST 0x00000020 +#define DF_1_NOOPEN 0x00000040 +#define DF_1_ORIGIN 0x00000080 +#define DF_1_DIRECT 0x00000100 +#define DF_1_TRANS 0x00000200 +#define DF_1_INTERPOSE 0x00000400 +#define DF_1_NODEFLIB 0x00000800 +#define DF_1_NODUMP 0x00001000 +#define DF_1_CONFALT 0x00002000 +#define DF_1_ENDFILTEE 0x00004000 +#define DF_1_DISPRELDNE 0x00008000 +#define DF_1_DISPRELPND 0x00010000 +#define DF_1_NODIRECT 0x00020000 +#define DF_1_IGNMULDEF 0x00040000 +#define DF_1_NOKSYMS 0x00080000 +#define DF_1_NOHDR 0x00100000 +#define DF_1_EDITED 0x00200000 +#define DF_1_NORELOC 0x00400000 +#define DF_1_SYMINTPOSE 0x00800000 +#define DF_1_GLOBAUDIT 0x01000000 +#define DF_1_SINGLETON 0x02000000 + +#define DTF_1_PARINIT 0x00000001 +#define DTF_1_CONFEXP 0x00000002 + + +#define DF_P1_LAZYLOAD 0x00000001 +#define DF_P1_GROUPPERM 0x00000002 + + + + +typedef struct { + Elf32_Half vd_version; + Elf32_Half vd_flags; + Elf32_Half vd_ndx; + Elf32_Half vd_cnt; + Elf32_Word vd_hash; + Elf32_Word vd_aux; + Elf32_Word vd_next; +} Elf32_Verdef; + +typedef struct { + Elf64_Half vd_version; + Elf64_Half vd_flags; + Elf64_Half vd_ndx; + Elf64_Half vd_cnt; + Elf64_Word vd_hash; + Elf64_Word vd_aux; + Elf64_Word vd_next; +} Elf64_Verdef; + + + +#define VER_DEF_NONE 0 +#define VER_DEF_CURRENT 1 +#define VER_DEF_NUM 2 + + +#define VER_FLG_BASE 0x1 +#define VER_FLG_WEAK 0x2 + + +#define VER_NDX_LOCAL 0 +#define VER_NDX_GLOBAL 1 +#define VER_NDX_LORESERVE 0xff00 +#define VER_NDX_ELIMINATE 0xff01 + + + +typedef struct { + Elf32_Word vda_name; + Elf32_Word vda_next; +} Elf32_Verdaux; + +typedef struct { + Elf64_Word vda_name; + Elf64_Word vda_next; +} Elf64_Verdaux; + + + + +typedef struct { + Elf32_Half vn_version; + Elf32_Half vn_cnt; + Elf32_Word vn_file; + Elf32_Word vn_aux; + Elf32_Word vn_next; +} Elf32_Verneed; + +typedef struct { + Elf64_Half vn_version; + Elf64_Half vn_cnt; + Elf64_Word vn_file; + Elf64_Word vn_aux; + Elf64_Word vn_next; +} Elf64_Verneed; + + + +#define VER_NEED_NONE 0 +#define VER_NEED_CURRENT 1 +#define VER_NEED_NUM 2 + + + +typedef struct { + Elf32_Word vna_hash; + Elf32_Half vna_flags; + Elf32_Half vna_other; + Elf32_Word vna_name; + Elf32_Word vna_next; +} Elf32_Vernaux; + +typedef struct { + Elf64_Word vna_hash; + Elf64_Half vna_flags; + Elf64_Half vna_other; + Elf64_Word vna_name; + Elf64_Word vna_next; +} Elf64_Vernaux; + + + +#define VER_FLG_WEAK 0x2 + + + +typedef struct { + uint32_t a_type; + union { + uint32_t a_val; + } a_un; +} Elf32_auxv_t; + +typedef struct { + uint64_t a_type; + union { + uint64_t a_val; + } a_un; +} Elf64_auxv_t; + + + +#define AT_NULL 0 +#define AT_IGNORE 1 +#define AT_EXECFD 2 +#define AT_PHDR 3 +#define AT_PHENT 4 +#define AT_PHNUM 5 +#define AT_PAGESZ 6 +#define AT_BASE 7 +#define AT_FLAGS 8 +#define AT_ENTRY 9 +#define AT_NOTELF 10 +#define AT_UID 11 +#define AT_EUID 12 +#define AT_GID 13 +#define AT_EGID 14 +#define AT_CLKTCK 17 + + +#define AT_PLATFORM 15 +#define AT_HWCAP 16 + + + + +#define AT_FPUCW 18 + + +#define AT_DCACHEBSIZE 19 +#define AT_ICACHEBSIZE 20 +#define AT_UCACHEBSIZE 21 + + + +#define AT_IGNOREPPC 22 + +#define AT_SECURE 23 + +#define AT_BASE_PLATFORM 24 + +#define AT_RANDOM 25 + +#define AT_HWCAP2 26 + +#define AT_EXECFN 31 + + + +#define AT_SYSINFO 32 +#define AT_SYSINFO_EHDR 33 + + + +#define AT_L1I_CACHESHAPE 34 +#define AT_L1D_CACHESHAPE 35 +#define AT_L2_CACHESHAPE 36 +#define AT_L3_CACHESHAPE 37 + + + + +typedef struct { + Elf32_Word n_namesz; + Elf32_Word n_descsz; + Elf32_Word n_type; +} Elf32_Nhdr; + +typedef struct { + Elf64_Word n_namesz; + Elf64_Word n_descsz; + Elf64_Word n_type; +} Elf64_Nhdr; + + + + +#define ELF_NOTE_SOLARIS "SUNW Solaris" + + +#define ELF_NOTE_GNU "GNU" + + + + + +#define ELF_NOTE_PAGESIZE_HINT 1 + + +#define NT_GNU_ABI_TAG 1 +#define ELF_NOTE_ABI NT_GNU_ABI_TAG + + + +#define ELF_NOTE_OS_LINUX 0 +#define ELF_NOTE_OS_GNU 1 +#define ELF_NOTE_OS_SOLARIS2 2 +#define ELF_NOTE_OS_FREEBSD 3 + +#define NT_GNU_BUILD_ID 3 +#define NT_GNU_GOLD_VERSION 4 + + + +typedef struct { + Elf32_Xword m_value; + Elf32_Word m_info; + Elf32_Word m_poffset; + Elf32_Half m_repeat; + Elf32_Half m_stride; +} Elf32_Move; + +typedef struct { + Elf64_Xword m_value; + Elf64_Xword m_info; + Elf64_Xword m_poffset; + Elf64_Half m_repeat; + Elf64_Half m_stride; +} Elf64_Move; + + +#define ELF32_M_SYM(info) ((info) >> 8) +#define ELF32_M_SIZE(info) ((unsigned char) (info)) +#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size)) + +#define ELF64_M_SYM(info) ELF32_M_SYM (info) +#define ELF64_M_SIZE(info) ELF32_M_SIZE (info) +#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size) + +#define EF_CPU32 0x00810000 + +#define R_68K_NONE 0 +#define R_68K_32 1 +#define R_68K_16 2 +#define R_68K_8 3 +#define R_68K_PC32 4 +#define R_68K_PC16 5 +#define R_68K_PC8 6 +#define R_68K_GOT32 7 +#define R_68K_GOT16 8 +#define R_68K_GOT8 9 +#define R_68K_GOT32O 10 +#define R_68K_GOT16O 11 +#define R_68K_GOT8O 12 +#define R_68K_PLT32 13 +#define R_68K_PLT16 14 +#define R_68K_PLT8 15 +#define R_68K_PLT32O 16 +#define R_68K_PLT16O 17 +#define R_68K_PLT8O 18 +#define R_68K_COPY 19 +#define R_68K_GLOB_DAT 20 +#define R_68K_JMP_SLOT 21 +#define R_68K_RELATIVE 22 +#define R_68K_NUM 23 + +#define R_386_NONE 0 +#define R_386_32 1 +#define R_386_PC32 2 +#define R_386_GOT32 3 +#define R_386_PLT32 4 +#define R_386_COPY 5 +#define R_386_GLOB_DAT 6 +#define R_386_JMP_SLOT 7 +#define R_386_RELATIVE 8 +#define R_386_GOTOFF 9 +#define R_386_GOTPC 10 +#define R_386_32PLT 11 +#define R_386_TLS_TPOFF 14 +#define R_386_TLS_IE 15 +#define R_386_TLS_GOTIE 16 +#define R_386_TLS_LE 17 +#define R_386_TLS_GD 18 +#define R_386_TLS_LDM 19 +#define R_386_16 20 +#define R_386_PC16 21 +#define R_386_8 22 +#define R_386_PC8 23 +#define R_386_TLS_GD_32 24 +#define R_386_TLS_GD_PUSH 25 +#define R_386_TLS_GD_CALL 26 +#define R_386_TLS_GD_POP 27 +#define R_386_TLS_LDM_32 28 +#define R_386_TLS_LDM_PUSH 29 +#define R_386_TLS_LDM_CALL 30 +#define R_386_TLS_LDM_POP 31 +#define R_386_TLS_LDO_32 32 +#define R_386_TLS_IE_32 33 +#define R_386_TLS_LE_32 34 +#define R_386_TLS_DTPMOD32 35 +#define R_386_TLS_DTPOFF32 36 +#define R_386_TLS_TPOFF32 37 +#define R_386_SIZE32 38 +#define R_386_TLS_GOTDESC 39 +#define R_386_TLS_DESC_CALL 40 +#define R_386_TLS_DESC 41 +#define R_386_IRELATIVE 42 +#define R_386_GOT32X 43 +#define R_386_NUM 44 + + + + + +#define STT_SPARC_REGISTER 13 + + + +#define EF_SPARCV9_MM 3 +#define EF_SPARCV9_TSO 0 +#define EF_SPARCV9_PSO 1 +#define EF_SPARCV9_RMO 2 +#define EF_SPARC_LEDATA 0x800000 +#define EF_SPARC_EXT_MASK 0xFFFF00 +#define EF_SPARC_32PLUS 0x000100 +#define EF_SPARC_SUN_US1 0x000200 +#define EF_SPARC_HAL_R1 0x000400 +#define EF_SPARC_SUN_US3 0x000800 + + + +#define R_SPARC_NONE 0 +#define R_SPARC_8 1 +#define R_SPARC_16 2 +#define R_SPARC_32 3 +#define R_SPARC_DISP8 4 +#define R_SPARC_DISP16 5 +#define R_SPARC_DISP32 6 +#define R_SPARC_WDISP30 7 +#define R_SPARC_WDISP22 8 +#define R_SPARC_HI22 9 +#define R_SPARC_22 10 +#define R_SPARC_13 11 +#define R_SPARC_LO10 12 +#define R_SPARC_GOT10 13 +#define R_SPARC_GOT13 14 +#define R_SPARC_GOT22 15 +#define R_SPARC_PC10 16 +#define R_SPARC_PC22 17 +#define R_SPARC_WPLT30 18 +#define R_SPARC_COPY 19 +#define R_SPARC_GLOB_DAT 20 +#define R_SPARC_JMP_SLOT 21 +#define R_SPARC_RELATIVE 22 +#define R_SPARC_UA32 23 + + + +#define R_SPARC_PLT32 24 +#define R_SPARC_HIPLT22 25 +#define R_SPARC_LOPLT10 26 +#define R_SPARC_PCPLT32 27 +#define R_SPARC_PCPLT22 28 +#define R_SPARC_PCPLT10 29 +#define R_SPARC_10 30 +#define R_SPARC_11 31 +#define R_SPARC_64 32 +#define R_SPARC_OLO10 33 +#define R_SPARC_HH22 34 +#define R_SPARC_HM10 35 +#define R_SPARC_LM22 36 +#define R_SPARC_PC_HH22 37 +#define R_SPARC_PC_HM10 38 +#define R_SPARC_PC_LM22 39 +#define R_SPARC_WDISP16 40 +#define R_SPARC_WDISP19 41 +#define R_SPARC_GLOB_JMP 42 +#define R_SPARC_7 43 +#define R_SPARC_5 44 +#define R_SPARC_6 45 +#define R_SPARC_DISP64 46 +#define R_SPARC_PLT64 47 +#define R_SPARC_HIX22 48 +#define R_SPARC_LOX10 49 +#define R_SPARC_H44 50 +#define R_SPARC_M44 51 +#define R_SPARC_L44 52 +#define R_SPARC_REGISTER 53 +#define R_SPARC_UA64 54 +#define R_SPARC_UA16 55 +#define R_SPARC_TLS_GD_HI22 56 +#define R_SPARC_TLS_GD_LO10 57 +#define R_SPARC_TLS_GD_ADD 58 +#define R_SPARC_TLS_GD_CALL 59 +#define R_SPARC_TLS_LDM_HI22 60 +#define R_SPARC_TLS_LDM_LO10 61 +#define R_SPARC_TLS_LDM_ADD 62 +#define R_SPARC_TLS_LDM_CALL 63 +#define R_SPARC_TLS_LDO_HIX22 64 +#define R_SPARC_TLS_LDO_LOX10 65 +#define R_SPARC_TLS_LDO_ADD 66 +#define R_SPARC_TLS_IE_HI22 67 +#define R_SPARC_TLS_IE_LO10 68 +#define R_SPARC_TLS_IE_LD 69 +#define R_SPARC_TLS_IE_LDX 70 +#define R_SPARC_TLS_IE_ADD 71 +#define R_SPARC_TLS_LE_HIX22 72 +#define R_SPARC_TLS_LE_LOX10 73 +#define R_SPARC_TLS_DTPMOD32 74 +#define R_SPARC_TLS_DTPMOD64 75 +#define R_SPARC_TLS_DTPOFF32 76 +#define R_SPARC_TLS_DTPOFF64 77 +#define R_SPARC_TLS_TPOFF32 78 +#define R_SPARC_TLS_TPOFF64 79 +#define R_SPARC_GOTDATA_HIX22 80 +#define R_SPARC_GOTDATA_LOX10 81 +#define R_SPARC_GOTDATA_OP_HIX22 82 +#define R_SPARC_GOTDATA_OP_LOX10 83 +#define R_SPARC_GOTDATA_OP 84 +#define R_SPARC_H34 85 +#define R_SPARC_SIZE32 86 +#define R_SPARC_SIZE64 87 +#define R_SPARC_GNU_VTINHERIT 250 +#define R_SPARC_GNU_VTENTRY 251 +#define R_SPARC_REV32 252 + +#define R_SPARC_NUM 253 + + + +#define DT_SPARC_REGISTER 0x70000001 +#define DT_SPARC_NUM 2 + + +#define EF_MIPS_NOREORDER 1 +#define EF_MIPS_PIC 2 +#define EF_MIPS_CPIC 4 +#define EF_MIPS_XGOT 8 +#define EF_MIPS_64BIT_WHIRL 16 +#define EF_MIPS_ABI2 32 +#define EF_MIPS_ABI_ON32 64 +#define EF_MIPS_FP64 512 +#define EF_MIPS_NAN2008 1024 +#define EF_MIPS_ARCH 0xf0000000 + + + +#define EF_MIPS_ARCH_1 0x00000000 +#define EF_MIPS_ARCH_2 0x10000000 +#define EF_MIPS_ARCH_3 0x20000000 +#define EF_MIPS_ARCH_4 0x30000000 +#define EF_MIPS_ARCH_5 0x40000000 +#define EF_MIPS_ARCH_32 0x50000000 +#define EF_MIPS_ARCH_64 0x60000000 +#define EF_MIPS_ARCH_32R2 0x70000000 +#define EF_MIPS_ARCH_64R2 0x80000000 + + +#define E_MIPS_ARCH_1 0x00000000 +#define E_MIPS_ARCH_2 0x10000000 +#define E_MIPS_ARCH_3 0x20000000 +#define E_MIPS_ARCH_4 0x30000000 +#define E_MIPS_ARCH_5 0x40000000 +#define E_MIPS_ARCH_32 0x50000000 +#define E_MIPS_ARCH_64 0x60000000 + + + +#define SHN_MIPS_ACOMMON 0xff00 +#define SHN_MIPS_TEXT 0xff01 +#define SHN_MIPS_DATA 0xff02 +#define SHN_MIPS_SCOMMON 0xff03 +#define SHN_MIPS_SUNDEFINED 0xff04 + + + +#define SHT_MIPS_LIBLIST 0x70000000 +#define SHT_MIPS_MSYM 0x70000001 +#define SHT_MIPS_CONFLICT 0x70000002 +#define SHT_MIPS_GPTAB 0x70000003 +#define SHT_MIPS_UCODE 0x70000004 +#define SHT_MIPS_DEBUG 0x70000005 +#define SHT_MIPS_REGINFO 0x70000006 +#define SHT_MIPS_PACKAGE 0x70000007 +#define SHT_MIPS_PACKSYM 0x70000008 +#define SHT_MIPS_RELD 0x70000009 +#define SHT_MIPS_IFACE 0x7000000b +#define SHT_MIPS_CONTENT 0x7000000c +#define SHT_MIPS_OPTIONS 0x7000000d +#define SHT_MIPS_SHDR 0x70000010 +#define SHT_MIPS_FDESC 0x70000011 +#define SHT_MIPS_EXTSYM 0x70000012 +#define SHT_MIPS_DENSE 0x70000013 +#define SHT_MIPS_PDESC 0x70000014 +#define SHT_MIPS_LOCSYM 0x70000015 +#define SHT_MIPS_AUXSYM 0x70000016 +#define SHT_MIPS_OPTSYM 0x70000017 +#define SHT_MIPS_LOCSTR 0x70000018 +#define SHT_MIPS_LINE 0x70000019 +#define SHT_MIPS_RFDESC 0x7000001a +#define SHT_MIPS_DELTASYM 0x7000001b +#define SHT_MIPS_DELTAINST 0x7000001c +#define SHT_MIPS_DELTACLASS 0x7000001d +#define SHT_MIPS_DWARF 0x7000001e +#define SHT_MIPS_DELTADECL 0x7000001f +#define SHT_MIPS_SYMBOL_LIB 0x70000020 +#define SHT_MIPS_EVENTS 0x70000021 +#define SHT_MIPS_TRANSLATE 0x70000022 +#define SHT_MIPS_PIXIE 0x70000023 +#define SHT_MIPS_XLATE 0x70000024 +#define SHT_MIPS_XLATE_DEBUG 0x70000025 +#define SHT_MIPS_WHIRL 0x70000026 +#define SHT_MIPS_EH_REGION 0x70000027 +#define SHT_MIPS_XLATE_OLD 0x70000028 +#define SHT_MIPS_PDR_EXCEPTION 0x70000029 + + + +#define SHF_MIPS_GPREL 0x10000000 +#define SHF_MIPS_MERGE 0x20000000 +#define SHF_MIPS_ADDR 0x40000000 +#define SHF_MIPS_STRINGS 0x80000000 +#define SHF_MIPS_NOSTRIP 0x08000000 +#define SHF_MIPS_LOCAL 0x04000000 +#define SHF_MIPS_NAMES 0x02000000 +#define SHF_MIPS_NODUPE 0x01000000 + + + + + +#define STO_MIPS_DEFAULT 0x0 +#define STO_MIPS_INTERNAL 0x1 +#define STO_MIPS_HIDDEN 0x2 +#define STO_MIPS_PROTECTED 0x3 +#define STO_MIPS_PLT 0x8 +#define STO_MIPS_SC_ALIGN_UNUSED 0xff + + +#define STB_MIPS_SPLIT_COMMON 13 + + + +typedef union { + struct { + Elf32_Word gt_current_g_value; + Elf32_Word gt_unused; + } gt_header; + struct { + Elf32_Word gt_g_value; + Elf32_Word gt_bytes; + } gt_entry; +} Elf32_gptab; + + + +typedef struct { + Elf32_Word ri_gprmask; + Elf32_Word ri_cprmask[4]; + Elf32_Sword ri_gp_value; +} Elf32_RegInfo; + + + +typedef struct { + unsigned char kind; + + unsigned char size; + Elf32_Section section; + + Elf32_Word info; +} Elf_Options; + + + +#define ODK_NULL 0 +#define ODK_REGINFO 1 +#define ODK_EXCEPTIONS 2 +#define ODK_PAD 3 +#define ODK_HWPATCH 4 +#define ODK_FILL 5 +#define ODK_TAGS 6 +#define ODK_HWAND 7 +#define ODK_HWOR 8 + + + +#define OEX_FPU_MIN 0x1f +#define OEX_FPU_MAX 0x1f00 +#define OEX_PAGE0 0x10000 +#define OEX_SMM 0x20000 +#define OEX_FPDBUG 0x40000 +#define OEX_PRECISEFP OEX_FPDBUG +#define OEX_DISMISS 0x80000 + +#define OEX_FPU_INVAL 0x10 +#define OEX_FPU_DIV0 0x08 +#define OEX_FPU_OFLO 0x04 +#define OEX_FPU_UFLO 0x02 +#define OEX_FPU_INEX 0x01 + + + +#define OHW_R4KEOP 0x1 +#define OHW_R8KPFETCH 0x2 +#define OHW_R5KEOP 0x4 +#define OHW_R5KCVTL 0x8 + +#define OPAD_PREFIX 0x1 +#define OPAD_POSTFIX 0x2 +#define OPAD_SYMBOL 0x4 + + + +typedef struct { + Elf32_Word hwp_flags1; + Elf32_Word hwp_flags2; +} Elf_Options_Hw; + + + +#define OHWA0_R4KEOP_CHECKED 0x00000001 +#define OHWA1_R4KEOP_CLEAN 0x00000002 + + + +#define R_MIPS_NONE 0 +#define R_MIPS_16 1 +#define R_MIPS_32 2 +#define R_MIPS_REL32 3 +#define R_MIPS_26 4 +#define R_MIPS_HI16 5 +#define R_MIPS_LO16 6 +#define R_MIPS_GPREL16 7 +#define R_MIPS_LITERAL 8 +#define R_MIPS_GOT16 9 +#define R_MIPS_PC16 10 +#define R_MIPS_CALL16 11 +#define R_MIPS_GPREL32 12 + +#define R_MIPS_SHIFT5 16 +#define R_MIPS_SHIFT6 17 +#define R_MIPS_64 18 +#define R_MIPS_GOT_DISP 19 +#define R_MIPS_GOT_PAGE 20 +#define R_MIPS_GOT_OFST 21 +#define R_MIPS_GOT_HI16 22 +#define R_MIPS_GOT_LO16 23 +#define R_MIPS_SUB 24 +#define R_MIPS_INSERT_A 25 +#define R_MIPS_INSERT_B 26 +#define R_MIPS_DELETE 27 +#define R_MIPS_HIGHER 28 +#define R_MIPS_HIGHEST 29 +#define R_MIPS_CALL_HI16 30 +#define R_MIPS_CALL_LO16 31 +#define R_MIPS_SCN_DISP 32 +#define R_MIPS_REL16 33 +#define R_MIPS_ADD_IMMEDIATE 34 +#define R_MIPS_PJUMP 35 +#define R_MIPS_RELGOT 36 +#define R_MIPS_JALR 37 +#define R_MIPS_TLS_DTPMOD32 38 +#define R_MIPS_TLS_DTPREL32 39 +#define R_MIPS_TLS_DTPMOD64 40 +#define R_MIPS_TLS_DTPREL64 41 +#define R_MIPS_TLS_GD 42 +#define R_MIPS_TLS_LDM 43 +#define R_MIPS_TLS_DTPREL_HI16 44 +#define R_MIPS_TLS_DTPREL_LO16 45 +#define R_MIPS_TLS_GOTTPREL 46 +#define R_MIPS_TLS_TPREL32 47 +#define R_MIPS_TLS_TPREL64 48 +#define R_MIPS_TLS_TPREL_HI16 49 +#define R_MIPS_TLS_TPREL_LO16 50 +#define R_MIPS_GLOB_DAT 51 +#define R_MIPS_COPY 126 +#define R_MIPS_JUMP_SLOT 127 + +#define R_MIPS_NUM 128 + + + +#define PT_MIPS_REGINFO 0x70000000 +#define PT_MIPS_RTPROC 0x70000001 +#define PT_MIPS_OPTIONS 0x70000002 +#define PT_MIPS_ABIFLAGS 0x70000003 + + + +#define PF_MIPS_LOCAL 0x10000000 + + + +#define DT_MIPS_RLD_VERSION 0x70000001 +#define DT_MIPS_TIME_STAMP 0x70000002 +#define DT_MIPS_ICHECKSUM 0x70000003 +#define DT_MIPS_IVERSION 0x70000004 +#define DT_MIPS_FLAGS 0x70000005 +#define DT_MIPS_BASE_ADDRESS 0x70000006 +#define DT_MIPS_MSYM 0x70000007 +#define DT_MIPS_CONFLICT 0x70000008 +#define DT_MIPS_LIBLIST 0x70000009 +#define DT_MIPS_LOCAL_GOTNO 0x7000000a +#define DT_MIPS_CONFLICTNO 0x7000000b +#define DT_MIPS_LIBLISTNO 0x70000010 +#define DT_MIPS_SYMTABNO 0x70000011 +#define DT_MIPS_UNREFEXTNO 0x70000012 +#define DT_MIPS_GOTSYM 0x70000013 +#define DT_MIPS_HIPAGENO 0x70000014 +#define DT_MIPS_RLD_MAP 0x70000016 +#define DT_MIPS_DELTA_CLASS 0x70000017 +#define DT_MIPS_DELTA_CLASS_NO 0x70000018 + +#define DT_MIPS_DELTA_INSTANCE 0x70000019 +#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a + +#define DT_MIPS_DELTA_RELOC 0x7000001b +#define DT_MIPS_DELTA_RELOC_NO 0x7000001c + +#define DT_MIPS_DELTA_SYM 0x7000001d + +#define DT_MIPS_DELTA_SYM_NO 0x7000001e + +#define DT_MIPS_DELTA_CLASSSYM 0x70000020 + +#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 + +#define DT_MIPS_CXX_FLAGS 0x70000022 +#define DT_MIPS_PIXIE_INIT 0x70000023 +#define DT_MIPS_SYMBOL_LIB 0x70000024 +#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025 +#define DT_MIPS_LOCAL_GOTIDX 0x70000026 +#define DT_MIPS_HIDDEN_GOTIDX 0x70000027 +#define DT_MIPS_PROTECTED_GOTIDX 0x70000028 +#define DT_MIPS_OPTIONS 0x70000029 +#define DT_MIPS_INTERFACE 0x7000002a +#define DT_MIPS_DYNSTR_ALIGN 0x7000002b +#define DT_MIPS_INTERFACE_SIZE 0x7000002c +#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d + +#define DT_MIPS_PERF_SUFFIX 0x7000002e + +#define DT_MIPS_COMPACT_SIZE 0x7000002f +#define DT_MIPS_GP_VALUE 0x70000030 +#define DT_MIPS_AUX_DYNAMIC 0x70000031 + +#define DT_MIPS_PLTGOT 0x70000032 + +#define DT_MIPS_RWPLT 0x70000034 +#define DT_MIPS_RLD_MAP_REL 0x70000035 +#define DT_MIPS_NUM 0x36 + + + +#define RHF_NONE 0 +#define RHF_QUICKSTART (1 << 0) +#define RHF_NOTPOT (1 << 1) +#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2) +#define RHF_NO_MOVE (1 << 3) +#define RHF_SGI_ONLY (1 << 4) +#define RHF_GUARANTEE_INIT (1 << 5) +#define RHF_DELTA_C_PLUS_PLUS (1 << 6) +#define RHF_GUARANTEE_START_INIT (1 << 7) +#define RHF_PIXIE (1 << 8) +#define RHF_DEFAULT_DELAY_LOAD (1 << 9) +#define RHF_REQUICKSTART (1 << 10) +#define RHF_REQUICKSTARTED (1 << 11) +#define RHF_CORD (1 << 12) +#define RHF_NO_UNRES_UNDEF (1 << 13) +#define RHF_RLD_ORDER_SAFE (1 << 14) + + + +typedef struct { + Elf32_Word l_name; + Elf32_Word l_time_stamp; + Elf32_Word l_checksum; + Elf32_Word l_version; + Elf32_Word l_flags; +} Elf32_Lib; + +typedef struct { + Elf64_Word l_name; + Elf64_Word l_time_stamp; + Elf64_Word l_checksum; + Elf64_Word l_version; + Elf64_Word l_flags; +} Elf64_Lib; + + + + +#define LL_NONE 0 +#define LL_EXACT_MATCH (1 << 0) +#define LL_IGNORE_INT_VER (1 << 1) +#define LL_REQUIRE_MINOR (1 << 2) +#define LL_EXPORTS (1 << 3) +#define LL_DELAY_LOAD (1 << 4) +#define LL_DELTA (1 << 5) + + + +typedef Elf32_Addr Elf32_Conflict; + +typedef struct { + Elf32_Half version; + unsigned char isa_level; + unsigned char isa_rev; + unsigned char gpr_size; + unsigned char cpr1_size; + unsigned char cpr2_size; + unsigned char fp_abi; + Elf32_Word isa_ext; + Elf32_Word ases; + Elf32_Word flags1; + Elf32_Word flags2; +} Elf_MIPS_ABIFlags_v0; + +#define MIPS_AFL_REG_NONE 0x00 +#define MIPS_AFL_REG_32 0x01 +#define MIPS_AFL_REG_64 0x02 +#define MIPS_AFL_REG_128 0x03 + +#define MIPS_AFL_ASE_DSP 0x00000001 +#define MIPS_AFL_ASE_DSPR2 0x00000002 +#define MIPS_AFL_ASE_EVA 0x00000004 +#define MIPS_AFL_ASE_MCU 0x00000008 +#define MIPS_AFL_ASE_MDMX 0x00000010 +#define MIPS_AFL_ASE_MIPS3D 0x00000020 +#define MIPS_AFL_ASE_MT 0x00000040 +#define MIPS_AFL_ASE_SMARTMIPS 0x00000080 +#define MIPS_AFL_ASE_VIRT 0x00000100 +#define MIPS_AFL_ASE_MSA 0x00000200 +#define MIPS_AFL_ASE_MIPS16 0x00000400 +#define MIPS_AFL_ASE_MICROMIPS 0x00000800 +#define MIPS_AFL_ASE_XPA 0x00001000 +#define MIPS_AFL_ASE_MASK 0x00001fff + +#define MIPS_AFL_EXT_XLR 1 +#define MIPS_AFL_EXT_OCTEON2 2 +#define MIPS_AFL_EXT_OCTEONP 3 +#define MIPS_AFL_EXT_LOONGSON_3A 4 +#define MIPS_AFL_EXT_OCTEON 5 +#define MIPS_AFL_EXT_5900 6 +#define MIPS_AFL_EXT_4650 7 +#define MIPS_AFL_EXT_4010 8 +#define MIPS_AFL_EXT_4100 9 +#define MIPS_AFL_EXT_3900 10 +#define MIPS_AFL_EXT_10000 11 +#define MIPS_AFL_EXT_SB1 12 +#define MIPS_AFL_EXT_4111 13 +#define MIPS_AFL_EXT_4120 14 +#define MIPS_AFL_EXT_5400 15 +#define MIPS_AFL_EXT_5500 16 +#define MIPS_AFL_EXT_LOONGSON_2E 17 +#define MIPS_AFL_EXT_LOONGSON_2F 18 + +#define MIPS_AFL_FLAGS1_ODDSPREG 1 + +enum +{ + Val_GNU_MIPS_ABI_FP_ANY = 0, + Val_GNU_MIPS_ABI_FP_DOUBLE = 1, + Val_GNU_MIPS_ABI_FP_SINGLE = 2, + Val_GNU_MIPS_ABI_FP_SOFT = 3, + Val_GNU_MIPS_ABI_FP_OLD_64 = 4, + Val_GNU_MIPS_ABI_FP_XX = 5, + Val_GNU_MIPS_ABI_FP_64 = 6, + Val_GNU_MIPS_ABI_FP_64A = 7, + Val_GNU_MIPS_ABI_FP_MAX = 7 +}; + + + + +#define EF_PARISC_TRAPNIL 0x00010000 +#define EF_PARISC_EXT 0x00020000 +#define EF_PARISC_LSB 0x00040000 +#define EF_PARISC_WIDE 0x00080000 +#define EF_PARISC_NO_KABP 0x00100000 + +#define EF_PARISC_LAZYSWAP 0x00400000 +#define EF_PARISC_ARCH 0x0000ffff + + + +#define EFA_PARISC_1_0 0x020b +#define EFA_PARISC_1_1 0x0210 +#define EFA_PARISC_2_0 0x0214 + + + +#define SHN_PARISC_ANSI_COMMON 0xff00 + +#define SHN_PARISC_HUGE_COMMON 0xff01 + + + +#define SHT_PARISC_EXT 0x70000000 +#define SHT_PARISC_UNWIND 0x70000001 +#define SHT_PARISC_DOC 0x70000002 + + + +#define SHF_PARISC_SHORT 0x20000000 +#define SHF_PARISC_HUGE 0x40000000 +#define SHF_PARISC_SBP 0x80000000 + + + +#define STT_PARISC_MILLICODE 13 + +#define STT_HP_OPAQUE (STT_LOOS + 0x1) +#define STT_HP_STUB (STT_LOOS + 0x2) + + + +#define R_PARISC_NONE 0 +#define R_PARISC_DIR32 1 +#define R_PARISC_DIR21L 2 +#define R_PARISC_DIR17R 3 +#define R_PARISC_DIR17F 4 +#define R_PARISC_DIR14R 6 +#define R_PARISC_PCREL32 9 +#define R_PARISC_PCREL21L 10 +#define R_PARISC_PCREL17R 11 +#define R_PARISC_PCREL17F 12 +#define R_PARISC_PCREL14R 14 +#define R_PARISC_DPREL21L 18 +#define R_PARISC_DPREL14R 22 +#define R_PARISC_GPREL21L 26 +#define R_PARISC_GPREL14R 30 +#define R_PARISC_LTOFF21L 34 +#define R_PARISC_LTOFF14R 38 +#define R_PARISC_SECREL32 41 +#define R_PARISC_SEGBASE 48 +#define R_PARISC_SEGREL32 49 +#define R_PARISC_PLTOFF21L 50 +#define R_PARISC_PLTOFF14R 54 +#define R_PARISC_LTOFF_FPTR32 57 +#define R_PARISC_LTOFF_FPTR21L 58 +#define R_PARISC_LTOFF_FPTR14R 62 +#define R_PARISC_FPTR64 64 +#define R_PARISC_PLABEL32 65 +#define R_PARISC_PLABEL21L 66 +#define R_PARISC_PLABEL14R 70 +#define R_PARISC_PCREL64 72 +#define R_PARISC_PCREL22F 74 +#define R_PARISC_PCREL14WR 75 +#define R_PARISC_PCREL14DR 76 +#define R_PARISC_PCREL16F 77 +#define R_PARISC_PCREL16WF 78 +#define R_PARISC_PCREL16DF 79 +#define R_PARISC_DIR64 80 +#define R_PARISC_DIR14WR 83 +#define R_PARISC_DIR14DR 84 +#define R_PARISC_DIR16F 85 +#define R_PARISC_DIR16WF 86 +#define R_PARISC_DIR16DF 87 +#define R_PARISC_GPREL64 88 +#define R_PARISC_GPREL14WR 91 +#define R_PARISC_GPREL14DR 92 +#define R_PARISC_GPREL16F 93 +#define R_PARISC_GPREL16WF 94 +#define R_PARISC_GPREL16DF 95 +#define R_PARISC_LTOFF64 96 +#define R_PARISC_LTOFF14WR 99 +#define R_PARISC_LTOFF14DR 100 +#define R_PARISC_LTOFF16F 101 +#define R_PARISC_LTOFF16WF 102 +#define R_PARISC_LTOFF16DF 103 +#define R_PARISC_SECREL64 104 +#define R_PARISC_SEGREL64 112 +#define R_PARISC_PLTOFF14WR 115 +#define R_PARISC_PLTOFF14DR 116 +#define R_PARISC_PLTOFF16F 117 +#define R_PARISC_PLTOFF16WF 118 +#define R_PARISC_PLTOFF16DF 119 +#define R_PARISC_LTOFF_FPTR64 120 +#define R_PARISC_LTOFF_FPTR14WR 123 +#define R_PARISC_LTOFF_FPTR14DR 124 +#define R_PARISC_LTOFF_FPTR16F 125 +#define R_PARISC_LTOFF_FPTR16WF 126 +#define R_PARISC_LTOFF_FPTR16DF 127 +#define R_PARISC_LORESERVE 128 +#define R_PARISC_COPY 128 +#define R_PARISC_IPLT 129 +#define R_PARISC_EPLT 130 +#define R_PARISC_TPREL32 153 +#define R_PARISC_TPREL21L 154 +#define R_PARISC_TPREL14R 158 +#define R_PARISC_LTOFF_TP21L 162 +#define R_PARISC_LTOFF_TP14R 166 +#define R_PARISC_LTOFF_TP14F 167 +#define R_PARISC_TPREL64 216 +#define R_PARISC_TPREL14WR 219 +#define R_PARISC_TPREL14DR 220 +#define R_PARISC_TPREL16F 221 +#define R_PARISC_TPREL16WF 222 +#define R_PARISC_TPREL16DF 223 +#define R_PARISC_LTOFF_TP64 224 +#define R_PARISC_LTOFF_TP14WR 227 +#define R_PARISC_LTOFF_TP14DR 228 +#define R_PARISC_LTOFF_TP16F 229 +#define R_PARISC_LTOFF_TP16WF 230 +#define R_PARISC_LTOFF_TP16DF 231 +#define R_PARISC_GNU_VTENTRY 232 +#define R_PARISC_GNU_VTINHERIT 233 +#define R_PARISC_TLS_GD21L 234 +#define R_PARISC_TLS_GD14R 235 +#define R_PARISC_TLS_GDCALL 236 +#define R_PARISC_TLS_LDM21L 237 +#define R_PARISC_TLS_LDM14R 238 +#define R_PARISC_TLS_LDMCALL 239 +#define R_PARISC_TLS_LDO21L 240 +#define R_PARISC_TLS_LDO14R 241 +#define R_PARISC_TLS_DTPMOD32 242 +#define R_PARISC_TLS_DTPMOD64 243 +#define R_PARISC_TLS_DTPOFF32 244 +#define R_PARISC_TLS_DTPOFF64 245 +#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L +#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R +#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L +#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R +#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32 +#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64 +#define R_PARISC_HIRESERVE 255 + + + +#define PT_HP_TLS (PT_LOOS + 0x0) +#define PT_HP_CORE_NONE (PT_LOOS + 0x1) +#define PT_HP_CORE_VERSION (PT_LOOS + 0x2) +#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3) +#define PT_HP_CORE_COMM (PT_LOOS + 0x4) +#define PT_HP_CORE_PROC (PT_LOOS + 0x5) +#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6) +#define PT_HP_CORE_STACK (PT_LOOS + 0x7) +#define PT_HP_CORE_SHM (PT_LOOS + 0x8) +#define PT_HP_CORE_MMF (PT_LOOS + 0x9) +#define PT_HP_PARALLEL (PT_LOOS + 0x10) +#define PT_HP_FASTBIND (PT_LOOS + 0x11) +#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12) +#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13) +#define PT_HP_STACK (PT_LOOS + 0x14) + +#define PT_PARISC_ARCHEXT 0x70000000 +#define PT_PARISC_UNWIND 0x70000001 + + + +#define PF_PARISC_SBP 0x08000000 + +#define PF_HP_PAGE_SIZE 0x00100000 +#define PF_HP_FAR_SHARED 0x00200000 +#define PF_HP_NEAR_SHARED 0x00400000 +#define PF_HP_CODE 0x01000000 +#define PF_HP_MODIFY 0x02000000 +#define PF_HP_LAZYSWAP 0x04000000 +#define PF_HP_SBP 0x08000000 + + + + + + +#define EF_ALPHA_32BIT 1 +#define EF_ALPHA_CANRELAX 2 + + + + +#define SHT_ALPHA_DEBUG 0x70000001 +#define SHT_ALPHA_REGINFO 0x70000002 + + + +#define SHF_ALPHA_GPREL 0x10000000 + + +#define STO_ALPHA_NOPV 0x80 +#define STO_ALPHA_STD_GPLOAD 0x88 + + + +#define R_ALPHA_NONE 0 +#define R_ALPHA_REFLONG 1 +#define R_ALPHA_REFQUAD 2 +#define R_ALPHA_GPREL32 3 +#define R_ALPHA_LITERAL 4 +#define R_ALPHA_LITUSE 5 +#define R_ALPHA_GPDISP 6 +#define R_ALPHA_BRADDR 7 +#define R_ALPHA_HINT 8 +#define R_ALPHA_SREL16 9 +#define R_ALPHA_SREL32 10 +#define R_ALPHA_SREL64 11 +#define R_ALPHA_GPRELHIGH 17 +#define R_ALPHA_GPRELLOW 18 +#define R_ALPHA_GPREL16 19 +#define R_ALPHA_COPY 24 +#define R_ALPHA_GLOB_DAT 25 +#define R_ALPHA_JMP_SLOT 26 +#define R_ALPHA_RELATIVE 27 +#define R_ALPHA_TLS_GD_HI 28 +#define R_ALPHA_TLSGD 29 +#define R_ALPHA_TLS_LDM 30 +#define R_ALPHA_DTPMOD64 31 +#define R_ALPHA_GOTDTPREL 32 +#define R_ALPHA_DTPREL64 33 +#define R_ALPHA_DTPRELHI 34 +#define R_ALPHA_DTPRELLO 35 +#define R_ALPHA_DTPREL16 36 +#define R_ALPHA_GOTTPREL 37 +#define R_ALPHA_TPREL64 38 +#define R_ALPHA_TPRELHI 39 +#define R_ALPHA_TPRELLO 40 +#define R_ALPHA_TPREL16 41 + +#define R_ALPHA_NUM 46 + + +#define LITUSE_ALPHA_ADDR 0 +#define LITUSE_ALPHA_BASE 1 +#define LITUSE_ALPHA_BYTOFF 2 +#define LITUSE_ALPHA_JSR 3 +#define LITUSE_ALPHA_TLS_GD 4 +#define LITUSE_ALPHA_TLS_LDM 5 + + +#define DT_ALPHA_PLTRO (DT_LOPROC + 0) +#define DT_ALPHA_NUM 1 + + + + +#define EF_PPC_EMB 0x80000000 + + +#define EF_PPC_RELOCATABLE 0x00010000 +#define EF_PPC_RELOCATABLE_LIB 0x00008000 + + + +#define R_PPC_NONE 0 +#define R_PPC_ADDR32 1 +#define R_PPC_ADDR24 2 +#define R_PPC_ADDR16 3 +#define R_PPC_ADDR16_LO 4 +#define R_PPC_ADDR16_HI 5 +#define R_PPC_ADDR16_HA 6 +#define R_PPC_ADDR14 7 +#define R_PPC_ADDR14_BRTAKEN 8 +#define R_PPC_ADDR14_BRNTAKEN 9 +#define R_PPC_REL24 10 +#define R_PPC_REL14 11 +#define R_PPC_REL14_BRTAKEN 12 +#define R_PPC_REL14_BRNTAKEN 13 +#define R_PPC_GOT16 14 +#define R_PPC_GOT16_LO 15 +#define R_PPC_GOT16_HI 16 +#define R_PPC_GOT16_HA 17 +#define R_PPC_PLTREL24 18 +#define R_PPC_COPY 19 +#define R_PPC_GLOB_DAT 20 +#define R_PPC_JMP_SLOT 21 +#define R_PPC_RELATIVE 22 +#define R_PPC_LOCAL24PC 23 +#define R_PPC_UADDR32 24 +#define R_PPC_UADDR16 25 +#define R_PPC_REL32 26 +#define R_PPC_PLT32 27 +#define R_PPC_PLTREL32 28 +#define R_PPC_PLT16_LO 29 +#define R_PPC_PLT16_HI 30 +#define R_PPC_PLT16_HA 31 +#define R_PPC_SDAREL16 32 +#define R_PPC_SECTOFF 33 +#define R_PPC_SECTOFF_LO 34 +#define R_PPC_SECTOFF_HI 35 +#define R_PPC_SECTOFF_HA 36 + + +#define R_PPC_TLS 67 +#define R_PPC_DTPMOD32 68 +#define R_PPC_TPREL16 69 +#define R_PPC_TPREL16_LO 70 +#define R_PPC_TPREL16_HI 71 +#define R_PPC_TPREL16_HA 72 +#define R_PPC_TPREL32 73 +#define R_PPC_DTPREL16 74 +#define R_PPC_DTPREL16_LO 75 +#define R_PPC_DTPREL16_HI 76 +#define R_PPC_DTPREL16_HA 77 +#define R_PPC_DTPREL32 78 +#define R_PPC_GOT_TLSGD16 79 +#define R_PPC_GOT_TLSGD16_LO 80 +#define R_PPC_GOT_TLSGD16_HI 81 +#define R_PPC_GOT_TLSGD16_HA 82 +#define R_PPC_GOT_TLSLD16 83 +#define R_PPC_GOT_TLSLD16_LO 84 +#define R_PPC_GOT_TLSLD16_HI 85 +#define R_PPC_GOT_TLSLD16_HA 86 +#define R_PPC_GOT_TPREL16 87 +#define R_PPC_GOT_TPREL16_LO 88 +#define R_PPC_GOT_TPREL16_HI 89 +#define R_PPC_GOT_TPREL16_HA 90 +#define R_PPC_GOT_DTPREL16 91 +#define R_PPC_GOT_DTPREL16_LO 92 +#define R_PPC_GOT_DTPREL16_HI 93 +#define R_PPC_GOT_DTPREL16_HA 94 +#define R_PPC_TLSGD 95 +#define R_PPC_TLSLD 96 + + +#define R_PPC_EMB_NADDR32 101 +#define R_PPC_EMB_NADDR16 102 +#define R_PPC_EMB_NADDR16_LO 103 +#define R_PPC_EMB_NADDR16_HI 104 +#define R_PPC_EMB_NADDR16_HA 105 +#define R_PPC_EMB_SDAI16 106 +#define R_PPC_EMB_SDA2I16 107 +#define R_PPC_EMB_SDA2REL 108 +#define R_PPC_EMB_SDA21 109 +#define R_PPC_EMB_MRKREF 110 +#define R_PPC_EMB_RELSEC16 111 +#define R_PPC_EMB_RELST_LO 112 +#define R_PPC_EMB_RELST_HI 113 +#define R_PPC_EMB_RELST_HA 114 +#define R_PPC_EMB_BIT_FLD 115 +#define R_PPC_EMB_RELSDA 116 + + +#define R_PPC_DIAB_SDA21_LO 180 +#define R_PPC_DIAB_SDA21_HI 181 +#define R_PPC_DIAB_SDA21_HA 182 +#define R_PPC_DIAB_RELSDA_LO 183 +#define R_PPC_DIAB_RELSDA_HI 184 +#define R_PPC_DIAB_RELSDA_HA 185 + + +#define R_PPC_IRELATIVE 248 + + +#define R_PPC_REL16 249 +#define R_PPC_REL16_LO 250 +#define R_PPC_REL16_HI 251 +#define R_PPC_REL16_HA 252 + + + +#define R_PPC_TOC16 255 + + +#define DT_PPC_GOT (DT_LOPROC + 0) +#define DT_PPC_OPT (DT_LOPROC + 1) +#define DT_PPC_NUM 2 + +#define PPC_OPT_TLS 1 + + +#define R_PPC64_NONE R_PPC_NONE +#define R_PPC64_ADDR32 R_PPC_ADDR32 +#define R_PPC64_ADDR24 R_PPC_ADDR24 +#define R_PPC64_ADDR16 R_PPC_ADDR16 +#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO +#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI +#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA +#define R_PPC64_ADDR14 R_PPC_ADDR14 +#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN +#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN +#define R_PPC64_REL24 R_PPC_REL24 +#define R_PPC64_REL14 R_PPC_REL14 +#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN +#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN +#define R_PPC64_GOT16 R_PPC_GOT16 +#define R_PPC64_GOT16_LO R_PPC_GOT16_LO +#define R_PPC64_GOT16_HI R_PPC_GOT16_HI +#define R_PPC64_GOT16_HA R_PPC_GOT16_HA + +#define R_PPC64_COPY R_PPC_COPY +#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT +#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT +#define R_PPC64_RELATIVE R_PPC_RELATIVE + +#define R_PPC64_UADDR32 R_PPC_UADDR32 +#define R_PPC64_UADDR16 R_PPC_UADDR16 +#define R_PPC64_REL32 R_PPC_REL32 +#define R_PPC64_PLT32 R_PPC_PLT32 +#define R_PPC64_PLTREL32 R_PPC_PLTREL32 +#define R_PPC64_PLT16_LO R_PPC_PLT16_LO +#define R_PPC64_PLT16_HI R_PPC_PLT16_HI +#define R_PPC64_PLT16_HA R_PPC_PLT16_HA + +#define R_PPC64_SECTOFF R_PPC_SECTOFF +#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO +#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI +#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA +#define R_PPC64_ADDR30 37 +#define R_PPC64_ADDR64 38 +#define R_PPC64_ADDR16_HIGHER 39 +#define R_PPC64_ADDR16_HIGHERA 40 +#define R_PPC64_ADDR16_HIGHEST 41 +#define R_PPC64_ADDR16_HIGHESTA 42 +#define R_PPC64_UADDR64 43 +#define R_PPC64_REL64 44 +#define R_PPC64_PLT64 45 +#define R_PPC64_PLTREL64 46 +#define R_PPC64_TOC16 47 +#define R_PPC64_TOC16_LO 48 +#define R_PPC64_TOC16_HI 49 +#define R_PPC64_TOC16_HA 50 +#define R_PPC64_TOC 51 +#define R_PPC64_PLTGOT16 52 +#define R_PPC64_PLTGOT16_LO 53 +#define R_PPC64_PLTGOT16_HI 54 +#define R_PPC64_PLTGOT16_HA 55 + +#define R_PPC64_ADDR16_DS 56 +#define R_PPC64_ADDR16_LO_DS 57 +#define R_PPC64_GOT16_DS 58 +#define R_PPC64_GOT16_LO_DS 59 +#define R_PPC64_PLT16_LO_DS 60 +#define R_PPC64_SECTOFF_DS 61 +#define R_PPC64_SECTOFF_LO_DS 62 +#define R_PPC64_TOC16_DS 63 +#define R_PPC64_TOC16_LO_DS 64 +#define R_PPC64_PLTGOT16_DS 65 +#define R_PPC64_PLTGOT16_LO_DS 66 + + +#define R_PPC64_TLS 67 +#define R_PPC64_DTPMOD64 68 +#define R_PPC64_TPREL16 69 +#define R_PPC64_TPREL16_LO 70 +#define R_PPC64_TPREL16_HI 71 +#define R_PPC64_TPREL16_HA 72 +#define R_PPC64_TPREL64 73 +#define R_PPC64_DTPREL16 74 +#define R_PPC64_DTPREL16_LO 75 +#define R_PPC64_DTPREL16_HI 76 +#define R_PPC64_DTPREL16_HA 77 +#define R_PPC64_DTPREL64 78 +#define R_PPC64_GOT_TLSGD16 79 +#define R_PPC64_GOT_TLSGD16_LO 80 +#define R_PPC64_GOT_TLSGD16_HI 81 +#define R_PPC64_GOT_TLSGD16_HA 82 +#define R_PPC64_GOT_TLSLD16 83 +#define R_PPC64_GOT_TLSLD16_LO 84 +#define R_PPC64_GOT_TLSLD16_HI 85 +#define R_PPC64_GOT_TLSLD16_HA 86 +#define R_PPC64_GOT_TPREL16_DS 87 +#define R_PPC64_GOT_TPREL16_LO_DS 88 +#define R_PPC64_GOT_TPREL16_HI 89 +#define R_PPC64_GOT_TPREL16_HA 90 +#define R_PPC64_GOT_DTPREL16_DS 91 +#define R_PPC64_GOT_DTPREL16_LO_DS 92 +#define R_PPC64_GOT_DTPREL16_HI 93 +#define R_PPC64_GOT_DTPREL16_HA 94 +#define R_PPC64_TPREL16_DS 95 +#define R_PPC64_TPREL16_LO_DS 96 +#define R_PPC64_TPREL16_HIGHER 97 +#define R_PPC64_TPREL16_HIGHERA 98 +#define R_PPC64_TPREL16_HIGHEST 99 +#define R_PPC64_TPREL16_HIGHESTA 100 +#define R_PPC64_DTPREL16_DS 101 +#define R_PPC64_DTPREL16_LO_DS 102 +#define R_PPC64_DTPREL16_HIGHER 103 +#define R_PPC64_DTPREL16_HIGHERA 104 +#define R_PPC64_DTPREL16_HIGHEST 105 +#define R_PPC64_DTPREL16_HIGHESTA 106 +#define R_PPC64_TLSGD 107 +#define R_PPC64_TLSLD 108 +#define R_PPC64_TOCSAVE 109 +#define R_PPC64_ADDR16_HIGH 110 +#define R_PPC64_ADDR16_HIGHA 111 +#define R_PPC64_TPREL16_HIGH 112 +#define R_PPC64_TPREL16_HIGHA 113 +#define R_PPC64_DTPREL16_HIGH 114 +#define R_PPC64_DTPREL16_HIGHA 115 + + +#define R_PPC64_JMP_IREL 247 +#define R_PPC64_IRELATIVE 248 +#define R_PPC64_REL16 249 +#define R_PPC64_REL16_LO 250 +#define R_PPC64_REL16_HI 251 +#define R_PPC64_REL16_HA 252 + +#define EF_PPC64_ABI 3 + +#define DT_PPC64_GLINK (DT_LOPROC + 0) +#define DT_PPC64_OPD (DT_LOPROC + 1) +#define DT_PPC64_OPDSZ (DT_LOPROC + 2) +#define DT_PPC64_OPT (DT_LOPROC + 3) +#define DT_PPC64_NUM 4 + +#define PPC64_OPT_TLS 1 +#define PPC64_OPT_MULTI_TOC 2 + +#define STO_PPC64_LOCAL_BIT 5 +#define STO_PPC64_LOCAL_MASK 0xe0 +#define PPC64_LOCAL_ENTRY_OFFSET(x) (1 << (((x)&0xe0)>>5) & 0xfc) + + +#define EF_ARM_RELEXEC 0x01 +#define EF_ARM_HASENTRY 0x02 +#define EF_ARM_INTERWORK 0x04 +#define EF_ARM_APCS_26 0x08 +#define EF_ARM_APCS_FLOAT 0x10 +#define EF_ARM_PIC 0x20 +#define EF_ARM_ALIGN8 0x40 +#define EF_ARM_NEW_ABI 0x80 +#define EF_ARM_OLD_ABI 0x100 +#define EF_ARM_SOFT_FLOAT 0x200 +#define EF_ARM_VFP_FLOAT 0x400 +#define EF_ARM_MAVERICK_FLOAT 0x800 + +#define EF_ARM_ABI_FLOAT_SOFT 0x200 +#define EF_ARM_ABI_FLOAT_HARD 0x400 + + +#define EF_ARM_SYMSARESORTED 0x04 +#define EF_ARM_DYNSYMSUSESEGIDX 0x08 +#define EF_ARM_MAPSYMSFIRST 0x10 +#define EF_ARM_EABIMASK 0XFF000000 + + +#define EF_ARM_BE8 0x00800000 +#define EF_ARM_LE8 0x00400000 + +#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK) +#define EF_ARM_EABI_UNKNOWN 0x00000000 +#define EF_ARM_EABI_VER1 0x01000000 +#define EF_ARM_EABI_VER2 0x02000000 +#define EF_ARM_EABI_VER3 0x03000000 +#define EF_ARM_EABI_VER4 0x04000000 +#define EF_ARM_EABI_VER5 0x05000000 + + +#define STT_ARM_TFUNC STT_LOPROC +#define STT_ARM_16BIT STT_HIPROC + + +#define SHF_ARM_ENTRYSECT 0x10000000 +#define SHF_ARM_COMDEF 0x80000000 + + + +#define PF_ARM_SB 0x10000000 + +#define PF_ARM_PI 0x20000000 +#define PF_ARM_ABS 0x40000000 + + +#define PT_ARM_EXIDX (PT_LOPROC + 1) + + +#define SHT_ARM_EXIDX (SHT_LOPROC + 1) +#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) +#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) + +#define R_AARCH64_NONE 0 +#define R_AARCH64_P32_ABS32 1 +#define R_AARCH64_P32_COPY 180 +#define R_AARCH64_P32_GLOB_DAT 181 +#define R_AARCH64_P32_JUMP_SLOT 182 +#define R_AARCH64_P32_RELATIVE 183 +#define R_AARCH64_P32_TLS_DTPMOD 184 +#define R_AARCH64_P32_TLS_DTPREL 185 +#define R_AARCH64_P32_TLS_TPREL 186 +#define R_AARCH64_P32_TLSDESC 187 +#define R_AARCH64_P32_IRELATIVE 188 +#define R_AARCH64_ABS64 257 +#define R_AARCH64_ABS32 258 +#define R_AARCH64_ABS16 259 +#define R_AARCH64_PREL64 260 +#define R_AARCH64_PREL32 261 +#define R_AARCH64_PREL16 262 +#define R_AARCH64_MOVW_UABS_G0 263 +#define R_AARCH64_MOVW_UABS_G0_NC 264 +#define R_AARCH64_MOVW_UABS_G1 265 +#define R_AARCH64_MOVW_UABS_G1_NC 266 +#define R_AARCH64_MOVW_UABS_G2 267 +#define R_AARCH64_MOVW_UABS_G2_NC 268 +#define R_AARCH64_MOVW_UABS_G3 269 +#define R_AARCH64_MOVW_SABS_G0 270 +#define R_AARCH64_MOVW_SABS_G1 271 +#define R_AARCH64_MOVW_SABS_G2 272 +#define R_AARCH64_LD_PREL_LO19 273 +#define R_AARCH64_ADR_PREL_LO21 274 +#define R_AARCH64_ADR_PREL_PG_HI21 275 +#define R_AARCH64_ADR_PREL_PG_HI21_NC 276 +#define R_AARCH64_ADD_ABS_LO12_NC 277 +#define R_AARCH64_LDST8_ABS_LO12_NC 278 +#define R_AARCH64_TSTBR14 279 +#define R_AARCH64_CONDBR19 280 +#define R_AARCH64_JUMP26 282 +#define R_AARCH64_CALL26 283 +#define R_AARCH64_LDST16_ABS_LO12_NC 284 +#define R_AARCH64_LDST32_ABS_LO12_NC 285 +#define R_AARCH64_LDST64_ABS_LO12_NC 286 +#define R_AARCH64_MOVW_PREL_G0 287 +#define R_AARCH64_MOVW_PREL_G0_NC 288 +#define R_AARCH64_MOVW_PREL_G1 289 +#define R_AARCH64_MOVW_PREL_G1_NC 290 +#define R_AARCH64_MOVW_PREL_G2 291 +#define R_AARCH64_MOVW_PREL_G2_NC 292 +#define R_AARCH64_MOVW_PREL_G3 293 +#define R_AARCH64_LDST128_ABS_LO12_NC 299 +#define R_AARCH64_MOVW_GOTOFF_G0 300 +#define R_AARCH64_MOVW_GOTOFF_G0_NC 301 +#define R_AARCH64_MOVW_GOTOFF_G1 302 +#define R_AARCH64_MOVW_GOTOFF_G1_NC 303 +#define R_AARCH64_MOVW_GOTOFF_G2 304 +#define R_AARCH64_MOVW_GOTOFF_G2_NC 305 +#define R_AARCH64_MOVW_GOTOFF_G3 306 +#define R_AARCH64_GOTREL64 307 +#define R_AARCH64_GOTREL32 308 +#define R_AARCH64_GOT_LD_PREL19 309 +#define R_AARCH64_LD64_GOTOFF_LO15 310 +#define R_AARCH64_ADR_GOT_PAGE 311 +#define R_AARCH64_LD64_GOT_LO12_NC 312 +#define R_AARCH64_LD64_GOTPAGE_LO15 313 +#define R_AARCH64_TLSGD_ADR_PREL21 512 +#define R_AARCH64_TLSGD_ADR_PAGE21 513 +#define R_AARCH64_TLSGD_ADD_LO12_NC 514 +#define R_AARCH64_TLSGD_MOVW_G1 515 +#define R_AARCH64_TLSGD_MOVW_G0_NC 516 +#define R_AARCH64_TLSLD_ADR_PREL21 517 +#define R_AARCH64_TLSLD_ADR_PAGE21 518 +#define R_AARCH64_TLSLD_ADD_LO12_NC 519 +#define R_AARCH64_TLSLD_MOVW_G1 520 +#define R_AARCH64_TLSLD_MOVW_G0_NC 521 +#define R_AARCH64_TLSLD_LD_PREL19 522 +#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523 +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524 +#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525 +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526 +#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527 +#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528 +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529 +#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530 +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531 +#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532 +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533 +#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534 +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535 +#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536 +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537 +#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538 +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539 +#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540 +#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541 +#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542 +#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543 +#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544 +#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545 +#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546 +#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547 +#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548 +#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549 +#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550 +#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551 +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552 +#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553 +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554 +#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555 +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556 +#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557 +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558 +#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559 +#define R_AARCH64_TLSDESC_LD_PREL19 560 +#define R_AARCH64_TLSDESC_ADR_PREL21 561 +#define R_AARCH64_TLSDESC_ADR_PAGE21 562 +#define R_AARCH64_TLSDESC_LD64_LO12 563 +#define R_AARCH64_TLSDESC_ADD_LO12 564 +#define R_AARCH64_TLSDESC_OFF_G1 565 +#define R_AARCH64_TLSDESC_OFF_G0_NC 566 +#define R_AARCH64_TLSDESC_LDR 567 +#define R_AARCH64_TLSDESC_ADD 568 +#define R_AARCH64_TLSDESC_CALL 569 +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570 +#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571 +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572 +#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573 +#define R_AARCH64_COPY 1024 +#define R_AARCH64_GLOB_DAT 1025 +#define R_AARCH64_JUMP_SLOT 1026 +#define R_AARCH64_RELATIVE 1027 +#define R_AARCH64_TLS_DTPMOD 1028 +#define R_AARCH64_TLS_DTPMOD64 1028 +#define R_AARCH64_TLS_DTPREL 1029 +#define R_AARCH64_TLS_DTPREL64 1029 +#define R_AARCH64_TLS_TPREL 1030 +#define R_AARCH64_TLS_TPREL64 1030 +#define R_AARCH64_TLSDESC 1031 + + +#define R_ARM_NONE 0 +#define R_ARM_PC24 1 +#define R_ARM_ABS32 2 +#define R_ARM_REL32 3 +#define R_ARM_PC13 4 +#define R_ARM_ABS16 5 +#define R_ARM_ABS12 6 +#define R_ARM_THM_ABS5 7 +#define R_ARM_ABS8 8 +#define R_ARM_SBREL32 9 +#define R_ARM_THM_PC22 10 +#define R_ARM_THM_PC8 11 +#define R_ARM_AMP_VCALL9 12 +#define R_ARM_TLS_DESC 13 +#define R_ARM_THM_SWI8 14 +#define R_ARM_XPC25 15 +#define R_ARM_THM_XPC22 16 +#define R_ARM_TLS_DTPMOD32 17 +#define R_ARM_TLS_DTPOFF32 18 +#define R_ARM_TLS_TPOFF32 19 +#define R_ARM_COPY 20 +#define R_ARM_GLOB_DAT 21 +#define R_ARM_JUMP_SLOT 22 +#define R_ARM_RELATIVE 23 +#define R_ARM_GOTOFF 24 +#define R_ARM_GOTPC 25 +#define R_ARM_GOT32 26 +#define R_ARM_PLT32 27 +#define R_ARM_CALL 28 +#define R_ARM_JUMP24 29 +#define R_ARM_THM_JUMP24 30 +#define R_ARM_BASE_ABS 31 +#define R_ARM_ALU_PCREL_7_0 32 +#define R_ARM_ALU_PCREL_15_8 33 +#define R_ARM_ALU_PCREL_23_15 34 +#define R_ARM_LDR_SBREL_11_0 35 +#define R_ARM_ALU_SBREL_19_12 36 +#define R_ARM_ALU_SBREL_27_20 37 +#define R_ARM_TARGET1 38 +#define R_ARM_SBREL31 39 +#define R_ARM_V4BX 40 +#define R_ARM_TARGET2 41 +#define R_ARM_PREL31 42 +#define R_ARM_MOVW_ABS_NC 43 +#define R_ARM_MOVT_ABS 44 +#define R_ARM_MOVW_PREL_NC 45 +#define R_ARM_MOVT_PREL 46 +#define R_ARM_THM_MOVW_ABS_NC 47 +#define R_ARM_THM_MOVT_ABS 48 +#define R_ARM_THM_MOVW_PREL_NC 49 +#define R_ARM_THM_MOVT_PREL 50 +#define R_ARM_THM_JUMP19 51 +#define R_ARM_THM_JUMP6 52 +#define R_ARM_THM_ALU_PREL_11_0 53 +#define R_ARM_THM_PC12 54 +#define R_ARM_ABS32_NOI 55 +#define R_ARM_REL32_NOI 56 +#define R_ARM_ALU_PC_G0_NC 57 +#define R_ARM_ALU_PC_G0 58 +#define R_ARM_ALU_PC_G1_NC 59 +#define R_ARM_ALU_PC_G1 60 +#define R_ARM_ALU_PC_G2 61 +#define R_ARM_LDR_PC_G1 62 +#define R_ARM_LDR_PC_G2 63 +#define R_ARM_LDRS_PC_G0 64 +#define R_ARM_LDRS_PC_G1 65 +#define R_ARM_LDRS_PC_G2 66 +#define R_ARM_LDC_PC_G0 67 +#define R_ARM_LDC_PC_G1 68 +#define R_ARM_LDC_PC_G2 69 +#define R_ARM_ALU_SB_G0_NC 70 +#define R_ARM_ALU_SB_G0 71 +#define R_ARM_ALU_SB_G1_NC 72 +#define R_ARM_ALU_SB_G1 73 +#define R_ARM_ALU_SB_G2 74 +#define R_ARM_LDR_SB_G0 75 +#define R_ARM_LDR_SB_G1 76 +#define R_ARM_LDR_SB_G2 77 +#define R_ARM_LDRS_SB_G0 78 +#define R_ARM_LDRS_SB_G1 79 +#define R_ARM_LDRS_SB_G2 80 +#define R_ARM_LDC_SB_G0 81 +#define R_ARM_LDC_SB_G1 82 +#define R_ARM_LDC_SB_G2 83 +#define R_ARM_MOVW_BREL_NC 84 +#define R_ARM_MOVT_BREL 85 +#define R_ARM_MOVW_BREL 86 +#define R_ARM_THM_MOVW_BREL_NC 87 +#define R_ARM_THM_MOVT_BREL 88 +#define R_ARM_THM_MOVW_BREL 89 +#define R_ARM_TLS_GOTDESC 90 +#define R_ARM_TLS_CALL 91 +#define R_ARM_TLS_DESCSEQ 92 +#define R_ARM_THM_TLS_CALL 93 +#define R_ARM_PLT32_ABS 94 +#define R_ARM_GOT_ABS 95 +#define R_ARM_GOT_PREL 96 +#define R_ARM_GOT_BREL12 97 +#define R_ARM_GOTOFF12 98 +#define R_ARM_GOTRELAX 99 +#define R_ARM_GNU_VTENTRY 100 +#define R_ARM_GNU_VTINHERIT 101 +#define R_ARM_THM_PC11 102 +#define R_ARM_THM_PC9 103 +#define R_ARM_TLS_GD32 104 + +#define R_ARM_TLS_LDM32 105 + +#define R_ARM_TLS_LDO32 106 + +#define R_ARM_TLS_IE32 107 + +#define R_ARM_TLS_LE32 108 +#define R_ARM_TLS_LDO12 109 +#define R_ARM_TLS_LE12 110 +#define R_ARM_TLS_IE12GP 111 +#define R_ARM_ME_TOO 128 +#define R_ARM_THM_TLS_DESCSEQ 129 +#define R_ARM_THM_TLS_DESCSEQ16 129 +#define R_ARM_THM_TLS_DESCSEQ32 130 +#define R_ARM_THM_GOT_BREL12 131 +#define R_ARM_IRELATIVE 160 +#define R_ARM_RXPC25 249 +#define R_ARM_RSBREL32 250 +#define R_ARM_THM_RPC22 251 +#define R_ARM_RREL32 252 +#define R_ARM_RABS22 253 +#define R_ARM_RPC24 254 +#define R_ARM_RBASE 255 + +#define R_ARM_NUM 256 + + + + +#define EF_IA_64_MASKOS 0x0000000f +#define EF_IA_64_ABI64 0x00000010 +#define EF_IA_64_ARCH 0xff000000 + + +#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) +#define PT_IA_64_UNWIND (PT_LOPROC + 1) +#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12) +#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13) +#define PT_IA_64_HP_STACK (PT_LOOS + 0x14) + + +#define PF_IA_64_NORECOV 0x80000000 + + +#define SHT_IA_64_EXT (SHT_LOPROC + 0) +#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) + + +#define SHF_IA_64_SHORT 0x10000000 +#define SHF_IA_64_NORECOV 0x20000000 + + +#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0) +#define DT_IA_64_NUM 1 + + +#define R_IA64_NONE 0x00 +#define R_IA64_IMM14 0x21 +#define R_IA64_IMM22 0x22 +#define R_IA64_IMM64 0x23 +#define R_IA64_DIR32MSB 0x24 +#define R_IA64_DIR32LSB 0x25 +#define R_IA64_DIR64MSB 0x26 +#define R_IA64_DIR64LSB 0x27 +#define R_IA64_GPREL22 0x2a +#define R_IA64_GPREL64I 0x2b +#define R_IA64_GPREL32MSB 0x2c +#define R_IA64_GPREL32LSB 0x2d +#define R_IA64_GPREL64MSB 0x2e +#define R_IA64_GPREL64LSB 0x2f +#define R_IA64_LTOFF22 0x32 +#define R_IA64_LTOFF64I 0x33 +#define R_IA64_PLTOFF22 0x3a +#define R_IA64_PLTOFF64I 0x3b +#define R_IA64_PLTOFF64MSB 0x3e +#define R_IA64_PLTOFF64LSB 0x3f +#define R_IA64_FPTR64I 0x43 +#define R_IA64_FPTR32MSB 0x44 +#define R_IA64_FPTR32LSB 0x45 +#define R_IA64_FPTR64MSB 0x46 +#define R_IA64_FPTR64LSB 0x47 +#define R_IA64_PCREL60B 0x48 +#define R_IA64_PCREL21B 0x49 +#define R_IA64_PCREL21M 0x4a +#define R_IA64_PCREL21F 0x4b +#define R_IA64_PCREL32MSB 0x4c +#define R_IA64_PCREL32LSB 0x4d +#define R_IA64_PCREL64MSB 0x4e +#define R_IA64_PCREL64LSB 0x4f +#define R_IA64_LTOFF_FPTR22 0x52 +#define R_IA64_LTOFF_FPTR64I 0x53 +#define R_IA64_LTOFF_FPTR32MSB 0x54 +#define R_IA64_LTOFF_FPTR32LSB 0x55 +#define R_IA64_LTOFF_FPTR64MSB 0x56 +#define R_IA64_LTOFF_FPTR64LSB 0x57 +#define R_IA64_SEGREL32MSB 0x5c +#define R_IA64_SEGREL32LSB 0x5d +#define R_IA64_SEGREL64MSB 0x5e +#define R_IA64_SEGREL64LSB 0x5f +#define R_IA64_SECREL32MSB 0x64 +#define R_IA64_SECREL32LSB 0x65 +#define R_IA64_SECREL64MSB 0x66 +#define R_IA64_SECREL64LSB 0x67 +#define R_IA64_REL32MSB 0x6c +#define R_IA64_REL32LSB 0x6d +#define R_IA64_REL64MSB 0x6e +#define R_IA64_REL64LSB 0x6f +#define R_IA64_LTV32MSB 0x74 +#define R_IA64_LTV32LSB 0x75 +#define R_IA64_LTV64MSB 0x76 +#define R_IA64_LTV64LSB 0x77 +#define R_IA64_PCREL21BI 0x79 +#define R_IA64_PCREL22 0x7a +#define R_IA64_PCREL64I 0x7b +#define R_IA64_IPLTMSB 0x80 +#define R_IA64_IPLTLSB 0x81 +#define R_IA64_COPY 0x84 +#define R_IA64_SUB 0x85 +#define R_IA64_LTOFF22X 0x86 +#define R_IA64_LDXMOV 0x87 +#define R_IA64_TPREL14 0x91 +#define R_IA64_TPREL22 0x92 +#define R_IA64_TPREL64I 0x93 +#define R_IA64_TPREL64MSB 0x96 +#define R_IA64_TPREL64LSB 0x97 +#define R_IA64_LTOFF_TPREL22 0x9a +#define R_IA64_DTPMOD64MSB 0xa6 +#define R_IA64_DTPMOD64LSB 0xa7 +#define R_IA64_LTOFF_DTPMOD22 0xaa +#define R_IA64_DTPREL14 0xb1 +#define R_IA64_DTPREL22 0xb2 +#define R_IA64_DTPREL64I 0xb3 +#define R_IA64_DTPREL32MSB 0xb4 +#define R_IA64_DTPREL32LSB 0xb5 +#define R_IA64_DTPREL64MSB 0xb6 +#define R_IA64_DTPREL64LSB 0xb7 +#define R_IA64_LTOFF_DTPREL22 0xba + + +#define EF_SH_MACH_MASK 0x1f +#define EF_SH_UNKNOWN 0x0 +#define EF_SH1 0x1 +#define EF_SH2 0x2 +#define EF_SH3 0x3 +#define EF_SH_DSP 0x4 +#define EF_SH3_DSP 0x5 +#define EF_SH4AL_DSP 0x6 +#define EF_SH3E 0x8 +#define EF_SH4 0x9 +#define EF_SH2E 0xb +#define EF_SH4A 0xc +#define EF_SH2A 0xd +#define EF_SH4_NOFPU 0x10 +#define EF_SH4A_NOFPU 0x11 +#define EF_SH4_NOMMU_NOFPU 0x12 +#define EF_SH2A_NOFPU 0x13 +#define EF_SH3_NOMMU 0x14 +#define EF_SH2A_SH4_NOFPU 0x15 +#define EF_SH2A_SH3_NOFPU 0x16 +#define EF_SH2A_SH4 0x17 +#define EF_SH2A_SH3E 0x18 + +#define R_SH_NONE 0 +#define R_SH_DIR32 1 +#define R_SH_REL32 2 +#define R_SH_DIR8WPN 3 +#define R_SH_IND12W 4 +#define R_SH_DIR8WPL 5 +#define R_SH_DIR8WPZ 6 +#define R_SH_DIR8BP 7 +#define R_SH_DIR8W 8 +#define R_SH_DIR8L 9 +#define R_SH_SWITCH16 25 +#define R_SH_SWITCH32 26 +#define R_SH_USES 27 +#define R_SH_COUNT 28 +#define R_SH_ALIGN 29 +#define R_SH_CODE 30 +#define R_SH_DATA 31 +#define R_SH_LABEL 32 +#define R_SH_SWITCH8 33 +#define R_SH_GNU_VTINHERIT 34 +#define R_SH_GNU_VTENTRY 35 +#define R_SH_TLS_GD_32 144 +#define R_SH_TLS_LD_32 145 +#define R_SH_TLS_LDO_32 146 +#define R_SH_TLS_IE_32 147 +#define R_SH_TLS_LE_32 148 +#define R_SH_TLS_DTPMOD32 149 +#define R_SH_TLS_DTPOFF32 150 +#define R_SH_TLS_TPOFF32 151 +#define R_SH_GOT32 160 +#define R_SH_PLT32 161 +#define R_SH_COPY 162 +#define R_SH_GLOB_DAT 163 +#define R_SH_JMP_SLOT 164 +#define R_SH_RELATIVE 165 +#define R_SH_GOTOFF 166 +#define R_SH_GOTPC 167 +#define R_SH_GOT20 201 +#define R_SH_GOTOFF20 202 +#define R_SH_GOTFUNCDESC 203 +#define R_SH_GOTFUNCDEST20 204 +#define R_SH_GOTOFFFUNCDESC 205 +#define R_SH_GOTOFFFUNCDEST20 206 +#define R_SH_FUNCDESC 207 +#define R_SH_FUNCDESC_VALUE 208 + +#define R_SH_NUM 256 + + + +#define R_390_NONE 0 +#define R_390_8 1 +#define R_390_12 2 +#define R_390_16 3 +#define R_390_32 4 +#define R_390_PC32 5 +#define R_390_GOT12 6 +#define R_390_GOT32 7 +#define R_390_PLT32 8 +#define R_390_COPY 9 +#define R_390_GLOB_DAT 10 +#define R_390_JMP_SLOT 11 +#define R_390_RELATIVE 12 +#define R_390_GOTOFF32 13 +#define R_390_GOTPC 14 +#define R_390_GOT16 15 +#define R_390_PC16 16 +#define R_390_PC16DBL 17 +#define R_390_PLT16DBL 18 +#define R_390_PC32DBL 19 +#define R_390_PLT32DBL 20 +#define R_390_GOTPCDBL 21 +#define R_390_64 22 +#define R_390_PC64 23 +#define R_390_GOT64 24 +#define R_390_PLT64 25 +#define R_390_GOTENT 26 +#define R_390_GOTOFF16 27 +#define R_390_GOTOFF64 28 +#define R_390_GOTPLT12 29 +#define R_390_GOTPLT16 30 +#define R_390_GOTPLT32 31 +#define R_390_GOTPLT64 32 +#define R_390_GOTPLTENT 33 +#define R_390_PLTOFF16 34 +#define R_390_PLTOFF32 35 +#define R_390_PLTOFF64 36 +#define R_390_TLS_LOAD 37 +#define R_390_TLS_GDCALL 38 + +#define R_390_TLS_LDCALL 39 + +#define R_390_TLS_GD32 40 + +#define R_390_TLS_GD64 41 + +#define R_390_TLS_GOTIE12 42 + +#define R_390_TLS_GOTIE32 43 + +#define R_390_TLS_GOTIE64 44 + +#define R_390_TLS_LDM32 45 + +#define R_390_TLS_LDM64 46 + +#define R_390_TLS_IE32 47 + +#define R_390_TLS_IE64 48 + +#define R_390_TLS_IEENT 49 + +#define R_390_TLS_LE32 50 + +#define R_390_TLS_LE64 51 + +#define R_390_TLS_LDO32 52 + +#define R_390_TLS_LDO64 53 + +#define R_390_TLS_DTPMOD 54 +#define R_390_TLS_DTPOFF 55 +#define R_390_TLS_TPOFF 56 + +#define R_390_20 57 +#define R_390_GOT20 58 +#define R_390_GOTPLT20 59 +#define R_390_TLS_GOTIE20 60 + + +#define R_390_NUM 61 + + + +#define R_CRIS_NONE 0 +#define R_CRIS_8 1 +#define R_CRIS_16 2 +#define R_CRIS_32 3 +#define R_CRIS_8_PCREL 4 +#define R_CRIS_16_PCREL 5 +#define R_CRIS_32_PCREL 6 +#define R_CRIS_GNU_VTINHERIT 7 +#define R_CRIS_GNU_VTENTRY 8 +#define R_CRIS_COPY 9 +#define R_CRIS_GLOB_DAT 10 +#define R_CRIS_JUMP_SLOT 11 +#define R_CRIS_RELATIVE 12 +#define R_CRIS_16_GOT 13 +#define R_CRIS_32_GOT 14 +#define R_CRIS_16_GOTPLT 15 +#define R_CRIS_32_GOTPLT 16 +#define R_CRIS_32_GOTREL 17 +#define R_CRIS_32_PLT_GOTREL 18 +#define R_CRIS_32_PLT_PCREL 19 + +#define R_CRIS_NUM 20 + + + +#define R_X86_64_NONE 0 +#define R_X86_64_64 1 +#define R_X86_64_PC32 2 +#define R_X86_64_GOT32 3 +#define R_X86_64_PLT32 4 +#define R_X86_64_COPY 5 +#define R_X86_64_GLOB_DAT 6 +#define R_X86_64_JUMP_SLOT 7 +#define R_X86_64_RELATIVE 8 +#define R_X86_64_GOTPCREL 9 + +#define R_X86_64_32 10 +#define R_X86_64_32S 11 +#define R_X86_64_16 12 +#define R_X86_64_PC16 13 +#define R_X86_64_8 14 +#define R_X86_64_PC8 15 +#define R_X86_64_DTPMOD64 16 +#define R_X86_64_DTPOFF64 17 +#define R_X86_64_TPOFF64 18 +#define R_X86_64_TLSGD 19 + +#define R_X86_64_TLSLD 20 + +#define R_X86_64_DTPOFF32 21 +#define R_X86_64_GOTTPOFF 22 + +#define R_X86_64_TPOFF32 23 +#define R_X86_64_PC64 24 +#define R_X86_64_GOTOFF64 25 +#define R_X86_64_GOTPC32 26 +#define R_X86_64_GOT64 27 +#define R_X86_64_GOTPCREL64 28 +#define R_X86_64_GOTPC64 29 +#define R_X86_64_GOTPLT64 30 +#define R_X86_64_PLTOFF64 31 +#define R_X86_64_SIZE32 32 +#define R_X86_64_SIZE64 33 + +#define R_X86_64_GOTPC32_TLSDESC 34 +#define R_X86_64_TLSDESC_CALL 35 + +#define R_X86_64_TLSDESC 36 +#define R_X86_64_IRELATIVE 37 +#define R_X86_64_RELATIVE64 38 +#define R_X86_64_GOTPCRELX 41 +#define R_X86_64_REX_GOTPCRELX 42 +#define R_X86_64_NUM 43 + + + +#define R_MN10300_NONE 0 +#define R_MN10300_32 1 +#define R_MN10300_16 2 +#define R_MN10300_8 3 +#define R_MN10300_PCREL32 4 +#define R_MN10300_PCREL16 5 +#define R_MN10300_PCREL8 6 +#define R_MN10300_GNU_VTINHERIT 7 +#define R_MN10300_GNU_VTENTRY 8 +#define R_MN10300_24 9 +#define R_MN10300_GOTPC32 10 +#define R_MN10300_GOTPC16 11 +#define R_MN10300_GOTOFF32 12 +#define R_MN10300_GOTOFF24 13 +#define R_MN10300_GOTOFF16 14 +#define R_MN10300_PLT32 15 +#define R_MN10300_PLT16 16 +#define R_MN10300_GOT32 17 +#define R_MN10300_GOT24 18 +#define R_MN10300_GOT16 19 +#define R_MN10300_COPY 20 +#define R_MN10300_GLOB_DAT 21 +#define R_MN10300_JMP_SLOT 22 +#define R_MN10300_RELATIVE 23 + +#define R_MN10300_NUM 24 + + + +#define R_M32R_NONE 0 +#define R_M32R_16 1 +#define R_M32R_32 2 +#define R_M32R_24 3 +#define R_M32R_10_PCREL 4 +#define R_M32R_18_PCREL 5 +#define R_M32R_26_PCREL 6 +#define R_M32R_HI16_ULO 7 +#define R_M32R_HI16_SLO 8 +#define R_M32R_LO16 9 +#define R_M32R_SDA16 10 +#define R_M32R_GNU_VTINHERIT 11 +#define R_M32R_GNU_VTENTRY 12 + +#define R_M32R_16_RELA 33 +#define R_M32R_32_RELA 34 +#define R_M32R_24_RELA 35 +#define R_M32R_10_PCREL_RELA 36 +#define R_M32R_18_PCREL_RELA 37 +#define R_M32R_26_PCREL_RELA 38 +#define R_M32R_HI16_ULO_RELA 39 +#define R_M32R_HI16_SLO_RELA 40 +#define R_M32R_LO16_RELA 41 +#define R_M32R_SDA16_RELA 42 +#define R_M32R_RELA_GNU_VTINHERIT 43 +#define R_M32R_RELA_GNU_VTENTRY 44 +#define R_M32R_REL32 45 + +#define R_M32R_GOT24 48 +#define R_M32R_26_PLTREL 49 +#define R_M32R_COPY 50 +#define R_M32R_GLOB_DAT 51 +#define R_M32R_JMP_SLOT 52 +#define R_M32R_RELATIVE 53 +#define R_M32R_GOTOFF 54 +#define R_M32R_GOTPC24 55 +#define R_M32R_GOT16_HI_ULO 56 + +#define R_M32R_GOT16_HI_SLO 57 + +#define R_M32R_GOT16_LO 58 +#define R_M32R_GOTPC_HI_ULO 59 + +#define R_M32R_GOTPC_HI_SLO 60 + +#define R_M32R_GOTPC_LO 61 + +#define R_M32R_GOTOFF_HI_ULO 62 + +#define R_M32R_GOTOFF_HI_SLO 63 + +#define R_M32R_GOTOFF_LO 64 +#define R_M32R_NUM 256 + +#define R_MICROBLAZE_NONE 0 +#define R_MICROBLAZE_32 1 +#define R_MICROBLAZE_32_PCREL 2 +#define R_MICROBLAZE_64_PCREL 3 +#define R_MICROBLAZE_32_PCREL_LO 4 +#define R_MICROBLAZE_64 5 +#define R_MICROBLAZE_32_LO 6 +#define R_MICROBLAZE_SRO32 7 +#define R_MICROBLAZE_SRW32 8 +#define R_MICROBLAZE_64_NONE 9 +#define R_MICROBLAZE_32_SYM_OP_SYM 10 +#define R_MICROBLAZE_GNU_VTINHERIT 11 +#define R_MICROBLAZE_GNU_VTENTRY 12 +#define R_MICROBLAZE_GOTPC_64 13 +#define R_MICROBLAZE_GOT_64 14 +#define R_MICROBLAZE_PLT_64 15 +#define R_MICROBLAZE_REL 16 +#define R_MICROBLAZE_JUMP_SLOT 17 +#define R_MICROBLAZE_GLOB_DAT 18 +#define R_MICROBLAZE_GOTOFF_64 19 +#define R_MICROBLAZE_GOTOFF_32 20 +#define R_MICROBLAZE_COPY 21 +#define R_MICROBLAZE_TLS 22 +#define R_MICROBLAZE_TLSGD 23 +#define R_MICROBLAZE_TLSLD 24 +#define R_MICROBLAZE_TLSDTPMOD32 25 +#define R_MICROBLAZE_TLSDTPREL32 26 +#define R_MICROBLAZE_TLSDTPREL64 27 +#define R_MICROBLAZE_TLSGOTTPREL32 28 +#define R_MICROBLAZE_TLSTPREL32 29 + +#define DT_NIOS2_GP 0x70000002 + +#define R_NIOS2_NONE 0 +#define R_NIOS2_S16 1 +#define R_NIOS2_U16 2 +#define R_NIOS2_PCREL16 3 +#define R_NIOS2_CALL26 4 +#define R_NIOS2_IMM5 5 +#define R_NIOS2_CACHE_OPX 6 +#define R_NIOS2_IMM6 7 +#define R_NIOS2_IMM8 8 +#define R_NIOS2_HI16 9 +#define R_NIOS2_LO16 10 +#define R_NIOS2_HIADJ16 11 +#define R_NIOS2_BFD_RELOC_32 12 +#define R_NIOS2_BFD_RELOC_16 13 +#define R_NIOS2_BFD_RELOC_8 14 +#define R_NIOS2_GPREL 15 +#define R_NIOS2_GNU_VTINHERIT 16 +#define R_NIOS2_GNU_VTENTRY 17 +#define R_NIOS2_UJMP 18 +#define R_NIOS2_CJMP 19 +#define R_NIOS2_CALLR 20 +#define R_NIOS2_ALIGN 21 +#define R_NIOS2_GOT16 22 +#define R_NIOS2_CALL16 23 +#define R_NIOS2_GOTOFF_LO 24 +#define R_NIOS2_GOTOFF_HA 25 +#define R_NIOS2_PCREL_LO 26 +#define R_NIOS2_PCREL_HA 27 +#define R_NIOS2_TLS_GD16 28 +#define R_NIOS2_TLS_LDM16 29 +#define R_NIOS2_TLS_LDO16 30 +#define R_NIOS2_TLS_IE16 31 +#define R_NIOS2_TLS_LE16 32 +#define R_NIOS2_TLS_DTPMOD 33 +#define R_NIOS2_TLS_DTPREL 34 +#define R_NIOS2_TLS_TPREL 35 +#define R_NIOS2_COPY 36 +#define R_NIOS2_GLOB_DAT 37 +#define R_NIOS2_JUMP_SLOT 38 +#define R_NIOS2_RELATIVE 39 +#define R_NIOS2_GOTOFF 40 +#define R_NIOS2_CALL26_NOAT 41 +#define R_NIOS2_GOT_LO 42 +#define R_NIOS2_GOT_HA 43 +#define R_NIOS2_CALL_LO 44 +#define R_NIOS2_CALL_HA 45 + +#define R_OR1K_NONE 0 +#define R_OR1K_32 1 +#define R_OR1K_16 2 +#define R_OR1K_8 3 +#define R_OR1K_LO_16_IN_INSN 4 +#define R_OR1K_HI_16_IN_INSN 5 +#define R_OR1K_INSN_REL_26 6 +#define R_OR1K_GNU_VTENTRY 7 +#define R_OR1K_GNU_VTINHERIT 8 +#define R_OR1K_32_PCREL 9 +#define R_OR1K_16_PCREL 10 +#define R_OR1K_8_PCREL 11 +#define R_OR1K_GOTPC_HI16 12 +#define R_OR1K_GOTPC_LO16 13 +#define R_OR1K_GOT16 14 +#define R_OR1K_PLT26 15 +#define R_OR1K_GOTOFF_HI16 16 +#define R_OR1K_GOTOFF_LO16 17 +#define R_OR1K_COPY 18 +#define R_OR1K_GLOB_DAT 19 +#define R_OR1K_JMP_SLOT 20 +#define R_OR1K_RELATIVE 21 +#define R_OR1K_TLS_GD_HI16 22 +#define R_OR1K_TLS_GD_LO16 23 +#define R_OR1K_TLS_LDM_HI16 24 +#define R_OR1K_TLS_LDM_LO16 25 +#define R_OR1K_TLS_LDO_HI16 26 +#define R_OR1K_TLS_LDO_LO16 27 +#define R_OR1K_TLS_IE_HI16 28 +#define R_OR1K_TLS_IE_LO16 29 +#define R_OR1K_TLS_LE_HI16 30 +#define R_OR1K_TLS_LE_LO16 31 +#define R_OR1K_TLS_TPOFF 32 +#define R_OR1K_TLS_DTPOFF 33 +#define R_OR1K_TLS_DTPMOD 34 + +#define R_BPF_NONE 0 +#define R_BPF_MAP_FD 1 + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/tools/gbafix/gbafix.c b/tools/gbafix/gbafix.c index 81c8c04c0..9088cdc5f 100644 --- a/tools/gbafix/gbafix.c +++ b/tools/gbafix/gbafix.c @@ -1,45 +1,46 @@ /* - "$Id: gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $" + "$Id: gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $" - DevkitPro GBA ROM fix utility + DevkitPro GBA ROM fix utility - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - USA. + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + USA. - Please report all bugs and problems through the bug tracker at - "http://sourceforge.net/tracker/?group_id=114505&atid=668551". + Please report all bugs and problems through the bug tracker at + "http://sourceforge.net/tracker/?group_id=114505&atid=668551". - "$Header: /lvm/shared/ds/ds/cvs/devkitpro-cvsbackup/tools/gba/gbatools/gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $" + "$Header: /lvm/shared/ds/ds/cvs/devkitpro-cvsbackup/tools/gba/gbatools/gbafix.c,v 1.2 2008-07-30 17:12:51 wntrmute Exp $" */ //--------------------------------------------------------------------------------- // gbafix.c //--------------------------------------------------------------------------------- /* - Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Diegoisawesome) - Validates header of GBA roms. + Gameboy Advance ROM fixer (by Dark Fader / BlackThunder / WinterMute / Diegoisawesome) + Validates header of GBA roms. - History - ------- - v1.06 - added output silencing, (Diegoisawesome) - v1.05 - added debug offset argument, (Diegoisawesome) - v1.04 - converted to plain C, (WinterMute) - v1.03 - header.fixed, header.device_type - v1.02 - redefined the options (rgbfix style), checksum=0 - v1.01 - fix in parameters - v1.00 - logo, complement + History + ------- + v1.07 - added support for ELF input, (PikalaxALT) + v1.06 - added output silencing, (Diegoisawesome) + v1.05 - added debug offset argument, (Diegoisawesome) + v1.04 - converted to plain C, (WinterMute) + v1.03 - header.fixed, header.device_type + v1.02 - redefined the options (rgbfix style), checksum=0 + v1.01 - fix in parameters + v1.00 - logo, complement */ #pragma pack(1) @@ -48,26 +49,27 @@ #include #include #include +#include "elf.h" -#define VER "1.06" -#define ARGV argv[arg] -#define VALUE (ARGV+2) -#define NUMBER strtoul(VALUE, NULL, 0) +#define VER "1.07" +#define ARGV argv[arg] +#define VALUE (ARGV+2) +#define NUMBER strtoul(VALUE, NULL, 0) typedef struct { - uint32_t start_code; // B instruction - uint8_t logo[0xA0-0x04]; // logo data - uint8_t title[0xC]; // game title name - uint32_t game_code; // - uint16_t maker_code; // - uint8_t fixed; // 0x96 - uint8_t unit_code; // 0x00 - uint8_t device_type; // 0x00 - uint8_t unused[7]; // - uint8_t game_version; // 0x00 - uint8_t complement; // 800000A0..800000BC - uint16_t checksum; // 0x0000 + uint32_t start_code; // B instruction + uint8_t logo[0xA0-0x04]; // logo data + uint8_t title[0xC]; // game title name + uint32_t game_code; // + uint16_t maker_code; // + uint8_t fixed; // 0x96 + uint8_t unit_code; // 0x00 + uint8_t device_type; // 0x00 + uint8_t unused[7]; // + uint8_t game_version; // 0x00 + uint8_t complement; // 800000A0..800000BC + uint16_t checksum; // 0x0000 } Header; @@ -77,55 +79,55 @@ unsigned short checksum_without_header = 0; const Header good_header = { - // start_code - 0xEA00002E, - // logo - { 0x24,0xFF,0xAE,0x51,0x69,0x9A,0xA2,0x21,0x3D,0x84,0x82,0x0A,0x84,0xE4,0x09,0xAD, - 0x11,0x24,0x8B,0x98,0xC0,0x81,0x7F,0x21,0xA3,0x52,0xBE,0x19,0x93,0x09,0xCE,0x20, - 0x10,0x46,0x4A,0x4A,0xF8,0x27,0x31,0xEC,0x58,0xC7,0xE8,0x33,0x82,0xE3,0xCE,0xBF, - 0x85,0xF4,0xDF,0x94,0xCE,0x4B,0x09,0xC1,0x94,0x56,0x8A,0xC0,0x13,0x72,0xA7,0xFC, - 0x9F,0x84,0x4D,0x73,0xA3,0xCA,0x9A,0x61,0x58,0x97,0xA3,0x27,0xFC,0x03,0x98,0x76, - 0x23,0x1D,0xC7,0x61,0x03,0x04,0xAE,0x56,0xBF,0x38,0x84,0x00,0x40,0xA7,0x0E,0xFD, - 0xFF,0x52,0xFE,0x03,0x6F,0x95,0x30,0xF1,0x97,0xFB,0xC0,0x85,0x60,0xD6,0x80,0x25, - 0xA9,0x63,0xBE,0x03,0x01,0x4E,0x38,0xE2,0xF9,0xA2,0x34,0xFF,0xBB,0x3E,0x03,0x44, - 0x78,0x00,0x90,0xCB,0x88,0x11,0x3A,0x94,0x65,0xC0,0x7C,0x63,0x87,0xF0,0x3C,0xAF, - 0xD6,0x25,0xE4,0x8B,0x38,0x0A,0xAC,0x72,0x21,0xD4,0xF8,0x07 } , - // title - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - // game code - 0x00000000, - // maker code - 0x3130, - // fixed - 0x96, - // unit_code - 0x00, - // device type - 0x00, - // unused - { 0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, - // game version - 0x00, - // complement - 0x00, - // checksum - 0x0000 + // start_code + 0xEA00002E, + // logo + { 0x24,0xFF,0xAE,0x51,0x69,0x9A,0xA2,0x21,0x3D,0x84,0x82,0x0A,0x84,0xE4,0x09,0xAD, + 0x11,0x24,0x8B,0x98,0xC0,0x81,0x7F,0x21,0xA3,0x52,0xBE,0x19,0x93,0x09,0xCE,0x20, + 0x10,0x46,0x4A,0x4A,0xF8,0x27,0x31,0xEC,0x58,0xC7,0xE8,0x33,0x82,0xE3,0xCE,0xBF, + 0x85,0xF4,0xDF,0x94,0xCE,0x4B,0x09,0xC1,0x94,0x56,0x8A,0xC0,0x13,0x72,0xA7,0xFC, + 0x9F,0x84,0x4D,0x73,0xA3,0xCA,0x9A,0x61,0x58,0x97,0xA3,0x27,0xFC,0x03,0x98,0x76, + 0x23,0x1D,0xC7,0x61,0x03,0x04,0xAE,0x56,0xBF,0x38,0x84,0x00,0x40,0xA7,0x0E,0xFD, + 0xFF,0x52,0xFE,0x03,0x6F,0x95,0x30,0xF1,0x97,0xFB,0xC0,0x85,0x60,0xD6,0x80,0x25, + 0xA9,0x63,0xBE,0x03,0x01,0x4E,0x38,0xE2,0xF9,0xA2,0x34,0xFF,0xBB,0x3E,0x03,0x44, + 0x78,0x00,0x90,0xCB,0x88,0x11,0x3A,0x94,0x65,0xC0,0x7C,0x63,0x87,0xF0,0x3C,0xAF, + 0xD6,0x25,0xE4,0x8B,0x38,0x0A,0xAC,0x72,0x21,0xD4,0xF8,0x07 } , + // title + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + // game code + 0x00000000, + // maker code + 0x3130, + // fixed + 0x96, + // unit_code + 0x00, + // device type + 0x00, + // unused + { 0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, + // game version + 0x00, + // complement + 0x00, + // checksum + 0x0000 }; //--------------------------------------------------------------------------------- char HeaderComplement() /*--------------------------------------------------------------------------------- - Calculate Header complement check + Calculate Header complement check ---------------------------------------------------------------------------------*/ { - int n; - char c = 0; - char *p = (char *)&header + 0xA0; - for (n=0; n<0xBD-0xA0; n++) - { - c += *p++; - } - return -(0x19+c); + int n; + char c = 0; + char *p = (char *)&header + 0xA0; + for (n=0; n<0xBD-0xA0; n++) + { + c += *p++; + } + return -(0x19+c); } @@ -133,157 +135,183 @@ char HeaderComplement() int main(int argc, char *argv[]) //--------------------------------------------------------------------------------- { - int arg; - char *argfile = 0; - FILE *infile; - int silent = 0; + int arg; + char *argfile = 0; + FILE *infile; + int silent = 0; + int schedule_pad = 0; - int size,bit; + int size,bit; - // show syntax - if (argc <= 1) - { - printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Diegoisawesome \n"); - printf("Syntax: gbafix [-p] [-t[title]] [-c] [-m] [-r] [-d] [--silent]\n"); - printf("\n"); - printf("parameters:\n"); - printf(" -p Pad to next exact power of 2. No minimum size!\n"); - printf(" -t[] Patch title. Stripped filename if none given.\n"); - printf(" -c<game_code> Patch game code (four characters)\n"); - printf(" -m<maker_code> Patch maker code (two characters)\n"); - printf(" -r<version> Patch game version (number)\n"); - printf(" -d<debug> Enable debugging handler and set debug entry point (0 or 1)\n"); - printf(" --silent Silence non-error output\n"); - return -1; - } + // show syntax + if (argc <= 1) + { + printf("GBA ROM fixer v"VER" by Dark Fader / BlackThunder / WinterMute / Diegoisawesome \n"); + printf("Syntax: gbafix <rom.gba> [-p] [-t[title]] [-c<game_code>] [-m<maker_code>] [-r<version>] [-d<debug>] [--silent]\n"); + printf("\n"); + printf("parameters:\n"); + printf(" -p Pad to next exact power of 2. No minimum size!\n"); + printf(" -t[<title>] Patch title. Stripped filename if none given.\n"); + printf(" -c<game_code> Patch game code (four characters)\n"); + printf(" -m<maker_code> Patch maker code (two characters)\n"); + printf(" -r<version> Patch game version (number)\n"); + printf(" -d<debug> Enable debugging handler and set debug entry point (0 or 1)\n"); + printf(" --silent Silence non-error output\n"); + return -1; + } - // get filename - for (arg=1; arg<argc; arg++) - { - if (ARGV[0] != '-') { argfile=ARGV; } - if (strncmp("--silent", &ARGV[0], 7) == 0) { silent = 1; } - } + // get filename + for (arg=1; arg<argc; arg++) + { + if (ARGV[0] != '-') { argfile=ARGV; } + if (strncmp("--silent", &ARGV[0], 7) == 0) { silent = 1; } + } - // check filename - if (!argfile) - { - fprintf(stderr, "Filename needed!\n"); - return -1; - } + // check filename + if (!argfile) + { + fprintf(stderr, "Filename needed!\n"); + return -1; + } - // read file - infile = fopen(argfile, "r+b"); - if (!infile) { fprintf(stderr, "Error opening input file!\n"); return -1; } - fseek(infile, 0, SEEK_SET); - fread(&header, sizeof(header), 1, infile); + uint32_t sh_offset = 0; - // fix some data - memcpy(header.logo, good_header.logo, sizeof(header.logo)); - memcpy(&header.fixed, &good_header.fixed, sizeof(header.fixed)); - memcpy(&header.device_type, &good_header.device_type, sizeof(header.device_type)); + // read file + infile = fopen(argfile, "r+b"); + if (!infile) { fprintf(stderr, "Error opening input file!\n"); return -1; } + fseek(infile, sh_offset, SEEK_SET); + fread(&header, sizeof(header), 1, infile); - // parse command line - for (arg=1; arg<argc; arg++) - { - if ((ARGV[0] == '-')) - { - switch (ARGV[1]) - { - case 'p': // pad - { - fseek(infile, 0, SEEK_END); - size = ftell(infile); - for (bit=31; bit>=0; bit--) if (size & (1<<bit)) break; - if (size != (1<<bit)) - { - int todo = (1<<(bit+1)) - size; - while (todo--) fputc(0xFF, infile); - } - fseek(infile, 0, SEEK_SET); - break; - } + // elf check + Elf32_Shdr secHeader; + if (memcmp(&header, ELFMAG, 4) == 0) { + Elf32_Ehdr *elfHeader = (Elf32_Ehdr *)&header; + fseek(infile, elfHeader->e_shoff, SEEK_SET); + int i; + for (i = 0; i < elfHeader->e_shnum; i++) { + fread(&secHeader, sizeof(Elf32_Shdr), 1, infile); + if (secHeader.sh_type == SHT_PROGBITS && secHeader.sh_addr == elfHeader->e_entry) break; + } + if (i == elfHeader->e_shnum) { fprintf(stderr, "Error finding entry point!\n"); return 1; } + fseek(infile, secHeader.sh_offset, SEEK_SET); + sh_offset = secHeader.sh_offset; + fread(&header, sizeof(header), 1, infile); + } - case 't': // title - { - char title[256]; - memset(title, 0, sizeof(title)); - if (VALUE[0]) - { - strncpy(title, VALUE, sizeof(header.title)); - } - else - { - // use filename - char s[256], *begin=s, *t; strcpy(s, argfile); - t = strrchr(s, '\\'); if (t) begin = t+1; - t = strrchr(s, '/'); if (t) begin = t+1; - t = strrchr(s, '.'); if (t) *t = 0; - strncpy(title, begin, sizeof(header.title)); - if (!silent) printf("%s\n",begin); - } - memcpy(header.title, title, sizeof(header.title)); // copy - break; - } + // fix some data + memcpy(header.logo, good_header.logo, sizeof(header.logo)); + memcpy(&header.fixed, &good_header.fixed, sizeof(header.fixed)); + memcpy(&header.device_type, &good_header.device_type, sizeof(header.device_type)); - case 'c': // game code - { - //if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; } - //header.game_code = NUMBER; - header.game_code = VALUE[0] | VALUE[1]<<8 | VALUE[2]<<16 | VALUE[3]<<24; - break; - } + // parse command line + for (arg=1; arg<argc; arg++) + { + if ((ARGV[0] == '-')) + { + switch (ARGV[1]) + { + case 'p': // pad + { + schedule_pad = 1; + break; + } - case 'm': // maker code - { - //if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; } - //header.maker_code = (unsigned short)NUMBER; - header.maker_code = VALUE[0] | VALUE[1]<<8; - break; - } + case 't': // title + { + char title[256]; + memset(title, 0, sizeof(title)); + if (VALUE[0]) + { + strncpy(title, VALUE, sizeof(header.title)); + } + else + { + // use filename + char s[256], *begin=s, *t; strcpy(s, argfile); + t = strrchr(s, '\\'); if (t) begin = t+1; + t = strrchr(s, '/'); if (t) begin = t+1; + t = strrchr(s, '.'); if (t) *t = 0; + strncpy(title, begin, sizeof(header.title)); + if (!silent) printf("%s\n",begin); + } + memcpy(header.title, title, sizeof(header.title)); // copy + break; + } - case 'v': // ignored, compatability with other gbafix - { - break; - } + case 'c': // game code + { + //if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; } + //header.game_code = NUMBER; + header.game_code = VALUE[0] | VALUE[1]<<8 | VALUE[2]<<16 | VALUE[3]<<24; + break; + } - case 'r': // version - { - if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; } - header.game_version = (unsigned char)NUMBER; - break; - } + case 'm': // maker code + { + //if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; } + //header.maker_code = (unsigned short)NUMBER; + header.maker_code = VALUE[0] | VALUE[1]<<8; + break; + } - case 'd': // debug - { - if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; } - header.logo[0x9C-0x04] = 0xA5; // debug enable - header.device_type = (unsigned char)((NUMBER & 1) << 7); // debug handler entry point - break; - } - case '-': // long arguments - { - if (strncmp("silent", &ARGV[2], 6) == 0) { continue; } - break; - } - default: - { - printf("Invalid option: %s\n", ARGV); - } - } - } - } + case 'v': // ignored, compatability with other gbafix + { + break; + } - // update complement check & total checksum - header.complement = 0; - header.checksum = 0; // must be 0 - header.complement = HeaderComplement(); - //header.checksum = checksum_without_header + HeaderChecksum(); + case 'r': // version + { + if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; } + header.game_version = (unsigned char)NUMBER; + break; + } - fseek(infile, 0, SEEK_SET); - fwrite(&header, sizeof(header), 1, infile); - fclose(infile); + case 'd': // debug + { + if (!VALUE[0]) { fprintf(stderr, "Need value for %s\n", ARGV); break; } + header.logo[0x9C-0x04] = 0xA5; // debug enable + header.device_type = (unsigned char)((NUMBER & 1) << 7); // debug handler entry point + break; + } + case '-': // long arguments + { + if (strncmp("silent", &ARGV[2], 6) == 0) { continue; } + break; + } + default: + { + printf("Invalid option: %s\n", ARGV); + } + } + } + } - if (!silent) printf("ROM fixed!\n"); + // update complement check & total checksum + header.complement = 0; + header.checksum = 0; // must be 0 + header.complement = HeaderComplement(); + //header.checksum = checksum_without_header + HeaderChecksum(); - return 0; + if (schedule_pad) { + if (sh_offset != 0) { + fprintf(stderr, "Warning: Cannot safely pad an ELF\n"); + } else { + fseek(infile, 0, SEEK_END); + size = ftell(infile); + for (bit=31; bit>=0; bit--) if (size & (1<<bit)) break; + if (size != (1<<bit)) + { + int todo = (1<<(bit+1)) - size; + while (todo--) fputc(0xFF, infile); + } + } + } + + fseek(infile, sh_offset, SEEK_SET); + fwrite(&header, sizeof(header), 1, infile); + fclose(infile); + + if (!silent) printf("ROM fixed!\n"); + + return 0; } diff --git a/tools/jsonproc/Makefile b/tools/jsonproc/Makefile index 69093a216..721da1025 100755 --- a/tools/jsonproc/Makefile +++ b/tools/jsonproc/Makefile @@ -8,7 +8,10 @@ SRCS := jsonproc.cpp HEADERS := jsonproc.h inja.hpp nlohmann/json.hpp -.PHONY: clean +.PHONY: all clean + +all: jsonproc + @: jsonproc: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(INCLUDES) $(SRCS) -o $@ $(LDFLAGS) diff --git a/tools/mapjson/Makefile b/tools/mapjson/Makefile index d09acad50..9a49be506 100644 --- a/tools/mapjson/Makefile +++ b/tools/mapjson/Makefile @@ -6,7 +6,10 @@ SRCS := json11.cpp mapjson.cpp HEADERS := mapjson.h -.PHONY: clean +.PHONY: all clean + +all: mapjson + @: mapjson: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) diff --git a/tools/preproc/Makefile b/tools/preproc/Makefile index 3d3275819..63dedda1f 100644 --- a/tools/preproc/Makefile +++ b/tools/preproc/Makefile @@ -8,7 +8,10 @@ SRCS := asm_file.cpp c_file.cpp charmap.cpp preproc.cpp string_parser.cpp \ HEADERS := asm_file.h c_file.h char_util.h charmap.h preproc.h string_parser.h \ utf8.h -.PHONY: clean +.PHONY: all clean + +all: preproc + @: preproc: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) diff --git a/tools/ramscrgen/Makefile b/tools/ramscrgen/Makefile index 9aa309aa1..858db1a77 100644 --- a/tools/ramscrgen/Makefile +++ b/tools/ramscrgen/Makefile @@ -6,7 +6,10 @@ SRCS := main.cpp sym_file.cpp elf.cpp HEADERS := ramscrgen.h sym_file.h elf.h char_util.h -.PHONY: clean +.PHONY: all clean + +all: ramscrgen + @: ramscrgen: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS) diff --git a/tools/rsfont/Makefile b/tools/rsfont/Makefile index 582be7b88..abe1cab51 100644 --- a/tools/rsfont/Makefile +++ b/tools/rsfont/Makefile @@ -6,7 +6,10 @@ LIBS = -lpng -lz SRCS = main.c convert_png.c util.c font.c -.PHONY: clean +.PHONY: all clean + +all: rsfont + @: rsfont: $(SRCS) convert_png.h gfx.h global.h util.h font.h $(CC) $(CFLAGS) $(SRCS) -o $@ $(LDFLAGS) $(LIBS) diff --git a/tools/scaninc/Makefile b/tools/scaninc/Makefile index 53c9d0060..1516f159c 100644 --- a/tools/scaninc/Makefile +++ b/tools/scaninc/Makefile @@ -6,7 +6,10 @@ SRCS = scaninc.cpp c_file.cpp asm_file.cpp source_file.cpp HEADERS := scaninc.h asm_file.h c_file.h source_file.h -.PHONY: clean +.PHONY: all clean + +all: scaninc + @: scaninc: $(SRCS) $(HEADERS) $(CXX) $(CXXFLAGS) $(SRCS) -o $@ $(LDFLAGS)