Merge pull request #4 from nullableVoidPtr/master

Overhaul
This commit is contained in:
PikalaxALT 2019-08-10 05:15:50 -04:00 committed by GitHub
commit 9e96960145
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 8886 additions and 8115 deletions

View File

@ -1,3 +1,5 @@
First, you must put a Pokémon Mystery Dungeon Red Rescue Team 1.0 (US) ROM in the root directory of the repository and name it `baserom.gba`. It should have a SHA1 checksum of `9f4cfc5b5f4859d17169a485462e977c7aac2b89`. Then, follow the OS-specific instructions below.
# Linux
Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM).
@ -10,7 +12,7 @@ Then get the compiler from https://github.com/pret/agbcc and run the following c
install.sh PATH_OF_PMD-RED_DIRECTORY
${DEVKITARM}/bin/arm-none-eabi/ranlib PATH_OF_PMD-RED_DIRECTORY/tools/agbcc/lib/libgcc.a lib/libc.a
Then in the pokeruby directory, build the tools.
Then in the pmd-red directory, build the tools.
build_tools.sh
@ -22,6 +24,6 @@ Finally, build the rom.
Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM).
Then get the compiled tools from https://github.com/pret/pokeruby-tools. Copy the `tools/` folder over the `tools/` folder in your pokeruby directory.
Then get the compiled tools from https://github.com/pret/pokeruby-tools. Copy the `tools/` folder over the `tools/` folder in your pmd-red directory.
You can then build pokeruby using `make` in the MSYS environment provided with devkitARM.
You can then build pmd-red using `make` in the MSYS environment provided with devkitARM.

190
Makefile
View File

@ -1,99 +1,133 @@
AS := $(DEVKITARM)/bin/arm-none-eabi-as
ASFLAGS := -mcpu=arm7tdmi
include $(DEVKITARM)/base_tools
CC1 := tools/agbcc/bin/agbcc
override CFLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -O2 -fhex-asm
ifeq ($(OS),Windows_NT)
EXE := .exe
else
EXE :=
endif
CPP := $(DEVKITARM)/bin/arm-none-eabi-cpp
CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef
TITLE := POKE DUNGEON
GAME_CODE := B24E
MAKER_CODE := 01
REVISION := 0
LD := $(DEVKITARM)/bin/arm-none-eabi-ld
#### Tools ####
OBJCOPY := $(DEVKITARM)/bin/arm-none-eabi-objcopy
LIBGCC := tools/agbcc/lib/libgcc.a
LIBC := tools/agbcc/lib/libc.a
MD5 := md5sum -c
GFX := tools/gbagfx/gbagfx
AIF := tools/aif2pcm/aif2pcm
MID := tools/mid2agb/mid2agb
SCANINC := tools/scaninc/scaninc
PREPROC := tools/preproc/preproc
SHELL := /bin/bash -o pipefail
AS := $(PREFIX)as
CC1 := tools/agbcc/bin/agbcc
CPP := $(PREFIX)cpp
LD := $(PREFIX)ld
OBJCOPY := $(PREFIX)objcopy
SHA1SUM := sha1sum -c
GBAGFX := tools/gbagfx/gbagfx
GBAFIX := tools/gbafix/gbafix
AIF2PCM := tools/aif2pcm/aif2pcm
MID2AGB := tools/mid2agb/mid2agb
PREPROC := tools/preproc/preproc
SCANINC := tools/scaninc/scaninc
RAMSCRGEN := tools/ramscrgen/ramscrgen
# Clear the default suffixes.
.SUFFIXES:
ASFLAGS := -mcpu=arm7tdmi
override CC1FLAGS += -mthumb-interwork -Wimplicit -Wparentheses -Wunused -Werror -O2 -fhex-asm
CPPFLAGS := -I tools/agbcc/include -iquote include -nostdinc -undef
#### Files ####
BUILD_NAME = red
ROM := pmd_$(BUILD_NAME).gba
MAP := $(ROM:%.gba=%.map)
BUILD_DIR := build/pmd_$(BUILD_NAME)
C_SOURCES := $(wildcard src/*.c)
ASM_SOURCES := $(wildcard asm/*.s data/*.s)
C_OBJECTS := $(addprefix $(BUILD_DIR)/, $(C_SOURCES:%.c=%.o))
ASM_OBJECTS := $(addprefix $(BUILD_DIR)/, $(ASM_SOURCES:%.s=%.o))
ALL_OBJECTS := $(C_OBJECTS) $(ASM_OBJECTS)
SUBDIRS := $(sort $(dir $(ALL_OBJECTS)))
ifeq ($(OS),Windows_NT)
LIB := ../../tools/agbcc/lib/libc.a ../../tools/agbcc/lib/libgcc.a
else
LIB := -L ../../tools/agbcc/lib -lc -lgcc
endif
LD_SCRIPT := $(BUILD_DIR)/ld_script.ld
# Special configurations required for lib files
$(BUILD_DIR)/src/agb_flash.o : CC1FLAGS := -O -mthumb-interwork
$(BUILD_DIR)/src/agb_flash_1m.o: CC1FLAGS := -O -mthumb-interwork
$(BUILD_DIR)/src/agb_flash_mx.o: CC1FLAGS := -O -mthumb-interwork
$(BUILD_DIR)/src/m4a_2.o: CC1 := tools/agbcc/bin/old_agbcc
$(BUILD_DIR)/src/m4a_4.o: CC1 := tools/agbcc/bin/old_agbcc
#### Main Rules ####
# Disable dependency scanning when NODEP is used for quick building
ifeq ($(NODEP),)
$(BUILD_DIR)/src/%.o: C_DEP = $(shell $(SCANINC) -I include src/$(*F).c)
$(BUILD_DIR)/asm/%.o: ASM_DEP = $(shell $(SCANINC) asm/$(*F).s)
$(BUILD_DIR)/data/%.o: ASM_DEP = $(shell $(SCANINC) data/$(*F).s)
endif
ALL_BUILDS := red
# Available targets
.PHONY: all clean tidy
MAKEFLAGS += --no-print-directory
# Secondary expansion is required for dependency variables in object rules.
.SECONDEXPANSION:
# Clear the default suffixes
.SUFFIXES:
# Don't delete intermediate files
.SECONDARY:
# Delete files that weren't built properly
.DELETE_ON_ERROR:
.PRECIOUS: %.1bpp %.4bpp %.8bpp %.gbapal %.lz %.rl %.pcm %.bin
.PHONY: all clean tidy
C_SRCS := $(wildcard src/*.c)
C_OBJS := $(C_SRCS:%.c=%.o)
# Create build subdirectories
ASM_SRCS := $(wildcard asm/*.s)
ASM_OBJS := $(ASM_SRCS:%.s=%.o)
DATA_ASM_SRCS := $(wildcard data/*.s)
DATA_ASM_OBJS := $(DATA_ASM_SRCS:%.s=%.o)
OBJS := $(C_OBJS) $(ASM_OBJS) $(DATA_ASM_OBJS)
all: pmd_red.gba
# For contributors to make sure a change didn't affect the contents of the ROM.
$(shell mkdir -p $(SUBDIRS))
all: $(ROM)
compare: all
@$(MD5) rom.md5
@$(SHA1SUM) $(BUILD_NAME).sha1
clean: tidy
$(RM) $(ALL_OBJECTS)
tidy:
rm -f pmd_red.gba pmd_red.elf pmd_red.map
rm -f $(ASM_OBJS)
rm -f $(DATA_ASM_OBJS)
rm -f $(C_OBJS)
rm -f $(ASM_OBJS)
rm -f $(DATA_ASM_OBJS)
rm -f $(C_SRCS:%.c=%.i)
rm -f $(C_SRCS:%.c=%.s)
rm -f *.ld
$(RM) $(ALL_BUILDS:%=pmd_%{.gba,.elf,.map})
$(RM) -r build
src/agb_flash.o: CFLAGS := -O -mthumb-interwork
src/agb_flash_1m.o: CFLAGS := -O -mthumb-interwork
src/agb_flash_mx.o: CFLAGS := -O -mthumb-interwork
$(C_OBJS): %.o : %.c
@$(CPP) $(CPPFLAGS) $< -o $*.i
@$(CC1) $(CFLAGS) $*.i -o $*.s
@printf ".text\n\t.align\t2, 0\n" >> $*.s
$(AS) $(ASFLAGS) -o $@ $*.s
$(ASM_OBJS): %.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
$(DATA_ASM_OBJS): %.o: %.s
$(AS) $(ASFLAGS) -o $@ $<
sym_ewram.ld: sym_ewram.txt
$(RAMSCRGEN) ewram_data sym_ewram.txt ENGLISH >$@
sym_ewram2.ld: sym_ewram2.txt
$(RAMSCRGEN) ewram_data sym_ewram2.txt ENGLISH >$@
sym_iwram.ld: sym_iwram.txt
$(RAMSCRGEN) iwram_data sym_iwram.txt ENGLISH >$@
ld_script.ld: ld_script.txt sym_ewram.ld sym_ewram2.ld sym_iwram.ld
sed -f ld_script.sed ld_script.txt >ld_script.ld
pmd_red.elf: ld_script.ld $(OBJS) $(LIBC)
$(LD) -T ld_script.ld -Map pmd_red.map -o $@ $(OBJS) $(LIBC) $(LIBGCC)
pmd_red.gba: pmd_red.elf
$(ROM): %.gba: %.elf
$(OBJCOPY) -O binary --gap-fill 0xFF --pad-to 0xA000000 $< $@
$(GBAFIX) $@ -p -t"$(TITLE)" -c$(GAME_CODE) -m$(MAKER_CODE) -r$(REVISION) --silent
%.elf: $(LD_SCRIPT) $(ALL_OBJECTS) $(LIBC)
cd $(BUILD_DIR) && $(LD) -T ld_script.ld -Map ../../$(MAP) -o ../../$@ $(LIB)
$(LD_SCRIPT): ld_script.txt $(BUILD_DIR)/sym_ewram.ld $(BUILD_DIR)/sym_ewram2.ld $(BUILD_DIR)/sym_iwram.ld
cd $(BUILD_DIR) && sed -e "s#tools/#../../tools/#g" ../../ld_script.txt >ld_script.ld
$(BUILD_DIR)/sym_%.ld: sym_%.txt
$(CPP) -P $(CPPFLAGS) $< | sed -e "s#tools/#../../tools/#g" > $@
$(C_OBJECTS): $(BUILD_DIR)/%.o: %.c $$(C_DEP)
@$(CPP) $(CPPFLAGS) $< -o $(BUILD_DIR)/$*.i
@$(CC1) $(CC1FLAGS) $(BUILD_DIR)/$*.i -o $(BUILD_DIR)/$*.s
@printf ".text\n\t.align\t2, 0\n" >> $(BUILD_DIR)/$*.s
$(AS) $(ASFLAGS) -o $@ $(BUILD_DIR)/$*.s
$(BUILD_DIR)/data/%.o: data/%.s $$(ASM_DEP)
$(PREPROC) $< charmap.txt | $(CPP) -I include | $(AS) $(ASFLAGS) -o $@
$(BUILD_DIR)/%.o: %.s $$(ASM_DEP)
$(AS) $(ASFLAGS) $< -o $@

View File

@ -1,10 +1,10 @@
# Pokémon Mystery Dungeon: Red Rescue Team [![Build Status][travis-badge]][travis]
# Pokémon Mystery Dungeon: Red Rescue Team
This is a disassembly of Pokémon Mystery Dungeon: Red Rescue Team.
It builds the following rom:
* pmd_red.gba `md5: 2100cf6f17e12cd34f1513647dfa506b`
* pmd_red.gba `sha1: 9f4cfc5b5f4859d17169a485462e977c7aac2b89`
To set up the repository, see [INSTALL.md](INSTALL.md).
@ -33,5 +33,3 @@ To set up the repository, see [INSTALL.md](INSTALL.md).
[pokeemerald]: https://github.com/pret/pokeemerald
[Discord]: https://discord.gg/6EuWgX9
[irc]: https://kiwiirc.com/client/irc.freenode.net/?#pret
[travis]: https://travis-ci.org/pret/pokeruby
[travis-badge]: https://travis-ci.org/pret/pokeruby.svg?branch=master

View File

@ -1,263 +0,0 @@
.include "constants/gba_constants.inc"
.include "asm/macros.inc"
.syntax unified
.text
thumb_func_start InitBGPaletteBuffer
InitBGPaletteBuffer:
push {lr}
movs r2, 0
ldr r1, _0800465C
movs r0, 0x80
lsls r0, 2
_0800463E:
strh r2, [r1]
adds r1, 0x2
subs r0, 0x1
cmp r0, 0
bne _0800463E
ldr r1, _08004660
movs r2, 0x1
adds r0, r1, 0
adds r0, 0x1F
_08004650:
strb r2, [r0]
subs r0, 0x1
cmp r0, r1
bge _08004650
pop {r0}
bx r0
.align 2, 0
_0800465C: .4byte gUnknown_20251F0
_08004660: .4byte gUnknown_20251D0
thumb_func_end InitBGPaletteBuffer
thumb_func_start SetBGPaletteBufferColorRGB
SetBGPaletteBufferColorRGB:
push {r4-r7,lr}
adds r4, r0, 0
adds r5, r1, 0
cmp r2, 0
bge _08004670
movs r2, 0
_08004670:
cmp r2, 0x1F
ble _08004676
movs r2, 0x1F
_08004676:
ldr r1, _080046CC
adds r0, r4, 0
cmp r4, 0
bge _08004680
adds r0, 0xF
_08004680:
asrs r0, 4
adds r0, r1
movs r1, 0x1
strb r1, [r0]
cmp r3, 0
bne _080046D4
ldr r0, _080046D0
lsls r1, r4, 1
adds r6, r1, r0
ldrb r0, [r5, 0x2]
muls r0, r2
cmp r0, 0
bge _0800469C
adds r0, 0xFF
_0800469C:
asrs r0, 8
movs r3, 0x1F
ands r0, r3
lsls r4, r0, 10
ldrb r0, [r5, 0x1]
muls r0, r2
cmp r0, 0
bge _080046AE
adds r0, 0xFF
_080046AE:
asrs r0, 8
ands r0, r3
lsls r1, r0, 5
orrs r1, r4
ldrb r0, [r5]
muls r0, r2
cmp r0, 0
bge _080046C0
adds r0, 0xFF
_080046C0:
asrs r0, 8
ands r0, r3
orrs r1, r0
strh r1, [r6]
b _08004722
.align 2, 0
_080046CC: .4byte gUnknown_20251D0
_080046D0: .4byte gUnknown_20251F0
_080046D4:
ldr r1, _08004728
lsls r0, r4, 1
adds r7, r0, r1
ldrb r0, [r5, 0x2]
lsls r0, 2
adds r0, r3
ldrb r0, [r0, 0x2]
muls r0, r2
cmp r0, 0
bge _080046EA
adds r0, 0xFF
_080046EA:
asrs r0, 8
movs r4, 0x1F
ands r0, r4
lsls r6, r0, 10
ldrb r0, [r5, 0x1]
lsls r0, 2
adds r0, r3
ldrb r0, [r0, 0x1]
muls r0, r2
cmp r0, 0
bge _08004702
adds r0, 0xFF
_08004702:
asrs r0, 8
ands r0, r4
lsls r1, r0, 5
orrs r1, r6
ldrb r0, [r5]
lsls r0, 2
adds r0, r3
ldrb r0, [r0]
muls r0, r2
cmp r0, 0
bge _0800471A
adds r0, 0xFF
_0800471A:
asrs r0, 8
ands r0, r4
orrs r1, r0
strh r1, [r7]
_08004722:
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_08004728: .4byte gUnknown_20251F0
thumb_func_end SetBGPaletteBufferColorRGB
thumb_func_start SetBGPaletteBufferColorArray
SetBGPaletteBufferColorArray:
push {lr}
adds r2, r0, 0
adds r3, r1, 0
ldr r1, _08004764
cmp r2, 0
bge _0800473A
adds r0, 0xF
_0800473A:
asrs r0, 4
adds r0, r1
movs r1, 0x1
strb r1, [r0]
ldr r0, _08004768
lsls r2, 1
adds r2, r0
ldrb r1, [r3, 0x2]
lsrs r1, 3
lsls r1, 10
ldrb r0, [r3, 0x1]
lsrs r0, 3
lsls r0, 5
orrs r1, r0
ldrb r0, [r3]
lsrs r0, 3
orrs r0, r1
strh r0, [r2]
pop {r0}
bx r0
.align 2, 0
_08004764: .4byte gUnknown_20251D0
_08004768: .4byte gUnknown_20251F0
thumb_func_end SetBGPaletteBufferColorArray
thumb_func_start SetBGPaletteBufferColor
SetBGPaletteBufferColor:
push {lr}
adds r2, r0, 0
adds r3, r1, 0
ldr r1, _08004790
cmp r2, 0
bge _0800477A
adds r0, 0xF
_0800477A:
asrs r0, 4
adds r0, r1
movs r1, 0x1
strb r1, [r0]
ldr r1, _08004794
lsls r0, r2, 1
adds r0, r1
ldrh r1, [r3]
strh r1, [r0]
pop {r0}
bx r0
.align 2, 0
_08004790: .4byte gUnknown_20251D0
_08004794: .4byte gUnknown_20251F0
thumb_func_end SetBGPaletteBufferColor
thumb_func_start nullsub_4
nullsub_4:
bx lr
thumb_func_end nullsub_4
thumb_func_start nullsub_5
nullsub_5:
bx lr
thumb_func_end nullsub_5
thumb_func_start nullsub_143
nullsub_143:
bx lr
thumb_func_end nullsub_143
thumb_func_start TransferBGPaletteBuffer
TransferBGPaletteBuffer:
push {r4-r6,lr}
movs r6, 0
movs r4, 0
movs r5, 0xA0
lsls r5, 19
_080047AE:
ldr r0, _080047DC
adds r1, r6, r0
ldrb r0, [r1]
cmp r0, 0
beq _080047CA
movs r0, 0
strb r0, [r1]
lsls r1, r4, 1
ldr r0, _080047E0
adds r1, r0
adds r0, r5, 0
movs r2, 0x20
bl CpuCopy
_080047CA:
adds r6, 0x1
adds r5, 0x20
adds r4, 0x10
ldr r0, _080047E4
cmp r4, r0
ble _080047AE
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_080047DC: .4byte gUnknown_20251D0
_080047E0: .4byte gUnknown_20251F0
_080047E4: .4byte 0x000001ff
thumb_func_end TransferBGPaletteBuffer
.align 2, 0 @ Don't pad with nop.

View File

@ -198,7 +198,7 @@ _08000406:
movs r0, 0x2
bl sub_800A8F8
movs r0, 0x1
bl sub_8004D8C
bl ResetSprites
movs r0, 0
bl xxx_update_some_bg_tiles
bl sub_80097B0
@ -431,7 +431,7 @@ xxx_update_stuff:
bl sub_8009908
bl xxx_call_update_bg_sound_input
movs r0, 0
bl sub_8004D8C
bl ResetSprites
pop {r0}
bx r0
.align 2, 0

View File

@ -1062,7 +1062,7 @@ sub_800BD08:
ands r3, r1
strh r3, [r0, 0xA]
ldrh r0, [r0, 0xA]
bl sub_80AEF24
bl m4aSoundInit
ldr r0, _0800BDB8
movs r2, 0
strh r2, [r0]
@ -1184,7 +1184,7 @@ _0800BE4C:
movs r0, 0x1
strh r0, [r1]
adds r0, r6, 0
bl sub_80AEFA8
bl m4aSongNumStart
_0800BE70:
cmp r4, 0
beq _0800BE78
@ -1258,19 +1258,19 @@ _0800BEE0:
movs r1, 0x1
strh r1, [r0]
adds r0, r6, 0
bl sub_80AEFA8
bl m4aSongNumStart
ldr r4, _0800BF44
adds r0, r4, 0
bl sub_80AF198
bl m4aMPlayImmInit
adds r0, r4, 0
movs r1, 0xFF
movs r2, 0
bl sub_80AFF50
bl m4aMPlayVolumeControl
adds r0, r6, 0
bl sub_80AF074
bl m4aSongNumStop
adds r0, r4, 0
adds r1, r5, 0
bl sub_80AF170
bl m4aMPlayFadeIn
_0800BF26:
cmp r7, 0
beq _0800BF2E
@ -1333,7 +1333,7 @@ sub_800BF80:
cmp r1, r0
beq _0800BFA2
ldr r0, _0800BFC8
bl sub_80AF7C0
bl m4aMPlayStop
_0800BFA2:
ldr r0, _0800BFC0
ldr r2, _0800BFC4
@ -1392,7 +1392,7 @@ _0800BFE8:
strh r0, [r1]
ldr r0, _0800C028
adds r1, r4, 0
bl sub_80AF140
bl m4aMPlayFadeOut
b _0800C044
.align 2, 0
_0800C018: .4byte gUnknown_202D690
@ -1403,7 +1403,7 @@ _0800C028: .4byte gUnknown_20008F0
_0800C02C:
strh r2, [r3]
ldr r0, _0800C038
bl sub_80AF7C0
bl m4aMPlayStop
b _0800C044
.align 2, 0
_0800C038: .4byte gUnknown_20008F0
@ -1506,7 +1506,7 @@ _0800C0B4:
strb r2, [r0]
ldr r0, _0800C11C
movs r1, 0x1
bl sub_80AF150
bl m4aMPlayFadeOutTemporarily
b _0800C15E
.align 2, 0
_0800C0FC: .4byte 0x000003e5
@ -1529,9 +1529,9 @@ _0800C12C:
movs r0, 0x3
strh r0, [r4]
ldr r0, _0800C140
bl sub_80AF7C0
bl m4aMPlayStop
ldrh r0, [r6]
bl sub_80AEFA8
bl m4aSongNumStart
b _0800C15E
.align 2, 0
_0800C140: .4byte gUnknown_20008F0
@ -1542,9 +1542,9 @@ _0800C144:
cmp r0, 0x1
bls _0800C15E
ldr r0, _0800C17C
bl sub_80AF7C0
bl m4aMPlayStop
ldrh r0, [r6]
bl sub_80AEFA8
bl m4aSongNumStart
movs r0, 0x3
_0800C15C:
strh r0, [r4]
@ -1618,7 +1618,7 @@ _0800C1DC:
lsls r0, 24
lsrs r5, r0, 24
mov r0, r8
bl sub_80AEFA8
bl m4aSongNumStart
movs r0, 0x1
strh r0, [r4]
mov r0, r8
@ -1693,7 +1693,7 @@ _0800C22C:
mov r0, r8
movs r1, 0xF
adds r2, r7, 0
bl sub_80AFF50
bl m4aMPlayVolumeControl
_0800C27E:
cmp r6, 0
beq _0800C286
@ -1705,7 +1705,7 @@ _0800C286:
pop {r0}
bx r0
.align 2, 0
_0800C290: .4byte gUnknown_9E8665C
_0800C290: .4byte gMPlayTable
_0800C294: .4byte gUnknown_3000FD8
thumb_func_end sub_800C214
@ -1736,7 +1736,7 @@ sub_800C298:
movs r5, 0x4
_0800C2C8:
ldr r0, [r6]
bl sub_80AF7C0
bl m4aMPlayStop
strh r7, [r4]
mov r2, r8
strh r2, [r4, 0x2]
@ -1756,7 +1756,7 @@ _0800C2C8:
.align 2, 0
_0800C2F0: .4byte 0x000003e5
_0800C2F4: .4byte gUnknown_3000FE8
_0800C2F8: .4byte gUnknown_9E8665C
_0800C2F8: .4byte gMPlayTable
_0800C2FC:
adds r0, r5, 0
bl sub_800CAAC
@ -1782,7 +1782,7 @@ _0800C2FC:
bl nullsub_21
b _0800C3DE
.align 2, 0
_0800C330: .4byte gUnknown_9E8665C
_0800C330: .4byte gMPlayTable
_0800C334: .4byte gUnknown_3000FD8
_0800C338:
bl sub_800B620
@ -1792,7 +1792,7 @@ _0800C338:
cmp r0, r5
bne _0800C35A
adds r0, r7, 0
bl sub_80AF7C0
bl m4aMPlayStop
movs r1, 0
movs r0, 0
strh r0, [r4]
@ -1823,7 +1823,7 @@ _0800C364:
mov r0, r8
strh r0, [r1]
ldr r0, _0800C3A4
bl sub_80AF7C0
bl m4aMPlayStop
_0800C38C:
cmp r4, 0
beq _0800C3DE
@ -1854,7 +1854,7 @@ _0800C3A8:
mov r2, r8
strh r2, [r1]
ldr r0, _0800C3F4
bl sub_80AF7C0
bl m4aMPlayStop
_0800C3D6:
cmp r4, 0
beq _0800C3DE
@ -1924,15 +1924,15 @@ _0800C43E:
beq _0800C46C
ldr r0, [r6]
mov r1, r9
bl sub_80AF140
bl m4aMPlayFadeOut
b _0800C47E
.align 2, 0
_0800C460: .4byte 0x000003e5
_0800C464: .4byte gUnknown_3000FE8
_0800C468: .4byte gUnknown_9E8665C
_0800C468: .4byte gMPlayTable
_0800C46C:
ldr r0, [r6]
bl sub_80AF7C0
bl m4aMPlayStop
strh r4, [r5]
mov r1, r8
strh r1, [r5, 0x2]
@ -1985,14 +1985,14 @@ _0800C496:
beq _0800C4EC
adds r0, r6, 0
mov r1, r9
bl sub_80AF140
bl m4aMPlayFadeOut
b _0800C4FE
.align 2, 0
_0800C4E4: .4byte gUnknown_3000FD8
_0800C4E8: .4byte gUnknown_9E8665C
_0800C4E8: .4byte gMPlayTable
_0800C4EC:
adds r0, r6, 0
bl sub_80AF7C0
bl m4aMPlayStop
movs r0, 0
strh r4, [r5]
mov r1, r8
@ -2026,7 +2026,7 @@ _0800C508:
beq _0800C54C
ldr r0, _0800C548
mov r1, r9
bl sub_80AF140
bl m4aMPlayFadeOut
b _0800C556
.align 2, 0
_0800C53C: .4byte 0x000003e6
@ -2035,7 +2035,7 @@ _0800C544: .4byte gUnknown_202D68E
_0800C548: .4byte gUnknown_2000970
_0800C54C:
ldr r0, _0800C560
bl sub_80AF7C0
bl m4aMPlayStop
mov r0, r8
strh r0, [r4]
_0800C556:
@ -2069,7 +2069,7 @@ _0800C564:
beq _0800C5AC
ldr r0, _0800C5A8
mov r1, r9
bl sub_80AF140
bl m4aMPlayFadeOut
b _0800C5B6
.align 2, 0
_0800C5A0: .4byte gUnknown_202D690
@ -2077,7 +2077,7 @@ _0800C5A4: .4byte gUnknown_202D68E
_0800C5A8: .4byte gUnknown_2000970
_0800C5AC:
ldr r0, _0800C5CC
bl sub_80AF7C0
bl m4aMPlayStop
mov r1, r8
strh r1, [r5]
_0800C5B6:
@ -2246,7 +2246,7 @@ _0800C6D8:
beq _0800C718
ldrh r0, [r2]
_0800C6E4:
bl sub_80AEFA8
bl m4aSongNumStart
movs r0, 0x3
strh r0, [r4]
b _0800C8A2
@ -2297,7 +2297,7 @@ _0800C74C: .4byte gUnknown_202D68E
_0800C750: .4byte 0x000003e5
_0800C754:
ldr r0, _0800C76C
bl sub_80AF7C0
bl m4aMPlayStop
_0800C75A:
ldr r1, _0800C770
ldrh r0, [r1]
@ -2324,7 +2324,7 @@ _0800C774:
cmp r0, 0
beq _0800C7A4
ldrh r0, [r3]
bl sub_80AEFA8
bl m4aSongNumStart
b _0800C7BE
.align 2, 0
_0800C794: .4byte gUnknown_202D68A
@ -2334,7 +2334,7 @@ _0800C7A0: .4byte gUnknown_202D694
_0800C7A4:
ldr r0, _0800C7B0
movs r1, 0x4
bl sub_80AF170
bl m4aMPlayFadeIn
b _0800C7BE
.align 2, 0
_0800C7B0: .4byte gUnknown_20008F0
@ -2342,7 +2342,7 @@ _0800C7B4:
ldr r0, _0800C7CC
strh r2, [r0]
ldr r0, _0800C7D0
bl sub_80AF7C0
bl m4aMPlayStop
_0800C7BE:
ldr r1, _0800C7D4
movs r0, 0
@ -2402,7 +2402,7 @@ _0800C834: .4byte gUnknown_202D68A
_0800C838: .4byte 0x000003e7
_0800C83C:
ldr r0, _0800C854
bl sub_80AF7C0
bl m4aMPlayStop
_0800C842:
ldr r1, _0800C858
movs r0, 0
@ -2436,7 +2436,7 @@ _0800C864:
ldr r0, _0800C898
strh r2, [r0]
adds r0, r1, 0
bl sub_80AEFA8
bl m4aSongNumStart
strh r4, [r6]
b _0800C8A2
.align 2, 0
@ -2503,10 +2503,10 @@ _0800C8F0:
ldr r0, [r0]
ldrh r2, [r4, 0x4]
movs r1, 0xFF
bl sub_80AFF50
bl m4aMPlayVolumeControl
b _0800C926
.align 2, 0
_0800C918: .4byte gUnknown_9E8665C
_0800C918: .4byte gMPlayTable
_0800C91C:
strh r0, [r4]
mov r1, r8
@ -2579,8 +2579,8 @@ _0800C9A8:
strh r0, [r4]
_0800C9AC:
ldr r0, _0800C9C8
bl sub_80AF7C0
bl sub_80AF5AC
bl m4aMPlayStop
bl m4aSoundVSyncOff
cmp r5, 0
beq _0800C9BE
bl sub_800B5F0
@ -2599,7 +2599,7 @@ sub_800C9CC:
bl sub_800B620
lsls r0, 24
lsrs r4, r0, 24
bl sub_80AF628
bl m4aSoundVSyncOn
ldr r0, _0800CA08
ldrh r0, [r0]
cmp r0, 0
@ -2620,7 +2620,7 @@ sub_800C9CC:
cmp r0, 0
beq _0800CA1C
ldrh r0, [r2]
bl sub_80AEFA8
bl m4aSongNumStart
b _0800CA22
.align 2, 0
_0800CA08: .4byte gUnknown_202D690
@ -2630,7 +2630,7 @@ _0800CA14: .4byte gUnknown_202D688
_0800CA18: .4byte gUnknown_202D694
_0800CA1C:
ldr r0, _0800CA30
bl sub_80AF108
bl m4aMPlayContinue
_0800CA22:
cmp r4, 0
beq _0800CA2A
@ -2762,7 +2762,7 @@ sub_800CAE0:
ldrh r0, [r0, 0x4]
bx lr
.align 2, 0
_0800CAEC: .4byte gUnknown_9E866BC
_0800CAEC: .4byte gSongTable
thumb_func_end sub_800CAE0
thumb_func_start sub_800CAF0
@ -2782,7 +2782,7 @@ sub_800CAF0:
movs r0, 0x1
b _0800CB12
.align 2, 0
_0800CB0C: .4byte gUnknown_9E8665C
_0800CB0C: .4byte gMPlayTable
_0800CB10:
movs r0, 0
_0800CB12:

View File

@ -7661,7 +7661,7 @@ sub_8010960:
bl xxx_call_update_bg_sound_input
bl sub_8011860
movs r0, 0
bl sub_8004D8C
bl ResetSprites
pop {r4-r6}
pop {r0}
bx r0
@ -9290,7 +9290,7 @@ sub_801169C:
bl xxx_call_update_bg_sound_input
bl sub_8011860
movs r0, 0
bl sub_8004D8C
bl ResetSprites
add sp, 0x8
pop {r4-r6}
pop {r0}

View File

@ -25,7 +25,7 @@ sub_8012A18:
bl sub_8009908
bl xxx_call_update_bg_sound_input
movs r0, 0
bl sub_8004D8C
bl ResetSprites
pop {r0}
bx r0
.align 2, 0
@ -4698,7 +4698,7 @@ _08014E10:
adds r4, r1, r0
b _08014F0C
.align 2, 0
_08014E20: .4byte gUnknown_202D3B8
_08014E20: .4byte gFileCache + 0x110
_08014E24:
adds r5, 0x1
movs r0, 0
@ -17484,7 +17484,7 @@ sub_801B3C0:
push {r4,r5,lr}
adds r5, r0, 0
movs r0, 0x1
bl sub_8004D8C
bl ResetSprites
ldr r4, _0801B40C
movs r0, 0x94
movs r1, 0x8
@ -19806,7 +19806,7 @@ sub_801C620:
lsls r4, 24
lsrs r4, 24
movs r0, 0x1
bl sub_8004D8C
bl ResetSprites
ldr r5, _0801C670
movs r0, 0x94
movs r1, 0x8
@ -26163,7 +26163,7 @@ sub_801F808:
push {r4,r5,lr}
adds r4, r0, 0
movs r0, 0x1
bl sub_8004D8C
bl ResetSprites
ldr r5, _0801F88C
movs r0, 0xD4
movs r1, 0x8
@ -41273,7 +41273,7 @@ _0802706E:
sub_8027074:
push {r4,lr}
movs r0, 0
bl sub_8004D8C
bl ResetSprites
ldr r4, _080270A0
movs r0, 0xF0
lsls r0, 1
@ -73146,7 +73146,7 @@ sub_8036FDC:
movs r2, 0x1
bl sub_800641C
movs r0, 0
bl sub_8004D8C
bl ResetSprites
ldr r5, _080370C0
ldr r0, [r5]
cmp r0, 0
@ -73610,7 +73610,7 @@ sub_80373C4:
bl sub_8009908
bl xxx_call_update_bg_sound_input
movs r0, 0
bl sub_8004D8C
bl ResetSprites
pop {r0}
bx r0
thumb_func_end sub_80373C4
@ -76245,7 +76245,7 @@ sub_8038830:
add r0, r12
str r5, [r0]
movs r0, 0
bl sub_8004D8C
bl ResetSprites
pop {r4,r5}
pop {r0}
bx r0
@ -86812,10 +86812,10 @@ _0803DB54:
.align 2, 0
_0803DB84: .4byte gUnknown_80F60F8
_0803DB88: .4byte gUnknown_83B0000
_0803DB8C: .4byte gUnknown_202EC88
_0803DB8C: .4byte gDungeonNameBannerPalette
_0803DB90: .4byte gUnknown_80F6100
_0803DB94: .4byte gUnknown_202EC8C
_0803DB98: .4byte gUnknown_202EC90
_0803DB94: .4byte gDungeonNameBannerFontFile
_0803DB98: .4byte gDungeonNameBannerFont
_0803DB9C: .4byte 0x06000140
_0803DBA0: .4byte gUnknown_203B418
_0803DBA4: .4byte 0x00000645
@ -86862,7 +86862,7 @@ _0803DBEA:
.align 2, 0
_0803DC08: .4byte gUnknown_80F6118
_0803DC0C: .4byte gUnknown_20274A5
_0803DC10: .4byte gUnknown_202EC8C
_0803DC10: .4byte gDungeonNameBannerFontFile
thumb_func_end ShowDungeonNameBanner
thumb_func_start sub_803DC14
@ -87273,7 +87273,7 @@ sub_803DEC8:
adds r1, r5, r0
b _0803DF56
.align 2, 0
_0803DEFC: .4byte gUnknown_202EC8C
_0803DEFC: .4byte gDungeonNameBannerFontFile
_0803DF00: .4byte 0xffff0800
_0803DF04: .4byte 0x000007fe
_0803DF08:
@ -87287,7 +87287,7 @@ _0803DF08:
adds r0, r2, r0
b _0803DF3A
.align 2, 0
_0803DF1C: .4byte gUnknown_202EC90
_0803DF1C: .4byte gDungeonNameBannerFont
_0803DF20:
lsls r0, r1, 3
adds r0, r5
@ -88114,7 +88114,7 @@ _0803E5A2:
bl sub_8011860
bl sub_8040B60
movs r0, 0
bl sub_8004D8C
bl ResetSprites
movs r0, 0
bl nullsub_10
ldr r1, _0803E664
@ -88186,7 +88186,7 @@ sub_803E668:
strb r1, [r0]
bl sub_8011860
movs r0, 0
bl sub_8004D8C
bl ResetSprites
movs r0, 0
bl nullsub_10
ldr r0, [r4]
@ -88555,7 +88555,7 @@ _0803E9B4: .4byte 0x00018215
_0803E9B8: .4byte 0x0001c06c
_0803E9BC: .4byte gUnknown_202EE8C
_0803E9C0: .4byte gUnknown_202ECA4
_0803E9C4: .4byte gUnknown_202EC88
_0803E9C4: .4byte gDungeonNameBannerPalette
_0803E9C8: .4byte gUnknown_202D058
_0803E9CC: .4byte 0x000181e4
thumb_func_end sub_803E874
@ -99078,7 +99078,7 @@ _08043984: .4byte 0xff00ffff
_08043988: .4byte gUnknown_202EDC8
_0804398C: .4byte gUnknown_81006A4
_08043990: .4byte 0x00000222
_08043994: .4byte gUnknown_202EC88
_08043994: .4byte gDungeonNameBannerPalette
_08043998: .4byte gUnknown_203B40C
_0804399C: .4byte gUnknown_203B41C
_080439A0:
@ -104471,7 +104471,7 @@ sub_8046298:
ldrb r0, [r0, 0xD]
bx lr
.align 2, 0
_080462A8: .4byte gUnknown_20389A4
_080462A8: .4byte gItemParametersFile + 4
thumb_func_end sub_8046298
thumb_func_start sub_80462AC
@ -245668,8 +245668,8 @@ _0808CDE4: .4byte gUnknown_203B45C
_0808CDE8: .4byte gUnknown_202F400
_0808CDEC: .4byte gUnknown_81075F4
_0808CDF0: .4byte gUnknown_8300500
_0808CDF4: .4byte gUnknown_202F3E4
_0808CDF8: .4byte gUnknown_202F3E0
_0808CDF4: .4byte gMonsterParametersFile
_0808CDF8: .4byte gMonsterParameters
_0808CDFC: .4byte gUnknown_20384E8
thumb_func_end LoadMonsterParameters
@ -245907,7 +245907,7 @@ _0808CFB8:
pop {r0}
bx r0
.align 2, 0
_0808CFC8: .4byte gUnknown_202F3E0
_0808CFC8: .4byte gMonsterParameters
_0808CFCC: .4byte gUnknown_203B45C
thumb_func_end sub_808CE74
@ -246197,7 +246197,7 @@ sub_808D1DC:
bne _0808D238
b _0808D268
.align 2, 0
_0808D204: .4byte gUnknown_202F3E0
_0808D204: .4byte gMonsterParameters
_0808D208: .4byte gUnknown_203B468
_0808D20C:
ldr r0, [r7]
@ -246278,7 +246278,7 @@ sub_808D278:
bne _0808D2AA
b _0808D2DA
.align 2, 0
_0808D29C: .4byte gUnknown_202F3E0
_0808D29C: .4byte gMonsterParameters
_0808D2A0: .4byte gUnknown_203B468
_0808D2A4:
ldr r0, [r7]
@ -247194,7 +247194,7 @@ sub_808D8BC:
pop {r0}
bx r0
.align 2, 0
_0808D8DC: .4byte gUnknown_202F3E0
_0808D8DC: .4byte gMonsterParameters
thumb_func_end sub_808D8BC
thumb_func_start sub_808D8E0
@ -247216,7 +247216,7 @@ sub_808D8E0:
bx r0
.align 2, 0
_0808D900: .4byte gUnknown_8107600
_0808D904: .4byte gUnknown_202F3E0
_0808D904: .4byte gMonsterParameters
thumb_func_end sub_808D8E0
thumb_func_start sub_808D908
@ -247238,7 +247238,7 @@ sub_808D908:
bx r0
.align 2, 0
_0808D928: .4byte gUnknown_8107608
_0808D92C: .4byte gUnknown_202F3E0
_0808D92C: .4byte gMonsterParameters
thumb_func_end sub_808D908
thumb_func_start sub_808D930
@ -247287,7 +247287,7 @@ _0808D986:
bx r0
.align 2, 0
_0808D98C: .4byte gUnknown_8107638
_0808D990: .4byte gUnknown_202F3E0
_0808D990: .4byte gMonsterParameters
thumb_func_end sub_808D930
thumb_func_start sub_808D994
@ -247303,7 +247303,7 @@ sub_808D994:
ldr r0, [r1]
bx lr
.align 2, 0
_0808D9A8: .4byte gUnknown_202F3E0
_0808D9A8: .4byte gMonsterParameters
thumb_func_end sub_808D994
thumb_func_start sub_808D9AC
@ -247468,7 +247468,7 @@ sub_808DAB4:
ldr r0, [r1, 0x4]
bx lr
.align 2, 0
_0808DAC8: .4byte gUnknown_202F3E0
_0808DAC8: .4byte gMonsterParameters
thumb_func_end sub_808DAB4
thumb_func_start sub_808DACC
@ -247484,7 +247484,7 @@ sub_808DACC:
ldrb r0, [r1, 0x9]
bx lr
.align 2, 0
_0808DAE0: .4byte gUnknown_202F3E0
_0808DAE0: .4byte gMonsterParameters
thumb_func_end sub_808DACC
thumb_func_start sub_808DAE4
@ -247500,7 +247500,7 @@ sub_808DAE4:
ldrb r0, [r1, 0x19]
bx lr
.align 2, 0
_0808DAF8: .4byte gUnknown_202F3E0
_0808DAF8: .4byte gMonsterParameters
thumb_func_end sub_808DAE4
thumb_func_start sub_808DAFC
@ -247516,7 +247516,7 @@ sub_808DAFC:
ldr r0, [r1, 0xC]
bx lr
.align 2, 0
_0808DB10: .4byte gUnknown_202F3E0
_0808DB10: .4byte gMonsterParameters
thumb_func_end sub_808DAFC
thumb_func_start sub_808DB14
@ -247532,7 +247532,7 @@ sub_808DB14:
ldrb r0, [r1, 0x15]
bx lr
.align 2, 0
_0808DB28: .4byte gUnknown_202F3E0
_0808DB28: .4byte gMonsterParameters
thumb_func_end sub_808DB14
thumb_func_start sub_808DB2C
@ -247550,7 +247550,7 @@ sub_808DB2C:
lsrs r0, 24
bx lr
.align 2, 0
_0808DB44: .4byte gUnknown_202F3E0
_0808DB44: .4byte gMonsterParameters
thumb_func_end sub_808DB2C
thumb_func_start sub_808DB48
@ -247566,7 +247566,7 @@ sub_808DB48:
ldrb r0, [r1, 0x1C]
bx lr
.align 2, 0
_0808DB5C: .4byte gUnknown_202F3E0
_0808DB5C: .4byte gMonsterParameters
thumb_func_end sub_808DB48
thumb_func_start sub_808DB60
@ -247582,7 +247582,7 @@ sub_808DB60:
ldrb r0, [r1, 0x1D]
bx lr
.align 2, 0
_0808DB74: .4byte gUnknown_202F3E0
_0808DB74: .4byte gMonsterParameters
thumb_func_end sub_808DB60
thumb_func_start sub_808DB78
@ -247598,7 +247598,7 @@ sub_808DB78:
ldrh r0, [r1, 0x2C]
bx lr
.align 2, 0
_0808DB8C: .4byte gUnknown_202F3E0
_0808DB8C: .4byte gMonsterParameters
thumb_func_end sub_808DB78
thumb_func_start sub_808DB90
@ -247614,7 +247614,7 @@ sub_808DB90:
ldrh r0, [r1, 0x2E]
bx lr
.align 2, 0
_0808DBA4: .4byte gUnknown_202F3E0
_0808DBA4: .4byte gMonsterParameters
thumb_func_end sub_808DB90
thumb_func_start sub_808DBA8
@ -247630,7 +247630,7 @@ sub_808DBA8:
ldrb r0, [r1, 0x16]
bx lr
.align 2, 0
_0808DBBC: .4byte gUnknown_202F3E0
_0808DBBC: .4byte gMonsterParameters
thumb_func_end sub_808DBA8
thumb_func_start sub_808DBC0
@ -247646,7 +247646,7 @@ sub_808DBC0:
ldrh r0, [r1, 0x1E]
bx lr
.align 2, 0
_0808DBD4: .4byte gUnknown_202F3E0
_0808DBD4: .4byte gMonsterParameters
thumb_func_end sub_808DBC0
thumb_func_start sub_808DBD8
@ -247663,7 +247663,7 @@ sub_808DBD8:
ldrb r0, [r1]
bx lr
.align 2, 0
_0808DBF0: .4byte gUnknown_202F3E0
_0808DBF0: .4byte gMonsterParameters
thumb_func_end sub_808DBD8
thumb_func_start sub_808DBF4
@ -247679,7 +247679,7 @@ sub_808DBF4:
ldrb r0, [r1, 0x12]
bx lr
.align 2, 0
_0808DC08: .4byte gUnknown_202F3E0
_0808DC08: .4byte gMonsterParameters
thumb_func_end sub_808DBF4
thumb_func_start sub_808DC0C
@ -247696,7 +247696,7 @@ sub_808DC0C:
ldrsh r0, [r1, r2]
bx lr
.align 2, 0
_0808DC24: .4byte gUnknown_202F3E0
_0808DC24: .4byte gMonsterParameters
thumb_func_end sub_808DC0C
thumb_func_start sub_808DC28
@ -247715,7 +247715,7 @@ sub_808DC28:
ldrh r0, [r2]
bx lr
.align 2, 0
_0808DC44: .4byte gUnknown_202F3E0
_0808DC44: .4byte gMonsterParameters
thumb_func_end sub_808DC28
thumb_func_start sub_808DC48
@ -247734,7 +247734,7 @@ sub_808DC48:
ldrh r0, [r2]
bx lr
.align 2, 0
_0808DC64: .4byte gUnknown_202F3E0
_0808DC64: .4byte gMonsterParameters
thumb_func_end sub_808DC48
thumb_func_start sub_808DC68
@ -247752,7 +247752,7 @@ sub_808DC68:
ldrb r0, [r2]
bx lr
.align 2, 0
_0808DC80: .4byte gUnknown_202F3E0
_0808DC80: .4byte gMonsterParameters
thumb_func_end sub_808DC68
thumb_func_start sub_808DC84
@ -247770,7 +247770,7 @@ sub_808DC84:
ldrb r0, [r2]
bx lr
.align 2, 0
_0808DC9C: .4byte gUnknown_202F3E0
_0808DC9C: .4byte gMonsterParameters
thumb_func_end sub_808DC84
thumb_func_start sub_808DCA0
@ -247790,7 +247790,7 @@ sub_808DCA0:
ldrsh r0, [r2, r1]
bx lr
.align 2, 0
_0808DCBC: .4byte gUnknown_202F3E0
_0808DCBC: .4byte gMonsterParameters
thumb_func_end sub_808DCA0
thumb_func_start sub_808DCC0
@ -247808,7 +247808,7 @@ sub_808DCC0:
ldrsh r0, [r1, r2]
bx lr
.align 2, 0
_0808DCD8: .4byte gUnknown_202F3E0
_0808DCD8: .4byte gMonsterParameters
thumb_func_end sub_808DCC0
thumb_func_start sub_808DCDC
@ -247828,7 +247828,7 @@ sub_808DCDC:
ldrsh r0, [r2, r1]
bx lr
.align 2, 0
_0808DCF8: .4byte gUnknown_202F3E0
_0808DCF8: .4byte gMonsterParameters
thumb_func_end sub_808DCDC
thumb_func_start sub_808DCFC
@ -247845,7 +247845,7 @@ sub_808DCFC:
ldrsh r0, [r1, r2]
bx lr
.align 2, 0
_0808DD14: .4byte gUnknown_202F3E0
_0808DD14: .4byte gMonsterParameters
thumb_func_end sub_808DCFC
thumb_func_start sub_808DD18
@ -247871,7 +247871,7 @@ sub_808DD18:
pop {r1}
bx r1
.align 2, 0
_0808DD44: .4byte gUnknown_202F3E0
_0808DD44: .4byte gMonsterParameters
thumb_func_end sub_808DD18
thumb_func_start sub_808DD48
@ -247890,7 +247890,7 @@ sub_808DD48:
str r3, [r1, 0x4]
bx lr
.align 2, 0
_0808DD64: .4byte gUnknown_202F3E0
_0808DD64: .4byte gMonsterParameters
thumb_func_end sub_808DD48
thumb_func_start sub_808DD68
@ -247909,7 +247909,7 @@ sub_808DD68:
ldrb r0, [r0, 0x8]
b _0808DD8A
.align 2, 0
_0808DD84: .4byte gUnknown_202F3E0
_0808DD84: .4byte gMonsterParameters
_0808DD88:
movs r0, 0xA
_0808DD8A:
@ -247940,7 +247940,7 @@ sub_808DD90:
bl OpenFile
b _0808DDCA
.align 2, 0
_0808DDBC: .4byte gUnknown_202F3E0
_0808DDBC: .4byte gMonsterParameters
_0808DDC0: .4byte gUnknown_8107684
_0808DDC4: .4byte gUnknown_8510000
_0808DDC8:
@ -247974,7 +247974,7 @@ sub_808DDD0:
bl OpenFileAndGetFileDataPtr
b _0808DE0A
.align 2, 0
_0808DDFC: .4byte gUnknown_202F3E0
_0808DDFC: .4byte gMonsterParameters
_0808DE00: .4byte gUnknown_8107684
_0808DE04: .4byte gUnknown_8510000
_0808DE08:
@ -248001,7 +248001,7 @@ sub_808DE10:
ands r0, r1
bx lr
.align 2, 0
_0808DE2C: .4byte gUnknown_202F3E0
_0808DE2C: .4byte gMonsterParameters
thumb_func_end sub_808DE10
thumb_func_start sub_808DE30
@ -253777,8 +253777,8 @@ _080909B8: .4byte gUnknown_203B460
_080909BC: .4byte gUnknown_20389A8
_080909C0: .4byte gUnknown_8109764
_080909C4: .4byte gUnknown_8300500
_080909C8: .4byte gUnknown_20389A0
_080909CC: .4byte gUnknown_20389A4
_080909C8: .4byte gItemParametersFile
_080909CC: .4byte gItemParametersFile + 4
thumb_func_end sub_8090998
thumb_func_start sub_80909D0
@ -254085,7 +254085,7 @@ sub_8090BD0:
ldrb r0, [r0, 0xC]
bx lr
.align 2, 0
_08090BE0: .4byte gUnknown_20389A4
_08090BE0: .4byte gItemParametersFile + 4
thumb_func_end sub_8090BD0
thumb_func_start sub_8090BE4
@ -254112,7 +254112,7 @@ _08090BF6:
ldr r0, [r0, 0x4]
b _08090C24
.align 2, 0
_08090C10: .4byte gUnknown_20389A4
_08090C10: .4byte gItemParametersFile + 4
_08090C14:
ldrb r0, [r4, 0x2]
ldr r1, _08090C2C
@ -254127,7 +254127,7 @@ _08090C24:
pop {r1}
bx r1
.align 2, 0
_08090C2C: .4byte gUnknown_20389A4
_08090C2C: .4byte gItemParametersFile + 4
thumb_func_end sub_8090BE4
thumb_func_start sub_8090C30
@ -254154,7 +254154,7 @@ _08090C42:
ldr r0, [r0, 0x8]
b _08090C70
.align 2, 0
_08090C5C: .4byte gUnknown_20389A4
_08090C5C: .4byte gItemParametersFile + 4
_08090C60:
ldrb r0, [r4, 0x2]
ldr r1, _08090C78
@ -254169,7 +254169,7 @@ _08090C70:
pop {r1}
bx r1
.align 2, 0
_08090C78: .4byte gUnknown_20389A4
_08090C78: .4byte gItemParametersFile + 4
thumb_func_end sub_8090C30
thumb_func_start sub_8090C7C
@ -254197,7 +254197,7 @@ _08090C90:
ldr r0, [r0, 0x4]
b _08090CC0
.align 2, 0
_08090CAC: .4byte gUnknown_20389A4
_08090CAC: .4byte gItemParametersFile + 4
_08090CB0:
ldrb r0, [r4, 0x2]
ldr r1, _08090CC8
@ -254212,7 +254212,7 @@ _08090CC0:
pop {r1}
bx r1
.align 2, 0
_08090CC8: .4byte gUnknown_20389A4
_08090CC8: .4byte gItemParametersFile + 4
thumb_func_end sub_8090C7C
thumb_func_start sub_8090CCC
@ -254240,7 +254240,7 @@ _08090CE0:
ldr r0, [r0, 0x8]
b _08090D10
.align 2, 0
_08090CFC: .4byte gUnknown_20389A4
_08090CFC: .4byte gItemParametersFile + 4
_08090D00:
ldrb r0, [r4, 0x2]
ldr r1, _08090D18
@ -254255,7 +254255,7 @@ _08090D10:
pop {r1}
bx r1
.align 2, 0
_08090D18: .4byte gUnknown_20389A4
_08090D18: .4byte gItemParametersFile + 4
thumb_func_end sub_8090CCC
thumb_func_start sub_8090D1C
@ -254268,7 +254268,7 @@ sub_8090D1C:
ldr r0, [r0, 0x4]
bx lr
.align 2, 0
_08090D2C: .4byte gUnknown_20389A4
_08090D2C: .4byte gItemParametersFile + 4
thumb_func_end sub_8090D1C
thumb_func_start sub_8090D30
@ -254281,7 +254281,7 @@ sub_8090D30:
ldr r0, [r0, 0x8]
bx lr
.align 2, 0
_08090D40: .4byte gUnknown_20389A4
_08090D40: .4byte gItemParametersFile + 4
thumb_func_end sub_8090D30
thumb_func_start sub_8090D44
@ -254294,7 +254294,7 @@ sub_8090D44:
ldrb r0, [r0, 0x1A]
bx lr
.align 2, 0
_08090D54: .4byte gUnknown_20389A4
_08090D54: .4byte gItemParametersFile + 4
thumb_func_end sub_8090D44
thumb_func_start sub_8090D58
@ -254307,7 +254307,7 @@ sub_8090D58:
ldrb r0, [r0, 0x1D]
bx lr
.align 2, 0
_08090D68: .4byte gUnknown_20389A4
_08090D68: .4byte gItemParametersFile + 4
thumb_func_end sub_8090D58
thumb_func_start sub_8090D6C
@ -254320,7 +254320,7 @@ sub_8090D6C:
ldrb r0, [r0, 0x1E]
bx lr
.align 2, 0
_08090D7C: .4byte gUnknown_20389A4
_08090D7C: .4byte gItemParametersFile + 4
thumb_func_end sub_8090D6C
thumb_func_start sub_8090D80
@ -254335,7 +254335,7 @@ sub_8090D80:
ldrb r0, [r0]
bx lr
.align 2, 0
_08090D94: .4byte gUnknown_20389A4
_08090D94: .4byte gItemParametersFile + 4
thumb_func_end sub_8090D80
thumb_func_start sub_8090D98
@ -254348,7 +254348,7 @@ sub_8090D98:
ldr r0, [r0, 0x10]
bx lr
.align 2, 0
_08090DA8: .4byte gUnknown_20389A4
_08090DA8: .4byte gItemParametersFile + 4
thumb_func_end sub_8090D98
thumb_func_start sub_8090DAC
@ -254363,7 +254363,7 @@ sub_8090DAC:
ldrb r0, [r0]
bx lr
.align 2, 0
_08090DC0: .4byte gUnknown_20389A4
_08090DC0: .4byte gItemParametersFile + 4
thumb_func_end sub_8090DAC
thumb_func_start sub_8090DC4
@ -254404,7 +254404,7 @@ sub_8090DC4:
pop {r0}
bx r0
.align 2, 0
_08090E10: .4byte gUnknown_20389A4
_08090E10: .4byte gItemParametersFile + 4
thumb_func_end sub_8090DC4
thumb_func_start sub_8090E14
@ -254453,7 +254453,7 @@ _08090E50:
b _08090EC4
.align 2, 0
_08090E68: .4byte gUnknown_8109770
_08090E6C: .4byte gUnknown_20389A4
_08090E6C: .4byte gItemParametersFile + 4
_08090E70:
ldr r1, _08090E88
ldrb r0, [r5, 0x2]
@ -254467,7 +254467,7 @@ _08090E70:
b _08090EC4
.align 2, 0
_08090E88: .4byte gUnknown_8109778
_08090E8C: .4byte gUnknown_20389A4
_08090E8C: .4byte gItemParametersFile + 4
_08090E90:
ldrb r0, [r5, 0x2]
cmp r0, 0x69
@ -254544,7 +254544,7 @@ _08090F14:
bl sub_8090F58
b _08090F50
.align 2, 0
_08090F2C: .4byte gUnknown_20389A4
_08090F2C: .4byte gItemParametersFile + 4
_08090F30: .4byte gUnknown_8109784
_08090F34: .4byte gUnknown_810978C
_08090F38:
@ -255209,7 +255209,7 @@ sub_80913CC:
ldrh r0, [r0, 0x18]
bx lr
.align 2, 0
_080913DC: .4byte gUnknown_20389A4
_080913DC: .4byte gItemParametersFile + 4
thumb_func_end sub_80913CC
thumb_func_start sub_80913E0
@ -258154,7 +258154,7 @@ LoadWazaParameters:
.align 2, 0
_08092868: .4byte gUnknown_81098D0
_0809286C: .4byte gUnknown_8300500
_08092870: .4byte gUnknown_2038C64
_08092870: .4byte gWazaParametersFile
_08092874: .4byte gUnknown_2038C68
_08092878: .4byte gUnknown_2038C6C
thumb_func_end LoadWazaParameters
@ -271490,7 +271490,7 @@ _080988F8:
bl GroundEffect_Action
bl nullsub_105
bl sub_809B474
bl sub_80A2380
bl GroundScript_Unlock
bl sub_809D25C
bl sub_80A59DC
bl sub_809B614
@ -271783,7 +271783,7 @@ _08098BD2:
sub_8098BDC:
push {lr}
bl sub_809B57C
bl sub_80A2380
bl GroundScript_Unlock
bl sub_809D25C
bl sub_80A59DC
bl sub_809B614
@ -273046,7 +273046,7 @@ _080995AE:
_08099604:
bl xxx_call_update_bg_sound_input
movs r0, 0
bl sub_8004D8C
bl ResetSprites
mov r2, r9
cmp r2, 0
beq _08099524
@ -279959,7 +279959,7 @@ sub_809CBBC:
b _0809CC4A
.align 2, 0
_0809CC0C: .4byte gUnknown_81163E4
_0809CC10: .4byte gUnknown_20389A4
_0809CC10: .4byte gItemParametersFile + 4
_0809CC14: .4byte gUnknown_203B460
_0809CC18: .4byte 0x0001869f
_0809CC1C:
@ -284745,28 +284745,28 @@ _0809F3DC: .4byte gUnknown_2039A32
_0809F3E0:
adds r0, r6, 0
adds r1, r5, 0
bl sub_80A7988
bl GroundLives_Cancel
adds r0, r6, 0
adds r1, r5, 0
bl sub_80ABC5C
bl GroundObject_Cancel
adds r0, r6, 0
adds r1, r5, 0
bl sub_80ACC98
bl GroundEffect_Cancel
b _0809F41E
_0809F3FA:
adds r0, r6, 0
adds r1, r5, 0
bl sub_80A7988
bl GroundLives_Cancel
bl _0809EAE0
_0809F406:
adds r0, r6, 0
adds r1, r5, 0
bl sub_80ABC5C
bl GroundObject_Cancel
bl _0809EAE0
_0809F412:
adds r0, r6, 0
adds r1, r5, 0
bl sub_80ACC98
bl GroundEffect_Cancel
bl _0809EAE0
_0809F41E:
adds r0, r6, 0
@ -284777,10 +284777,10 @@ _0809F42A:
bl sub_80A79FC
bl _0809EAE0
_0809F432:
bl sub_80ABCCC
bl GroundObject_CancelBlank
bl _0809EAE0
_0809F43A:
bl sub_80ACD08
bl GroundEffect_CancelBlank
bl _0809EAE0
_0809F442:
mov r2, r9
@ -290448,7 +290448,7 @@ _080A233A:
b _080A236A
_080A2346:
movs r0, 0
bl sub_80A6C88
bl GroundSprite_ExtendPaletteDelete
b _080A236A
_080A234E:
movs r0, 0
@ -290478,8 +290478,8 @@ _080A236C:
bx r1
thumb_func_end sub_80A14E8
thumb_func_start sub_80A2380
sub_80A2380:
thumb_func_start GroundScript_Unlock
GroundScript_Unlock:
push {r4-r7,lr}
ldr r1, _080A241C
ldrb r0, [r1]
@ -290557,7 +290557,7 @@ _080A241C: .4byte gUnknown_2039A36
_080A2420: .4byte gUnknown_2039A38
_080A2424: .4byte gUnknown_8116848
_080A2428: .4byte gUnknown_2039AC0
thumb_func_end sub_80A2380
thumb_func_end GroundScript_Unlock
thumb_func_start sub_80A242C
sub_80A242C:
@ -299178,7 +299178,7 @@ _080A6434:
_080A6444:
strh r0, [r5, 0xA]
movs r0, 0x1
bl sub_8004D8C
bl ResetSprites
movs r0, 0x1
bl nullsub_10
pop {r3,r4}
@ -299342,7 +299342,7 @@ sub_80A658C:
push {r4,lr}
bl sub_800DB7C
movs r0, 0
bl sub_8004D8C
bl ResetSprites
movs r0, 0
bl nullsub_10
bl sub_8005180
@ -299986,7 +299986,7 @@ sub_80A69FC:
cmp r4, 0
blt _080A6A7A
adds r0, r6, 0
bl sub_80A6C88
bl GroundSprite_ExtendPaletteDelete
movs r0, 0
str r0, [r5, 0x8]
str r0, [r5]
@ -300303,8 +300303,8 @@ _080A6C78:
bx r0
thumb_func_end GroundSprite_ExtendPaletteAdd
thumb_func_start sub_80A6C88
sub_80A6C88:
thumb_func_start GroundSprite_ExtendPaletteDelete
GroundSprite_ExtendPaletteDelete:
push {r4-r6,lr}
adds r2, r0, 0
cmp r2, 0
@ -300360,7 +300360,7 @@ _080A6CE6:
.align 2, 0
_080A6CEC: .4byte gUnknown_3001B7C
_080A6CF0: .4byte gUnknown_81178C0
thumb_func_end sub_80A6C88
thumb_func_end GroundSprite_ExtendPaletteDelete
thumb_func_start sub_80A6CF4
sub_80A6CF4:
@ -300572,7 +300572,7 @@ _080A6E56:
sub_80A6E68:
push {lr}
movs r0, 0
bl sub_8004D8C
bl ResetSprites
movs r0, 0
bl nullsub_10
bl sub_800E970
@ -301931,7 +301931,7 @@ _080A787C:
cmp r0, r6
beq _080A788A
adds r0, r1, 0
bl sub_80A8684
bl GroundLives_Delete
_080A788A:
adds r0, r5, 0
movs r1, 0x80
@ -302062,8 +302062,8 @@ _080A7980: .4byte gUnknown_811808C
_080A7984: .4byte gUnknown_8118098
thumb_func_end GroundLives_Select
thumb_func_start sub_80A7988
sub_80A7988:
thumb_func_start GroundLives_Cancel
GroundLives_Cancel:
push {r4-r7,lr}
mov r7, r8
push {r7}
@ -302101,7 +302101,7 @@ _080A79B2:
bne _080A79D4
_080A79CE:
adds r0, r1, 0
bl sub_80A8684
bl GroundLives_Delete
_080A79D4:
adds r0, r6, 0
movs r1, 0x80
@ -302121,7 +302121,7 @@ _080A79D4:
.align 2, 0
_080A79F4: .4byte gUnknown_81180BC
_080A79F8: .4byte gUnknown_3001B84
thumb_func_end sub_80A7988
thumb_func_end GroundLives_Cancel
thumb_func_start sub_80A79FC
sub_80A79FC:
@ -302164,7 +302164,7 @@ _080A7A20:
cmp r0, 0
bne _080A7A50
adds r0, r6, 0
bl sub_80A8684
bl GroundLives_Delete
_080A7A50:
adds r0, r6, 0x1
lsls r0, 16
@ -303749,8 +303749,8 @@ _080A8674:
bx r1
thumb_func_end GroundLives_Add
thumb_func_start sub_80A8684
sub_80A8684:
thumb_func_start GroundLives_Delete
GroundLives_Delete:
push {r4,lr}
adds r2, r0, 0
lsls r2, 16
@ -303780,7 +303780,7 @@ sub_80A8684:
_080A86BC: .4byte gUnknown_3001B84
_080A86C0: .4byte gUnknown_8118194
_080A86C4: .4byte 0x0000ffff
thumb_func_end sub_80A8684
thumb_func_end GroundLives_Delete
thumb_func_start sub_80A86C8
sub_80A86C8:
@ -309318,7 +309318,7 @@ _080AB278:
b _080AB44C
_080AB292:
mov r0, r9
bl sub_80A8684
bl GroundLives_Delete
b _080AB47C
.align 2, 0
_080AB29C: .4byte gUnknown_3001B84
@ -310631,8 +310631,8 @@ _080ABC54: .4byte gUnknown_81183E4
_080ABC58: .4byte gUnknown_81183F0
thumb_func_end GroundObject_Select
thumb_func_start sub_80ABC5C
sub_80ABC5C:
thumb_func_start GroundObject_Cancel
GroundObject_Cancel:
push {r4-r7,lr}
mov r7, r8
push {r7}
@ -310689,10 +310689,10 @@ _080ABCA6:
.align 2, 0
_080ABCC4: .4byte gUnknown_8118414
_080ABCC8: .4byte gUnknown_3001B88
thumb_func_end sub_80ABC5C
thumb_func_end GroundObject_Cancel
thumb_func_start sub_80ABCCC
sub_80ABCCC:
thumb_func_start GroundObject_CancelBlank
GroundObject_CancelBlank:
push {r4-r7,lr}
mov r7, r8
push {r7}
@ -310752,7 +310752,7 @@ _080ABD20:
.align 2, 0
_080ABD40: .4byte gUnknown_811842C
_080ABD44: .4byte gUnknown_3001B88
thumb_func_end sub_80ABCCC
thumb_func_end GroundObject_CancelBlank
thumb_func_start sub_80ABD48
sub_80ABD48:
@ -312792,7 +312792,7 @@ _080ACBE4:
cmp r0, r6
beq _080ACBF2
adds r0, r1, 0
bl sub_80AD080
bl GroundEffect_Delete
_080ACBF2:
adds r0, r5, 0
movs r1, 0x80
@ -312882,8 +312882,8 @@ _080ACC90: .4byte gUnknown_8118610
_080ACC94: .4byte gUnknown_811861C
thumb_func_end GroundEffect_Select
thumb_func_start sub_80ACC98
sub_80ACC98:
thumb_func_start GroundEffect_Cancel
GroundEffect_Cancel:
push {r4-r7,lr}
mov r7, r8
push {r7}
@ -312920,7 +312920,7 @@ _080ACCC0:
bne _080ACCE2
_080ACCDC:
adds r0, r1, 0
bl sub_80AD080
bl GroundEffect_Delete
_080ACCE2:
adds r0, r6, 0
movs r1, 0x80
@ -312940,10 +312940,10 @@ _080ACCE2:
.align 2, 0
_080ACD00: .4byte gUnknown_8118640
_080ACD04: .4byte gUnknown_3001B8C
thumb_func_end sub_80ACC98
thumb_func_end GroundEffect_Cancel
thumb_func_start sub_80ACD08
sub_80ACD08:
thumb_func_start GroundEffect_CancelBlank
GroundEffect_CancelBlank:
push {r4-r7,lr}
mov r7, r8
push {r7}
@ -312983,7 +312983,7 @@ _080ACD2C:
cmp r0, 0
bne _080ACD5C
adds r0, r6, 0
bl sub_80AD080
bl GroundEffect_Delete
_080ACD5C:
adds r0, r6, 0x1
lsls r0, 16
@ -313003,7 +313003,7 @@ _080ACD5C:
.align 2, 0
_080ACD7C: .4byte gUnknown_8118658
_080ACD80: .4byte gUnknown_3001B8C
thumb_func_end sub_80ACD08
thumb_func_end GroundEffect_CancelBlank
thumb_func_start sub_80ACD84
sub_80ACD84:
@ -313399,8 +313399,8 @@ _080AD078: .4byte gUnknown_812F1F8
_080AD07C: .4byte gUnknown_81186CC
thumb_func_end GroundEffect_Add
thumb_func_start sub_80AD080
sub_80AD080:
thumb_func_start GroundEffect_Delete
GroundEffect_Delete:
push {r4,lr}
adds r2, r0, 0
lsls r2, 16
@ -313432,7 +313432,7 @@ sub_80AD080:
_080AD0BC: .4byte gUnknown_3001B8C
_080AD0C0: .4byte gUnknown_81186D8
_080AD0C4: .4byte 0x0000ffff
thumb_func_end sub_80AD080
thumb_func_end GroundEffect_Delete
thumb_func_start sub_80AD0C8
sub_80AD0C8:
@ -314398,7 +314398,7 @@ _080AD72C:
cmp r0, 0x4
bne _080AD768
adds r0, r7, 0
bl sub_80AD080
bl GroundEffect_Delete
b _080AD78A
.align 2, 0
_080AD754: .4byte gUnknown_3001B8C

View File

@ -7,24 +7,24 @@
thumb_func_start InitInput
InitInput:
ldr r0, _08004840
ldr r0, =gUnknown_20255F0
movs r3, 0
movs r2, 0
strh r2, [r0]
strh r2, [r0, 0x2]
strh r2, [r0, 0x4]
strh r2, [r0, 0x6]
ldr r0, _08004844
ldr r0, =gUnknown_2025638
strh r2, [r0]
strh r2, [r0, 0x2]
strh r2, [r0, 0x4]
strh r2, [r0, 0x6]
ldr r1, _08004848
ldr r0, _0800484C
ldr r1, =gUnknown_202562C
ldr r0, =0x4a14c1
str r0, [r1]
ldr r0, _08004850
ldr r0, =gUnknown_2025600
str r2, [r0, 0x20]
ldr r1, _08004854
ldr r1, =0xffff
strh r1, [r0]
movs r1, 0x1
negs r1, r1
@ -46,25 +46,19 @@ InitInput:
strb r3, [r1]
adds r0, 0x29
strb r3, [r0]
ldr r0, _08004858
ldr r0, =gUnknown_2025668
strh r2, [r0]
strh r2, [r0, 0x2]
bx lr
.align 2, 0
_08004840: .4byte gUnknown_20255F0
_08004844: .4byte gUnknown_2025638
_08004848: .4byte gUnknown_202562C
_0800484C: .4byte 0x004a14c1
_08004850: .4byte gUnknown_2025600
_08004854: .4byte 0x0000ffff
_08004858: .4byte gUnknown_2025668
.pool
thumb_func_end InitInput
thumb_func_start sub_800485C
sub_800485C:
push {r4,r5,lr}
ldr r2, _080048A8
ldr r1, _080048AC
ldr r2, =gUnknown_2025638
ldr r1, =gUnknown_20255F0
adds r0, r2, 0
ldm r0!, {r3-r5}
stm r1!, {r3-r5}
@ -76,8 +70,8 @@ sub_800485C:
strh r0, [r2, 0x2]
strh r0, [r2, 0x4]
strh r0, [r2, 0x6]
ldr r0, _080048B0
ldr r1, _080048B4
ldr r0, =gUnknown_2025600
ldr r1, =0xffff
strh r1, [r0]
movs r1, 0x1
negs r1, r1
@ -101,10 +95,7 @@ sub_800485C:
pop {r0}
bx r0
.align 2, 0
_080048A8: .4byte gUnknown_2025638
_080048AC: .4byte gUnknown_20255F0
_080048B0: .4byte gUnknown_2025600
_080048B4: .4byte 0x0000ffff
.pool
thumb_func_end sub_800485C
thumb_func_start sub_80048B8
@ -145,49 +136,44 @@ sub_80048CC:
thumb_func_start sub_80048D0
sub_80048D0:
ldr r1, _080048E8
ldr r1, =gUnknown_20255F0
movs r0, 0
strh r0, [r1, 0x4]
ldr r1, _080048EC
ldr r1, =gUnknown_2025648
str r0, [r1, 0xC]
strh r0, [r1, 0x8]
ldr r1, _080048F0
ldr r0, _080048F4
ldr r1, =gUnknown_2025668
ldr r0, =0x3e7
strh r0, [r1]
strh r0, [r1, 0x2]
bx lr
.align 2, 0
_080048E8: .4byte gUnknown_20255F0
_080048EC: .4byte gUnknown_2025648
_080048F0: .4byte gUnknown_2025668
_080048F4: .4byte 0x000003e7
.pool
thumb_func_end sub_80048D0
thumb_func_start sub_80048F8
sub_80048F8:
ldr r0, _08004908
ldr r0, =gUnknown_20255F0
movs r1, 0
strh r1, [r0, 0x2]
ldr r0, _0800490C
ldr r0, =gUnknown_2025638
strh r1, [r0, 0x2]
ldr r0, _08004910
ldr r0, =gUnknown_2025648
strh r1, [r0, 0x2]
bx lr
.align 2, 0
_08004908: .4byte gUnknown_20255F0
_0800490C: .4byte gUnknown_2025638
_08004910: .4byte gUnknown_2025648
.pool
thumb_func_end sub_80048F8
thumb_func_start sub_8004914
sub_8004914:
ldr r0, _0800494C
ldr r0, =gUnknown_2025600
movs r1, 0x5
str r1, [r0, 0x20]
movs r2, 0
movs r1, 0
strh r1, [r0, 0x24]
ldr r1, _08004950
ldr r1, =0xffff
strh r1, [r0]
movs r1, 0x1
negs r1, r1
@ -209,15 +195,14 @@ sub_8004914:
strb r2, [r0]
bx lr
.align 2, 0
_0800494C: .4byte gUnknown_2025600
_08004950: .4byte 0x0000ffff
.pool
thumb_func_end sub_8004914
thumb_func_start UpdateInput
UpdateInput:
push {r4-r6,lr}
ldr r4, _08004998
ldr r5, _0800499C
ldr r4, =gUnknown_2025658
ldr r5, =gUnknown_2025648
adds r1, r4, 0
adds r0, r5, 0
ldm r0!, {r2,r3,r6}
@ -249,8 +234,7 @@ UpdateInput:
str r0, [r5, 0xC]
b _080049AC
.align 2, 0
_08004998: .4byte gUnknown_2025658
_0800499C: .4byte gUnknown_2025648
.pool
_080049A0:
strh r2, [r5, 0x8]
movs r0, 0x1
@ -260,7 +244,7 @@ _080049A8:
str r0, [r5, 0xC]
strh r0, [r5, 0x8]
_080049AC:
ldr r0, _080049C4
ldr r0, =gUnknown_2025648
ldr r2, [r0, 0xC]
adds r3, r0, 0
cmp r2, 0x1
@ -273,7 +257,7 @@ _080049AC:
strh r1, [r3, 0x4]
b _080049E0
.align 2, 0
_080049C4: .4byte gUnknown_2025648
.pool
_080049C8:
cmp r2, 0x30
bne _080049DC
@ -300,7 +284,7 @@ _080049E0:
lsrs r2, r0, 16
cmp r2, 0
beq _08004A0C
ldr r0, _08004A08
ldr r0, =gUnknown_2025668
ldrh r2, [r0]
movs r4, 0
ldrsh r1, [r0, r4]
@ -311,9 +295,9 @@ _080049E0:
strh r0, [r4]
b _08004A20
.align 2, 0
_08004A08: .4byte gUnknown_2025668
.pool
_08004A0C:
ldr r1, _08004A44
ldr r1, =gUnknown_2025668
ldrh r0, [r1]
subs r0, 0x2
lsls r0, 16
@ -343,7 +327,7 @@ _08004A20:
strh r0, [r4, 0x2]
b _08004A5E
.align 2, 0
_08004A44: .4byte gUnknown_2025668
.pool
_08004A48:
ldrh r0, [r4, 0x2]
subs r0, 0x2
@ -358,7 +342,7 @@ _08004A48:
_08004A5C:
strh r2, [r4, 0x2]
_08004A5E:
ldr r2, _08004A94
ldr r2, =gUnknown_2025638
ldrh r0, [r2]
ldrh r1, [r3]
orrs r0, r1
@ -375,9 +359,9 @@ _08004A5E:
ldrh r1, [r3, 0x6]
orrs r0, r1
strh r0, [r2, 0x6]
ldr r2, _08004A98
ldr r2, =gUnknown_202562C
ldrh r0, [r3]
ldr r1, _08004A9C
ldr r1, =0x054a1c41
orrs r0, r1
ldr r1, [r2]
muls r0, r1
@ -386,9 +370,7 @@ _08004A5E:
pop {r0}
bx r0
.align 2, 0
_08004A94: .4byte gUnknown_2025638
_08004A98: .4byte gUnknown_202562C
_08004A9C: .4byte 0x054a1c41
.pool
thumb_func_end UpdateInput
.align 2, 0 @ Don't pad with nop.

4625
asm/m4a.s

File diff suppressed because it is too large Load Diff

1647
asm/m4a_1.s Normal file

File diff suppressed because it is too large Load Diff

574
asm/m4a_3.s Normal file
View File

@ -0,0 +1,574 @@
.include "asm/macros.inc"
.include "constants/gba_constants.inc"
.include "constants/m4a_constants.inc"
.syntax unified
.text
thumb_func_start CgbSound
CgbSound:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x1C
ldr r0, =SOUND_INFO_PTR
ldr r0, [r0]
str r0, [sp, 0x4]
ldrb r0, [r0, 0xA]
cmp r0, 0
beq _080AFB00
subs r0, 0x1
ldr r1, [sp, 0x4]
strb r0, [r1, 0xA]
b _080AFB06
.pool
_080AFB00:
movs r0, 0xE
ldr r2, [sp, 0x4]
strb r0, [r2, 0xA]
_080AFB06:
movs r6, 0x1
ldr r0, [sp, 0x4]
ldr r4, [r0, 0x1C]
_080AFB0C:
ldrb r1, [r4]
movs r0, 0xC7
ands r0, r1
adds r2, r6, 0x1
mov r10, r2
movs r2, 0x40
adds r2, r4
mov r9, r2
cmp r0, 0
bne _080AFB22
b _080AFF0C
_080AFB22:
cmp r6, 0x2
beq _080AFB54
cmp r6, 0x2
bgt _080AFB30
cmp r6, 0x1
beq _080AFB36
b _080AFB8C
_080AFB30:
cmp r6, 0x3
beq _080AFB6C
b _080AFB8C
_080AFB36:
ldr r0, =REG_NR10
str r0, [sp, 0x8]
ldr r7, =REG_NR11
ldr r2, =REG_NR12
str r2, [sp, 0xC]
adds r0, 0x4
str r0, [sp, 0x10]
adds r2, 0x2
b _080AFB9C
.pool
_080AFB54:
ldr r0, =REG_NR10 + 1
str r0, [sp, 0x8]
ldr r7, =REG_NR21
ldr r2, =REG_NR22
b _080AFB94
.pool
_080AFB6C:
ldr r0, =REG_NR30
str r0, [sp, 0x8]
ldr r7, =REG_NR31
ldr r2, =REG_NR32
str r2, [sp, 0xC]
adds r0, 0x4
str r0, [sp, 0x10]
adds r2, 0x2
b _080AFB9C
.pool
_080AFB8C:
ldr r0, =REG_NR30 + 1
str r0, [sp, 0x8]
ldr r7, =REG_NR41
ldr r2, =REG_NR42
_080AFB94:
str r2, [sp, 0xC]
adds r0, 0xB
str r0, [sp, 0x10]
adds r2, 0x4
_080AFB9C:
str r2, [sp, 0x14]
ldr r0, [sp, 0x4]
ldrb r0, [r0, 0xA]
str r0, [sp]
ldr r2, [sp, 0xC]
ldrb r0, [r2]
mov r8, r0
adds r2, r1, 0
movs r0, 0x80
ands r0, r2
cmp r0, 0
beq _080AFC92
movs r3, 0x40
adds r0, r3, 0
ands r0, r2
lsls r0, 24
lsrs r5, r0, 24
adds r0, r6, 0x1
mov r10, r0
movs r1, 0x40
adds r1, r4
mov r9, r1
cmp r5, 0
bne _080AFCB6
movs r0, 0x3
strb r0, [r4]
strb r0, [r4, 0x1D]
adds r0, r4, 0
str r3, [sp, 0x18]
bl CgbModVol
ldr r3, [sp, 0x18]
cmp r6, 0x2
beq _080AFC04
cmp r6, 0x2
bgt _080AFBF8
cmp r6, 0x1
beq _080AFBFE
b _080AFC58
.pool
_080AFBF8:
cmp r6, 0x3
beq _080AFC10
b _080AFC58
_080AFBFE:
ldrb r0, [r4, 0x1F]
ldr r2, [sp, 0x8]
strb r0, [r2]
_080AFC04:
ldr r0, [r4, 0x24]
lsls r0, 6
ldrb r1, [r4, 0x1E]
adds r0, r1, r0
strb r0, [r7]
b _080AFC64
_080AFC10:
ldr r1, [r4, 0x24]
ldr r0, [r4, 0x28]
cmp r1, r0
beq _080AFC38
ldr r2, [sp, 0x8]
strb r3, [r2]
ldr r1, =REG_WAVE_RAM
ldr r2, [r4, 0x24]
ldr r0, [r2]
str r0, [r1]
adds r1, 0x4
ldr r0, [r2, 0x4]
str r0, [r1]
adds r1, 0x4
ldr r0, [r2, 0x8]
str r0, [r1]
adds r1, 0x4
ldr r0, [r2, 0xC]
str r0, [r1]
str r2, [r4, 0x28]
_080AFC38:
ldr r0, [sp, 0x8]
strb r5, [r0]
ldrb r0, [r4, 0x1E]
strb r0, [r7]
ldrb r0, [r4, 0x1E]
cmp r0, 0
beq _080AFC50
movs r0, 0xC0
b _080AFC72
.pool
_080AFC50:
movs r1, 0x80
negs r1, r1
strb r1, [r4, 0x1A]
b _080AFC74
_080AFC58:
ldrb r0, [r4, 0x1E]
strb r0, [r7]
ldr r0, [r4, 0x24]
lsls r0, 3
ldr r2, [sp, 0x10]
strb r0, [r2]
_080AFC64:
ldrb r0, [r4, 0x4]
adds r0, 0x8
mov r8, r0
ldrb r0, [r4, 0x1E]
cmp r0, 0
beq _080AFC72
movs r0, 0x40
_080AFC72:
strb r0, [r4, 0x1A]
_080AFC74:
ldrb r1, [r4, 0x4]
movs r2, 0
strb r1, [r4, 0xB]
movs r0, 0xFF
ands r0, r1
adds r1, r6, 0x1
mov r10, r1
movs r1, 0x40
adds r1, r4
mov r9, r1
cmp r0, 0
bne _080AFC8E
b _080AFDCA
_080AFC8E:
strb r2, [r4, 0x9]
b _080AFDF8
_080AFC92:
movs r0, 0x4
ands r0, r2
cmp r0, 0
beq _080AFCC4
ldrb r0, [r4, 0xD]
subs r0, 0x1
strb r0, [r4, 0xD]
movs r2, 0xFF
ands r0, r2
lsls r0, 24
adds r1, r6, 0x1
mov r10, r1
movs r2, 0x40
adds r2, r4
mov r9, r2
cmp r0, 0
ble _080AFCB6
b _080AFE0A
_080AFCB6:
lsls r0, r6, 24
lsrs r0, 24
bl CgbOscOff
movs r0, 0
strb r0, [r4]
b _080AFF08
_080AFCC4:
movs r0, 0x40
ands r0, r1
adds r2, r6, 0x1
mov r10, r2
movs r2, 0x40
adds r2, r4
mov r9, r2
cmp r0, 0
beq _080AFD04
movs r0, 0x3
ands r0, r1
cmp r0, 0
beq _080AFD04
movs r0, 0xFC
ands r0, r1
movs r2, 0
strb r0, [r4]
ldrb r1, [r4, 0x7]
strb r1, [r4, 0xB]
movs r0, 0xFF
ands r0, r1
cmp r0, 0
beq _080AFD36
movs r0, 0x1
ldrb r1, [r4, 0x1D]
orrs r0, r1
strb r0, [r4, 0x1D]
cmp r6, 0x3
beq _080AFDF8
ldrb r2, [r4, 0x7]
mov r8, r2
b _080AFDF8
_080AFD04:
ldrb r0, [r4, 0xB]
cmp r0, 0
bne _080AFDF8
cmp r6, 0x3
bne _080AFD16
movs r0, 0x1
ldrb r1, [r4, 0x1D]
orrs r0, r1
strb r0, [r4, 0x1D]
_080AFD16:
adds r0, r4, 0
bl CgbModVol
movs r0, 0x3
ldrb r2, [r4]
ands r0, r2
cmp r0, 0
bne _080AFD6A
ldrb r0, [r4, 0x9]
subs r0, 0x1
strb r0, [r4, 0x9]
movs r1, 0xFF
ands r0, r1
lsls r0, 24
cmp r0, 0
bgt _080AFD66
_080AFD36:
ldrb r2, [r4, 0xC]
ldrb r1, [r4, 0xA]
adds r0, r2, 0
muls r0, r1
adds r0, 0xFF
asrs r0, 8
movs r1, 0
strb r0, [r4, 0x9]
lsls r0, 24
cmp r0, 0
beq _080AFCB6
movs r0, 0x4
ldrb r2, [r4]
orrs r0, r2
strb r0, [r4]
movs r0, 0x1
ldrb r1, [r4, 0x1D]
orrs r0, r1
strb r0, [r4, 0x1D]
cmp r6, 0x3
beq _080AFE0A
movs r2, 0x8
mov r8, r2
b _080AFE0A
_080AFD66:
ldrb r0, [r4, 0x7]
b _080AFDF6
_080AFD6A:
cmp r0, 0x1
bne _080AFD76
_080AFD6E:
ldrb r0, [r4, 0x19]
strb r0, [r4, 0x9]
movs r0, 0x7
b _080AFDF6
_080AFD76:
cmp r0, 0x2
bne _080AFDBA
ldrb r0, [r4, 0x9]
subs r0, 0x1
strb r0, [r4, 0x9]
movs r1, 0xFF
ands r0, r1
lsls r0, 24
ldrb r2, [r4, 0x19]
lsls r1, r2, 24
cmp r0, r1
bgt _080AFDB6
_080AFD8E:
ldrb r0, [r4, 0x6]
cmp r0, 0
bne _080AFD9E
movs r0, 0xFC
ldrb r1, [r4]
ands r0, r1
strb r0, [r4]
b _080AFD36
_080AFD9E:
ldrb r0, [r4]
subs r0, 0x1
strb r0, [r4]
movs r0, 0x1
ldrb r2, [r4, 0x1D]
orrs r0, r2
strb r0, [r4, 0x1D]
cmp r6, 0x3
beq _080AFD6E
movs r0, 0x8
mov r8, r0
b _080AFD6E
_080AFDB6:
ldrb r0, [r4, 0x5]
b _080AFDF6
_080AFDBA:
ldrb r0, [r4, 0x9]
adds r0, 0x1
strb r0, [r4, 0x9]
movs r1, 0xFF
ands r0, r1
ldrb r2, [r4, 0xA]
cmp r0, r2
bcc _080AFDF4
_080AFDCA:
ldrb r0, [r4]
subs r0, 0x1
movs r2, 0
strb r0, [r4]
ldrb r1, [r4, 0x5]
strb r1, [r4, 0xB]
movs r0, 0xFF
ands r0, r1
cmp r0, 0
beq _080AFD8E
movs r0, 0x1
ldrb r1, [r4, 0x1D]
orrs r0, r1
strb r0, [r4, 0x1D]
ldrb r0, [r4, 0xA]
strb r0, [r4, 0x9]
cmp r6, 0x3
beq _080AFDF8
ldrb r2, [r4, 0x5]
mov r8, r2
b _080AFDF8
_080AFDF4:
ldrb r0, [r4, 0x4]
_080AFDF6:
strb r0, [r4, 0xB]
_080AFDF8:
ldrb r0, [r4, 0xB]
subs r0, 0x1
strb r0, [r4, 0xB]
ldr r0, [sp]
cmp r0, 0
bne _080AFE0A
subs r0, 0x1
str r0, [sp]
b _080AFD04
_080AFE0A:
movs r0, 0x2
ldrb r1, [r4, 0x1D]
ands r0, r1
cmp r0, 0
beq _080AFE82
cmp r6, 0x3
bgt _080AFE4A
movs r0, 0x8
ldrb r2, [r4, 0x1]
ands r0, r2
cmp r0, 0
beq _080AFE4A
ldr r0, =REG_SOUNDBIAS + 1
ldrb r0, [r0]
cmp r0, 0x3F
bgt _080AFE3C
ldr r0, [r4, 0x20]
adds r0, 0x2
ldr r1, =0x000007fc
b _080AFE46
.pool
_080AFE3C:
cmp r0, 0x7F
bgt _080AFE4A
ldr r0, [r4, 0x20]
adds r0, 0x1
ldr r1, =0x000007fe
_080AFE46:
ands r0, r1
str r0, [r4, 0x20]
_080AFE4A:
cmp r6, 0x4
beq _080AFE5C
ldr r0, [r4, 0x20]
ldr r1, [sp, 0x10]
strb r0, [r1]
b _080AFE6A
.pool
_080AFE5C:
ldr r2, [sp, 0x10]
ldrb r0, [r2]
movs r1, 0x8
ands r1, r0
ldr r0, [r4, 0x20]
orrs r0, r1
strb r0, [r2]
_080AFE6A:
movs r0, 0xC0
ldrb r1, [r4, 0x1A]
ands r0, r1
adds r1, r4, 0
adds r1, 0x21
ldrb r1, [r1]
adds r0, r1, r0
strb r0, [r4, 0x1A]
movs r2, 0xFF
ands r0, r2
ldr r1, [sp, 0x14]
strb r0, [r1]
_080AFE82:
movs r0, 0x1
ldrb r2, [r4, 0x1D]
ands r0, r2
cmp r0, 0
beq _080AFF08
ldr r1, =REG_NR51
ldrb r0, [r1]
ldrb r2, [r4, 0x1C]
bics r0, r2
ldrb r2, [r4, 0x1B]
orrs r0, r2
strb r0, [r1]
cmp r6, 0x3
bne _080AFED4
ldr r0, =gCgb3Vol
ldrb r1, [r4, 0x9]
adds r0, r1, r0
ldrb r0, [r0]
ldr r2, [sp, 0xC]
strb r0, [r2]
movs r1, 0x80
adds r0, r1, 0
ldrb r2, [r4, 0x1A]
ands r0, r2
cmp r0, 0
beq _080AFF08
ldr r0, [sp, 0x8]
strb r1, [r0]
ldrb r0, [r4, 0x1A]
ldr r1, [sp, 0x14]
strb r0, [r1]
movs r0, 0x7F
ldrb r2, [r4, 0x1A]
ands r0, r2
strb r0, [r4, 0x1A]
b _080AFF08
.pool
_080AFED4:
movs r0, 0xF
mov r1, r8
ands r1, r0
mov r8, r1
ldrb r2, [r4, 0x9]
lsls r0, r2, 4
add r0, r8
ldr r1, [sp, 0xC]
strb r0, [r1]
movs r2, 0x80
ldrb r0, [r4, 0x1A]
orrs r0, r2
ldr r1, [sp, 0x14]
strb r0, [r1]
cmp r6, 0x1
bne _080AFF08
ldr r0, [sp, 0x8]
ldrb r1, [r0]
movs r0, 0x8
ands r0, r1
cmp r0, 0
bne _080AFF08
ldrb r0, [r4, 0x1A]
orrs r0, r2
ldr r1, [sp, 0x14]
strb r0, [r1]
_080AFF08:
movs r0, 0
strb r0, [r4, 0x1D]
_080AFF0C:
mov r6, r10
mov r4, r9
cmp r6, 0x4
bgt _080AFF16
b _080AFB0C
_080AFF16:
add sp, 0x1C
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end CgbSound
.align 2, 0 @ Don't pad with nop.

View File

@ -4,268 +4,7 @@
.syntax unified
.text
thumb_func_start InitHeap
InitHeap:
push {lr}
bl InitHeapInternal
pop {r0}
bx r0
thumb_func_end InitHeap
thumb_func_start MemoryClear8
MemoryClear8:
push {lr}
cmp r1, 0
ble _08002EAA
movs r2, 0
_08002EA0:
subs r1, 0x1
strb r2, [r0]
adds r0, 0x1
cmp r1, 0
bgt _08002EA0
_08002EAA:
pop {r0}
bx r0
thumb_func_end MemoryClear8
thumb_func_start MemoryClear16
MemoryClear16:
push {lr}
cmp r1, 0
ble _08002EC2
movs r2, 0
_08002EB8:
subs r1, 0x2
strh r2, [r0]
adds r0, 0x2
cmp r1, 0
bgt _08002EB8
_08002EC2:
pop {r0}
bx r0
thumb_func_end MemoryClear16
thumb_func_start MemoryClear32
MemoryClear32:
push {lr}
bl CpuClear
pop {r0}
bx r0
thumb_func_end MemoryClear32
thumb_func_start MemoryFill8
MemoryFill8:
push {lr}
lsls r1, 24
lsrs r1, 24
cmp r2, 0
ble _08002EE8
_08002EDE:
subs r2, 0x1
strb r1, [r0]
adds r0, 0x1
cmp r2, 0
bgt _08002EDE
_08002EE8:
pop {r0}
bx r0
thumb_func_end MemoryFill8
thumb_func_start MemoryFill16
MemoryFill16:
push {lr}
lsls r1, 16
lsrs r1, 16
cmp r2, 0
ble _08002F00
_08002EF6:
subs r2, 0x2
strh r1, [r0]
adds r0, 0x2
cmp r2, 0
bgt _08002EF6
_08002F00:
pop {r0}
bx r0
thumb_func_end MemoryFill16
thumb_func_start MemoryFill32
MemoryFill32:
push {lr}
cmp r2, 0
ble _08002F12
_08002F0A:
subs r2, 0x4
stm r0!, {r1}
cmp r2, 0
bgt _08002F0A
_08002F12:
pop {r0}
bx r0
thumb_func_end MemoryFill32
thumb_func_start MemoryCopy8
MemoryCopy8:
push {lr}
adds r3, r0, 0
cmp r2, 0
ble _08002F2E
_08002F20:
subs r2, 0x1
ldrb r0, [r1]
strb r0, [r3]
adds r1, 0x1
adds r3, 0x1
cmp r2, 0
bgt _08002F20
_08002F2E:
pop {r0}
bx r0
thumb_func_end MemoryCopy8
thumb_func_start MemoryCopy16
MemoryCopy16:
push {lr}
adds r3, r0, 0
cmp r2, 0
ble _08002F4A
_08002F3C:
subs r2, 0x2
ldrh r0, [r1]
strh r0, [r3]
adds r1, 0x2
adds r3, 0x2
cmp r2, 0
bgt _08002F3C
_08002F4A:
pop {r0}
bx r0
thumb_func_end MemoryCopy16
thumb_func_start MemoryCopy32
MemoryCopy32:
push {lr}
adds r3, r0, 0
cmp r2, 0
ble _08002F62
_08002F58:
subs r2, 0x4
ldm r1!, {r0}
stm r3!, {r0}
cmp r2, 0
bgt _08002F58
_08002F62:
pop {r0}
bx r0
thumb_func_end MemoryCopy32
thumb_func_start InitHeapInternal
InitHeapInternal:
push {lr}
sub sp, 0x8
ldr r0, _08002F90
str r0, [sp]
movs r0, 0x90
lsls r0, 10
str r0, [sp, 0x4]
ldr r1, _08002F94
movs r0, 0
str r0, [r1]
ldr r0, _08002F98
ldr r2, _08002F9C
mov r1, sp
movs r3, 0x20
bl DoInitHeap
add sp, 0x8
pop {r0}
bx r0
.align 2, 0
_08002F90: .4byte gUnknown_20011D0
_08002F94: .4byte gUnknown_2000EA8
_08002F98: .4byte gUnknown_2000EB0
_08002F9C: .4byte gUnknown_2000ED0
thumb_func_end InitHeapInternal
thumb_func_start DoInitHeap
DoInitHeap:
push {r4-r6,lr}
mov r6, r9
mov r5, r8
push {r5,r6}
ldr r4, [r1, 0x4]
mov r9, r4
movs r4, 0x4
negs r4, r4
mov r5, r9
ands r5, r4
mov r9, r5
ldr r6, _08002FFC
ldr r4, _08003000
mov r8, r4
ldr r5, [r4]
lsls r4, r5, 2
adds r4, r6
str r0, [r4]
adds r5, 0x1
mov r4, r8
str r5, [r4]
ldr r5, [r1]
str r5, [r0, 0x14]
mov r1, r9
str r1, [r0, 0x18]
movs r1, 0x2
str r1, [r0]
movs r4, 0
str r4, [r0, 0x4]
str r2, [r0, 0x8]
movs r1, 0x1
str r1, [r0, 0xC]
str r3, [r0, 0x10]
str r4, [r2]
str r4, [r2, 0x4]
str r5, [r2, 0xC]
mov r5, r9
str r5, [r2, 0x10]
str r4, [r2, 0x14]
str r4, [r2, 0x8]
pop {r3,r4}
mov r8, r3
mov r9, r4
pop {r4-r6}
pop {r0}
bx r0
.align 2, 0
_08002FFC: .4byte gUnknown_2000E88
_08003000: .4byte gUnknown_2000EA8
thumb_func_end DoInitHeap
thumb_func_start InitSubHeap
InitSubHeap:
push {r4,r5,lr}
sub sp, 0x8
adds r3, r2, 0
lsls r4, r3, 1
adds r4, r3
movs r2, 0x4
negs r2, r2
lsls r4, 3
ldr r5, [r1, 0x4]
subs r5, r4
ands r5, r2
ldr r2, [r1]
adds r4, r2, r4
str r4, [sp]
str r5, [sp, 0x4]
mov r1, sp
bl DoInitHeap
add sp, 0x8
pop {r4,r5}
pop {r0}
bx r0
thumb_func_end InitSubHeap
thumb_func_start xxx_memory_attr_related
xxx_memory_attr_related:
push {lr}
@ -454,7 +193,7 @@ _0800315E:
_08003168:
movs r7, 0x1
negs r7, r7
ldr r6, _080031A4
ldr r6, =0x24001
ldr r0, [r4, 0xC]
subs r3, r0, 0x1
lsls r0, r3, 1
@ -486,7 +225,7 @@ _080031A0:
adds r0, r7, 0
b _080031AC
.align 2, 0
_080031A4: .4byte 0x00024001
.pool
_080031A8:
movs r0, 0x1
negs r0, r0
@ -561,13 +300,12 @@ _08003222:
str r2, [r1, 0xC]
cmp r2, r8
ble _08003240
ldr r0, _08003238
ldr r1, _0800323C
ldr r0, =gUnknown_80B7EB8
ldr r1, =gUnknown_80B7EC4
mov r3, r8
bl FatalError
.align 2, 0
_08003238: .4byte gUnknown_80B7EB8
_0800323C: .4byte gUnknown_80B7EC4
.pool
_08003240:
ldr r0, [sp, 0xC]
add r0, r9
@ -671,13 +409,12 @@ _080032F6:
str r2, [r7, 0xC]
cmp r2, r8
ble _08003314
ldr r0, _0800330C
ldr r1, _08003310
ldr r0, =gUnknown_80B7EFC
ldr r1, =gUnknown_80B7EC4
mov r3, r8
bl FatalError
.align 2, 0
_0800330C: .4byte gUnknown_80B7EFC
_08003310: .4byte gUnknown_80B7EC4
.pool
_08003314:
ldr r0, [r4, 0x10]
ldr r1, [sp, 0x10]
@ -717,7 +454,7 @@ _LocateSet:
adds r6, r2, 0
cmp r5, 0
bne _0800335C
ldr r5, _08003390
ldr r5, =gMainHeapDescriptor
_0800335C:
asrs r4, r6, 8
movs r0, 0x1
@ -743,7 +480,7 @@ _0800335C:
ldr r0, [r0, 0xC]
b _080033CC
.align 2, 0
_08003390: .4byte gUnknown_2000EB0
.pool
_08003394:
adds r0, r5, 0
adds r1, r4, 0
@ -760,16 +497,15 @@ _08003394:
ldr r0, [r0, 0xC]
b _080033CC
_080033B4:
ldr r0, _080033C4
ldr r1, _080033C8
ldr r0, =gUnknown_80B7F14
ldr r1, =gUnknown_80B7F20
str r4, [sp]
str r6, [sp, 0x4]
adds r2, r5, 0
adds r3, r7, 0
bl FatalError
.align 2, 0
_080033C4: .4byte gUnknown_80B7F14
_080033C8: .4byte gUnknown_80B7F20
.pool
_080033CC:
add sp, 0x8
pop {r4-r7}
@ -782,25 +518,25 @@ MemoryAlloc:
push {lr}
adds r3, r0, 0
adds r2, r1, 0
ldr r0, _080033E8
ldr r0, =gMainHeapDescriptor
adds r1, r3, 0
bl DoAlloc
pop {r1}
bx r1
.align 2, 0
_080033E8: .4byte gUnknown_2000EB0
.pool
thumb_func_end MemoryAlloc
thumb_func_start MemoryFree
MemoryFree:
push {lr}
adds r1, r0, 0
ldr r0, _080033FC
ldr r0, =gMainHeapDescriptor
bl DoFree
pop {r0}
bx r0
.align 2, 0
_080033FC: .4byte gUnknown_2000EB0
.pool
thumb_func_end MemoryFree
thumb_func_start MemoryLocate_LocalCreate
@ -813,7 +549,7 @@ MemoryLocate_LocalCreate:
adds r6, r3, 0
cmp r4, 0
bne _08003412
ldr r4, _0800342C
ldr r4, =gMainHeapDescriptor
_08003412:
adds r0, r4, 0
movs r1, 0x9
@ -822,14 +558,12 @@ _08003412:
adds r1, r0, 0
cmp r1, 0
bge _08003438
ldr r0, _08003430
ldr r1, _08003434
ldr r0, =gUnknown_80B7F88
ldr r1, =gUnknown_80B7F94
adds r2, r5, 0
bl FatalError
.align 2, 0
_0800342C: .4byte gUnknown_2000EB0
_08003430: .4byte gUnknown_80B7F88
_08003434: .4byte gUnknown_80B7F94
.pool
_08003438:
str r6, [sp]
adds r0, r4, 0
@ -893,11 +627,11 @@ _080034A2:
movs r0, 0
mov r12, r0
movs r3, 0
ldr r6, _080034E0
ldr r6, =gHeapCount
ldr r0, [r6]
cmp r12, r0
bge _080034F2
ldr r5, _080034E4
ldr r5, =gHeapDescriptorList
adds r1, r6, 0
adds r7, r5, 0
movs r2, 0
@ -911,7 +645,7 @@ _080034BC:
str r0, [r1]
cmp r3, r0
bge _080034F8
ldr r1, _080034E0
ldr r1, =gHeapCount
adds r2, r7
_080034D2:
ldr r0, [r2, 0x4]
@ -922,8 +656,7 @@ _080034D2:
blt _080034D2
b _080034F8
.align 2, 0
_080034E0: .4byte gUnknown_2000EA8
_080034E4: .4byte gUnknown_2000E88
.pool
_080034E8:
adds r2, 0x4
adds r3, 0x1
@ -966,7 +699,7 @@ DoFree:
adds r4, r0, 0
cmp r4, 0
bne _0800352E
ldr r4, _080035D4
ldr r4, =gMainHeapDescriptor
_0800352E:
cmp r1, 0
beq _080035E4
@ -1056,7 +789,7 @@ _080035BA:
blt _080035BA
b _080035E4
.align 2, 0
_080035D4: .4byte gUnknown_2000EB0
.pool
_080035D8:
movs r0, 0x1
add r8, r0

View File

@ -1,37 +1,19 @@
.global RomHeaderNintendoLogo
RomHeaderNintendoLogo:
.byte 0x24,0xff,0xae,0x51,0x69,0x9a,0xa2,0x21
.byte 0x3d,0x84,0x82,0x0a,0x84,0xe4,0x09,0xad
.byte 0x11,0x24,0x8b,0x98,0xc0,0x81,0x7f,0x21
.byte 0xa3,0x52,0xbe,0x19,0x93,0x09,0xce,0x20
.byte 0x10,0x46,0x4a,0x4a,0xf8,0x27,0x31,0xec
.byte 0x58,0xc7,0xe8,0x33,0x82,0xe3,0xce,0xbf
.byte 0x85,0xf4,0xdf,0x94,0xce,0x4b,0x09,0xc1
.byte 0x94,0x56,0x8a,0xc0,0x13,0x72,0xa7,0xfc
.byte 0x9f,0x84,0x4d,0x73,0xa3,0xca,0x9a,0x61
.byte 0x58,0x97,0xa3,0x27,0xfc,0x03,0x98,0x76
.byte 0x23,0x1d,0xc7,0x61,0x03,0x04,0xae,0x56
.byte 0xbf,0x38,0x84,0x00,0x40,0xa7,0x0e,0xfd
.byte 0xff,0x52,0xfe,0x03,0x6f,0x95,0x30,0xf1
.byte 0x97,0xfb,0xc0,0x85,0x60,0xd6,0x80,0x25
.byte 0xa9,0x63,0xbe,0x03,0x01,0x4e,0x38,0xe2
.byte 0xf9,0xa2,0x34,0xff,0xbb,0x3e,0x03,0x44
.byte 0x78,0x00,0x90,0xcb,0x88,0x11,0x3a,0x94
.byte 0x65,0xc0,0x7c,0x63,0x87,0xf0,0x3c,0xaf
.byte 0xd6,0x25,0xe4,0x8b,0x38,0x0a,0xac,0x72
.byte 0x21,0xd4,0xf8,0x07
.space 156
RomHeaderGameTitle:
.ascii "POKE DUNGEON"
.space 12
.global RomHeaderGameCode
RomHeaderGameCode:
.ascii "B24E"
.space 4
RomHeaderMakerCode:
.ascii "01"
.space 2
RomHeaderMagic:
.byte 0x96
.byte 0
RomHeaderMainUnitCode:
.byte 0
@ -42,11 +24,12 @@ RomHeaderDeviceType:
RomHeaderReserved1:
.space 7
.global RomHeaderSoftwareVersion
RomHeaderSoftwareVersion:
.byte 0
RomHeaderChecksum:
.byte 0xA4
.byte 0
RomHeaderReserved2:
.space 2

View File

@ -5,116 +5,18 @@
.text
thumb_func_start sub_8011C1C
sub_8011C1C:
ldr r0, _08011C24
ldr r0, [r0]
bx lr
.align 2, 0
_08011C24: .4byte gUnknown_203B17C
thumb_func_end sub_8011C1C
thumb_func_start sub_8011C28
sub_8011C28:
ldr r1, _08011C30
str r0, [r1]
bx lr
.align 2, 0
_08011C30: .4byte gUnknown_203B17C
thumb_func_end sub_8011C28
thumb_func_start sub_8011C34
sub_8011C34:
ldr r0, _08011C3C
ldr r0, [r0]
bx lr
.align 2, 0
_08011C3C: .4byte gUnknown_202DE28
thumb_func_end sub_8011C34
thumb_func_start sub_8011C40
sub_8011C40:
ldr r1, _08011C48
str r0, [r1]
bx lr
.align 2, 0
_08011C48: .4byte gUnknown_202DE28
thumb_func_end sub_8011C40
thumb_func_start sub_8011C4C
sub_8011C4C:
ldr r0, _08011C54
ldr r0, [r0]
bx lr
.align 2, 0
_08011C54: .4byte gUnknown_203B180
thumb_func_end sub_8011C4C
thumb_func_start sub_8011C58
sub_8011C58:
push {r4,lr}
adds r4, r0, 0
movs r2, 0
lsrs r1, 2
cmp r1, 0x1
ble _08011C72
adds r3, r4, 0x4
subs r1, 0x1
_08011C68:
ldm r3!, {r0}
adds r2, r0
subs r1, 0x1
cmp r1, 0
bne _08011C68
_08011C72:
str r2, [r4]
pop {r4}
pop {r0}
bx r0
thumb_func_end sub_8011C58
thumb_func_start sub_8011C7C
sub_8011C7C:
push {r4,lr}
adds r4, r0, 0
movs r2, 0
lsrs r1, 2
cmp r1, 0x1
ble _08011C96
adds r3, r4, 0x4
subs r1, 0x1
_08011C8C:
ldm r3!, {r0}
adds r2, r0
subs r1, 0x1
cmp r1, 0
bne _08011C8C
_08011C96:
ldr r0, [r4]
cmp r0, r2
bne _08011CA0
movs r0, 0
b _08011CA2
_08011CA0:
movs r0, 0x1
_08011CA2:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_8011C7C
thumb_func_start sub_8011CA8
sub_8011CA8:
push {lr}
adds r3, r0, 0
adds r2, r1, 0
ldr r0, _08011CCC
ldr r0, =gUnknown_203B184
ldr r0, [r0]
ldr r0, _08011CD0
ldr r0, =0xfff
adds r1, r2, r0
cmp r1, 0
bge _08011CBE
ldr r0, _08011CD4
ldr r0, =0x1ffe
adds r1, r2, r0
_08011CBE:
asrs r1, 12
@ -124,13 +26,11 @@ _08011CBE:
pop {r0}
bx r0
.align 2, 0
_08011CCC: .4byte gUnknown_203B184
_08011CD0: .4byte 0x00000fff
_08011CD4: .4byte 0x00001ffe
.pool
thumb_func_end sub_8011CA8
thumb_func_start sub_8011CD8
sub_8011CD8:
thumb_func_start WriteSaveSector
WriteSaveSector:
push {r4-r6,lr}
adds r5, r1, 0
adds r4, r2, 0
@ -139,7 +39,7 @@ sub_8011CD8:
bl sub_8011CA8
adds r0, r5, 0
adds r1, r4, 0
bl sub_8011C58
bl CalculateChecksum
ldr r0, _08011D04
ldr r0, [r0]
cmp r0, 0
@ -183,10 +83,10 @@ _08011D3A:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_8011CD8
thumb_func_end WriteSaveSector
thumb_func_start sub_8011D40
sub_8011D40:
thumb_func_start ReadSaveSector
ReadSaveSector:
push {r4-r6,lr}
adds r5, r1, 0
adds r4, r2, 0
@ -228,7 +128,7 @@ _08011D8A:
_08011D8E:
adds r0, r5, 0
adds r1, r4, 0
bl sub_8011C7C
bl ValidateChecksum
lsls r0, 24
cmp r0, 0
bne _08011DA0
@ -240,7 +140,7 @@ _08011DA2:
pop {r4-r6}
pop {r1}
bx r1
thumb_func_end sub_8011D40
thumb_func_end ReadSaveSector
thumb_func_start sub_8011DA8
sub_8011DA8:
@ -265,14 +165,14 @@ sub_8011DAC:
adds r0, r6, 0
adds r1, r5, 0
mov r2, r8
bl sub_8011D40
bl ReadSaveSector
adds r7, r0, 0
cmp r7, 0
beq _08011DE8
adds r0, r6, 0
adds r1, r5, 0
mov r2, r8
bl sub_8011D40
bl ReadSaveSector
adds r7, r0, 0
b _08011DF0
.align 2, 0
@ -491,7 +391,7 @@ _08011F98: .4byte 0x00000444
thumb_func_start sub_8011F9C
sub_8011F9C:
push {lr}
bl sub_8011D40
bl ReadSaveSector
pop {r1}
bx r1
thumb_func_end sub_8011F9C
@ -511,7 +411,7 @@ sub_8011FA8:
mov r0, sp
adds r1, r5, 0
adds r2, r4, 0
bl sub_8011D40
bl ReadSaveSector
adds r2, r0, 0
cmp r2, 0
bne _08011FD8
@ -554,7 +454,7 @@ sub_8011FF8:
mov r0, sp
adds r1, r5, 0
adds r2, r4, 0
bl sub_8011D40
bl ReadSaveSector
cmp r0, 0
bne _08012028
ldr r1, [r5, 0x14]
@ -722,12 +622,12 @@ _080120E8:
adds r0, r7, 0
adds r1, r6, 0
adds r2, r4, 0
bl sub_8011CD8
bl WriteSaveSector
adds r5, r0, 0
adds r0, r7, 0
adds r1, r6, 0
adds r2, r4, 0
bl sub_8011CD8
bl WriteSaveSector
adds r4, r0, 0
adds r0, r6, 0
bl MemoryFree
@ -760,7 +660,7 @@ _080121CE:
thumb_func_start sub_80121D4
sub_80121D4:
push {lr}
bl sub_8011CD8
bl WriteSaveSector
pop {r1}
bx r1
thumb_func_end sub_80121D4
@ -796,7 +696,7 @@ sub_80121E0:
mov r0, sp
adds r1, r4, 0
adds r2, r6, 0
bl sub_8011CD8
bl WriteSaveSector
adds r5, r0, 0
adds r0, r4, 0
bl MemoryFree
@ -1792,22 +1692,4 @@ _080129F2:
bx r1
thumb_func_end sub_80128B0
thumb_func_start sub_80129FC
sub_80129FC:
push {r4,lr}
ldr r4, _08012A14
ldr r0, [r4]
cmp r0, 0
beq _08012A0E
bl MemoryFree
movs r0, 0
str r0, [r4]
_08012A0E:
pop {r4}
pop {r0}
bx r0
.align 2, 0
_08012A14: .4byte gUnknown_203B194
thumb_func_end sub_80129FC
.align 2, 0 @ Don't pad with nop.

View File

@ -5,19 +5,8 @@
.text
thumb_func_start InitSprites
InitSprites:
push {lr}
movs r0, 0x1
bl sub_8004D8C
movs r0, 0
bl SetSavingIconCoords
pop {r0}
bx r0
thumb_func_end InitSprites
thumb_func_start sub_8004D8C
sub_8004D8C:
thumb_func_start ResetSprites
ResetSprites:
push {r4,r5,lr}
lsls r0, 24
lsrs r4, r0, 24
@ -131,8 +120,8 @@ _08004E50:
pop {r0}
bx r0
.align 2, 0
_08004E68: .4byte gUnknown_20266A8
_08004E6C: .4byte gUnknown_2026E30
_08004E68: .4byte gSpriteCount
_08004E6C: .4byte gCharMemCursor
_08004E70: .4byte 0x06010000
_08004E74: .4byte gUnknown_203B074
_08004E78: .4byte gUnknown_20266B0
@ -140,7 +129,7 @@ _08004E7C: .4byte gUnknown_20256A0
_08004E80: .4byte gUnknown_20262A8
_08004E84: .4byte gUnknown_2025EA8
_08004E88: .4byte 0x00000804
thumb_func_end sub_8004D8C
thumb_func_end ResetSprites
thumb_func_start sub_8004E8C
sub_8004E8C:
@ -241,7 +230,7 @@ _08004F20:
strh r0, [r1, 0x2]
b _08004F86
.align 2, 0
_08004F40: .4byte gUnknown_20266A8
_08004F40: .4byte gSpriteCount
_08004F44: .4byte 0x0000fcff
_08004F48: .4byte 0x0000f1ff
_08004F4C: .4byte 0x000003ff
@ -459,7 +448,7 @@ _080050D8:
strh r0, [r2, 0x2]
b _08005128
.align 2, 0
_080050F4: .4byte gUnknown_20266A8
_080050F4: .4byte gSpriteCount
_080050F8: .4byte gUnknown_20262A8
_080050FC:
ldrh r1, [r6]
@ -524,7 +513,7 @@ _08005168:
bx r0
.align 2, 0
_08005174: .4byte gUnknown_2025EA8
_08005178: .4byte gUnknown_20266A8
_08005178: .4byte gSpriteCount
_0800517C: .4byte gUnknown_20256A0
thumb_func_end AddSprite
@ -739,8 +728,8 @@ _080052F2:
bx r0
.align 2, 0
_080052F8: .4byte gUnknown_203B074
_080052FC: .4byte gUnknown_2026E30
_08005300: .4byte gUnknown_2026E30
_080052FC: .4byte gCharMemCursor
_08005300: .4byte gCharMemCursor
thumb_func_end sub_80052BC
thumb_func_start sub_8005304
@ -801,7 +790,7 @@ sub_800533C:
str r0, [r1]
b _0800538E
.align 2, 0
_08005368: .4byte gUnknown_2026E30
_08005368: .4byte gCharMemCursor
_0800536C: .4byte 0x06010000
_08005370:
cmp r6, 0

View File

@ -5,386 +5,6 @@
.text
thumb_func_start sub_8006218
sub_8006218:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
ldr r1, _080062F4
movs r0, 0
str r0, [r1]
ldr r0, _080062F8
ldr r5, _080062FC
adds r1, r5, 0
bl OpenFileAndGetFileDataPtr
ldr r4, _08006300
str r0, [r4]
ldr r0, _08006304
adds r1, r5, 0
bl OpenFileAndGetFileDataPtr
str r0, [r4, 0x4]
ldr r2, _08006308
ldr r1, [r4]
ldr r1, [r1, 0x4]
str r1, [r2]
ldr r0, [r0, 0x4]
str r0, [r2, 0x4]
ldr r1, _0800630C
movs r0, 0xB
str r0, [r1]
movs r0, 0xC
str r0, [r1, 0x4]
ldr r0, _08006310
movs r4, 0
movs r3, 0
adds r2, r0, 0
adds r2, 0x46
adds r0, 0x4
movs r1, 0x3
_08006264:
strh r3, [r0]
strh r3, [r0, 0x4]
strb r4, [r2]
adds r2, 0x48
adds r0, 0x48
subs r1, 0x1
cmp r1, 0
bge _08006264
ldr r1, _08006314
movs r0, 0
strh r0, [r1]
movs r3, 0
ldr r0, _08006318
mov r9, r0
ldr r1, _0800631C
mov r10, r1
ldr r7, _08006320
ldr r2, _08006324
mov r8, r2
movs r0, 0x80
lsls r0, 4
adds r6, r7, r0
ldr r4, _08006328
movs r5, 0
mov r12, r6
_08006296:
lsls r0, r3, 6
adds r2, r0, r7
mov r1, r8
strh r1, [r2]
adds r1, r0, r6
strh r4, [r1]
adds r3, 0x1
add r0, r12
adds r0, 0x2
adds r2, 0x2
movs r1, 0x1E
_080062AC:
strh r5, [r2]
strh r4, [r0]
adds r0, 0x2
adds r2, 0x2
subs r1, 0x1
cmp r1, 0
bge _080062AC
cmp r3, 0x13
ble _08006296
movs r1, 0
movs r0, 0x1
mov r2, r9
strb r0, [r2]
ldr r0, _0800632C
mov r2, r10
str r0, [r2]
ldr r0, _08006330
str r1, [r0]
ldr r2, _08006334
strb r1, [r2]
movs r0, 0x1
ldr r1, _08006338
str r0, [r1]
movs r0, 0x14
ldr r2, _0800633C
str r0, [r2]
movs r0, 0
bl xxx_update_some_bg_tiles
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080062F4: .4byte gUnknown_20274AC
_080062F8: .4byte gUnknown_80B87B4
_080062FC: .4byte gUnknown_8300500
_08006300: .4byte gUnknown_202AFB4
_08006304: .4byte gUnknown_80B87BC
_08006308: .4byte gUnknown_2027490
_0800630C: .4byte gUnknown_202B028
_08006310: .4byte gUnknown_2027370
_08006314: .4byte gUnknown_2027498
_08006318: .4byte gUnknown_202B034
_0800631C: .4byte gUnknown_202B030
_08006320: .4byte gUnknown_202B038
_08006324: .4byte 0x0000f279
_08006328: .4byte 0x0000f27a
_0800632C: .4byte 0x88888888
_08006330: .4byte gUnknown_203B078
_08006334: .4byte gUnknown_20274A5
_08006338: .4byte gUnknown_202B020
_0800633C: .4byte gUnknown_202B024
thumb_func_end sub_8006218
thumb_func_start xxx_update_some_bg_tiles
xxx_update_some_bg_tiles:
push {r4,r5,lr}
adds r1, r0, 0
ldr r0, _08006360
ldr r5, [r0]
ldr r4, _08006364
str r1, [r0]
cmp r1, 0
beq _08006354
cmp r1, 0x2
bne _0800636C
_08006354:
movs r0, 0x2
bl sub_800CDA8
ldr r2, _08006368
b _08006374
.align 2, 0
_08006360: .4byte gUnknown_20274B0
_08006364: .4byte 0x06004f40
_08006368: .4byte gUnknown_80B87C4
_0800636C:
movs r0, 0x1
bl sub_800CDA8
ldr r2, _080063A4
_08006374:
ldr r1, _080063A8
ldr r0, _080063AC
str r0, [r1]
ldm r2!, {r0}
stm r4!, {r0}
ldm r2!, {r0}
stm r4!, {r0}
ldm r2!, {r0}
stm r4!, {r0}
ldm r2!, {r0}
stm r4!, {r0}
ldm r2!, {r0}
stm r4!, {r0}
ldm r2!, {r0}
stm r4!, {r0}
ldm r2!, {r0}
stm r4!, {r0}
ldr r0, [r2]
str r0, [r4]
adds r0, r5, 0
pop {r4,r5}
pop {r1}
bx r1
.align 2, 0
_080063A4: .4byte gUnknown_80B87E4
_080063A8: .4byte gUnknown_202B030
_080063AC: .4byte 0x88888888
thumb_func_end xxx_update_some_bg_tiles
thumb_func_start sub_80063B0
sub_80063B0:
ldr r0, _080063B8
ldr r0, [r0]
bx lr
.align 2, 0
_080063B8: .4byte gUnknown_20274B0
thumb_func_end sub_80063B0
thumb_func_start sub_80063BC
sub_80063BC:
ldr r1, _080063C8
ldrb r2, [r1]
strb r0, [r1]
adds r0, r2, 0
bx lr
.align 2, 0
_080063C8: .4byte gUnknown_202B034
thumb_func_end sub_80063BC
thumb_func_start sub_80063CC
sub_80063CC:
ldr r1, _080063D4
str r0, [r1]
bx lr
.align 2, 0
_080063D4: .4byte gUnknown_20274AC
thumb_func_end sub_80063CC
thumb_func_start sub_80063D8
sub_80063D8:
push {lr}
adds r1, r0, 0
cmp r1, 0
bne _080063F0
ldr r0, _080063E8
ldr r0, [r0]
ldr r2, _080063EC
b _08006410
.align 2, 0
_080063E8: .4byte gUnknown_20274B0
_080063EC: .4byte 0x88888888
_080063F0:
movs r0, 0xF
ands r0, r1
lsls r2, r0, 4
orrs r2, r0
lsls r1, r0, 8
orrs r2, r1
lsls r1, r0, 12
orrs r2, r1
lsls r1, r0, 16
orrs r2, r1
lsls r1, r0, 20
orrs r2, r1
lsls r1, r0, 24
orrs r2, r1
lsls r0, 28
orrs r2, r0
_08006410:
ldr r0, _08006418
str r2, [r0]
pop {r0}
bx r0
.align 2, 0
_08006418: .4byte gUnknown_202B030
thumb_func_end sub_80063D8
thumb_func_start sub_800641C
sub_800641C:
push {lr}
sub sp, 0x4
lsls r1, 24
lsrs r1, 24
lsls r2, 24
lsrs r2, 24
movs r3, 0
str r3, [sp]
mov r3, sp
bl sub_8006438
add sp, 0x4
pop {r0}
bx r0
thumb_func_end sub_800641C
thumb_func_start sub_8006438
sub_8006438:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x1C
adds r4, r0, 0
mov r8, r3
lsls r1, 24
lsrs r1, 24
mov r10, r1
lsls r2, 24
lsrs r2, 24
movs r0, 0x2
mov r9, r0
cmp r4, 0
bne _0800645C
ldr r4, _080064F0
_0800645C:
cmp r2, 0
beq _08006464
bl sub_8009388
_08006464:
bl sub_800898C
movs r6, 0
adds r5, r4, 0
adds r5, 0xC
ldr r1, _080064F4
str r1, [sp, 0x18]
_08006472:
ldr r0, [sp, 0x18]
adds r1, r4, 0
ldm r1!, {r2,r3,r7}
stm r0!, {r2,r3,r7}
ldm r1!, {r2,r3,r7}
stm r0!, {r2,r3,r7}
movs r1, 0
ldrsh r0, [r5, r1]
cmp r0, 0
beq _080064C4
ldr r1, _080064F8
lsls r0, r6, 2
adds r0, r1
ldr r0, [r0]
str r0, [sp]
str r4, [sp, 0x4]
mov r2, r10
str r2, [sp, 0x8]
mov r3, r9
str r3, [sp, 0xC]
mov r7, r8
str r7, [sp, 0x10]
movs r0, 0
str r0, [sp, 0x14]
ldr r0, _080064FC
movs r1, 0xC0
lsls r1, 19
ldr r2, _08006500
ldr r3, _08006504
bl sub_8006554
adds r0, r4, 0
mov r1, r8
bl sub_80089AC
movs r0, 0
ldrsh r1, [r5, r0]
movs r2, 0x4
ldrsh r0, [r5, r2]
muls r0, r1
add r9, r0
_080064C4:
adds r5, 0x18
adds r4, 0x18
ldr r3, [sp, 0x18]
adds r3, 0x18
str r3, [sp, 0x18]
adds r6, 0x1
cmp r6, 0x3
ble _08006472
ldr r2, _08006508
ldr r0, _0800650C
ldr r1, _08006510
str r0, [r2]
movs r0, 0x1
strb r0, [r1]
add sp, 0x1C
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_080064F0: .4byte gUnknown_80B857C
_080064F4: .4byte gUnknown_202AFC0
_080064F8: .4byte gUnknown_80B8804
_080064FC: .4byte gUnknown_2027370
_08006500: .4byte gUnknown_20274B4
_08006504: .4byte gUnknown_202B038
_08006508: .4byte gUnknown_203B078
_0800650C: .4byte gUnknown_3000E94
_08006510: .4byte gUnknown_20274A5
thumb_func_end sub_8006438
thumb_func_start nullsub_152
nullsub_152:
bx lr
@ -4848,7 +4468,7 @@ sub_8008584:
adds r1, r5, r1
b _08008624
.align 2, 0
_080085C4: .4byte gUnknown_2027490
_080085C4: .4byte gKanji
_080085C8: .4byte gUnknown_20274AC
_080085CC: .4byte 0xffff0800
_080085D0: .4byte 0x000007fe

7
asmdiff.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
OBJDUMP="$DEVKITARM/bin/arm-none-eabi-objdump -D -bbinary -marmv4t -Mforce-thumb"
OPTIONS="--start-address=$(($1)) --stop-address=$(($1 + $2))"
$OBJDUMP $OPTIONS baserom.gba > baserom.dump
$OBJDUMP $OPTIONS pmd_red.gba > pmd_red.dump
diff -u baserom.dump pmd_red.dump | less

10
build_tools.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
make -C tools/gbagfx CXX=${1:-g++}
make -C tools/scaninc CXX=${1:-g++}
make -C tools/preproc CXX=${1:-g++}
make -C tools/bin2c CXX=${1:-g++}
make -C tools/rsfont CXX=${1:-g++}
make -C tools/aif2pcm CXX=${1:-g++}
make -C tools/ramscrgen CXX=${1:-g++}
make -C tools/gbafix CXX=${1:-g++}
make -C tools/mid2agb CXX=${1:-g++}

217
charmap.txt Normal file
View File

@ -0,0 +1,217 @@
' ' = 20
'!' = 21
'"' = 22
'#' = 23
'$' = 24
'%' = 25
'&' = 26
'\'' = 27
'(' = 28
')' = 29
'*' = 2A
'+' = 2B
',' = 2C
'-' = 2D
'.' = 2E
'/' = 2F
'0' = 30
'1' = 31
'2' = 32
'3' = 33
'4' = 34
'5' = 35
'6' = 36
'7' = 37
'8' = 38
'9' = 39
':' = 3A
';' = 3B
'<' = 3C
'=' = 3D
'>' = 3E
'?' = 3F
'@' = 40
'A' = 41
'B' = 42
'C' = 43
'D' = 44
'E' = 45
'F' = 46
'G' = 47
'H' = 48
'I' = 49
'J' = 4A
'K' = 4B
'L' = 4C
'M' = 4D
'N' = 4E
'O' = 4F
'P' = 50
'Q' = 51
'R' = 52
'S' = 53
'T' = 54
'U' = 55
'V' = 56
'W' = 57
'X' = 58
'Y' = 59
'Z' = 5A
'[' = 5B
@'\\' = 5C
']' = 5D
'^' = 5E
'_' = 5F
'`' = 60
'a' = 61
'b' = 62
'c' = 63
'd' = 64
'e' = 65
'f' = 66
'g' = 67
'h' = 68
'i' = 69
'j' = 6A
'k' = 6B
'l' = 6C
'm' = 6D
'n' = 6E
'o' = 6F
'p' = 70
'q' = 71
'r' = 72
's' = 73
't' = 74
'u' = 75
'v' = 76
'w' = 77
'x' = 78
'y' = 79
'z' = 7A
'{' = 7B
'|' = 7C
'}' = 7D
'~' = 7E
'€' = 80
'⋯' = 85
'†' = 86
'ˆ' = 88
'‰' = 89
'Š' = 8A
'' = 8B
'Œ' = 8C
'Ž' = 8E
'•' = 8F
'' = 91
'' = 92
'“' = 93
'”' = 94
'™' = 99
'š' = 9A
'' = 9B
'œ' = 9C
'ž' = 9E
'Ÿ' = 9F
'¡' = A1
'¢' = A2
'£' = A3
'¤' = A4
'¥' = A5
'¦' = A6
'§' = A7
'¨' = A8
'©' = A9
'ª' = AA
'«' = AB
'¬' = AC
'—' = AD
'®' = AE
'¯' = AF
'°' = B0
'±' = B1
'²' = B2
'³' = B3
'´' = B4
'µ' = B5
'¶' = B6
'„' = B7
'' = B8
'¹' = B9
'⁰' = BA
'»' = BB
'←' = BC
'♂' = BD
'♀' = BE
'¿' = BF
'À' = C0
'Á' = C1
'Â' = C2
'Ã' = C3
'Ä' = C4
'Å' = C5
'Æ' = C6
'Ç' = C7
'È' = C8
'É' = C9
'Ê' = CA
'Ë' = CB
'Ì' = CC
'Í' = CD
'Î' = CE
'Ï' = CF
'Ð' = D0
'Ñ' = D1
'Ò' = D2
'Ó' = D3
'Ô' = D4
'Õ' = D5
'Ö' = D6
'×' = D7
'Ø' = D8
'Ù' = D9
'Ú' = DA
'Û' = DB
'Ü' = DC
'Ý' = DD
'Þ' = DE
'ß' = DF
'à' = E0
'á' = E1
'â' = E2
'ã' = E3
'ä' = E4
'å' = E5
'æ' = E6
'ç' = E7
'è' = E8
'é' = E9
'ê' = EA
'ë' = EB
'ì' = EC
'í' = ED
'î' = EE
'ï' = EF
'ð' = F0
'ñ' = F1
'ò' = F2
'ó' = F3
'ô' = F4
'õ' = F5
'ö' = F6
'÷' = F7
'ø' = F8
'ù' = F9
'ú' = FA
'û' = FB
'ü' = FC
'ý' = FD
'þ' = FE
'ÿ' = FF
POKE = 83 BF 83 C4
A_BUTTON = 87 50
B_BUTTON = 87 51
'\n' = 0A

199
constants/m4a_constants.inc Normal file
View File

@ -0,0 +1,199 @@
.equiv ID_NUMBER, 0x68736d53
.equiv PCM_DMA_BUF_SIZE, 1584
.equiv TONEDATA_TYPE_CGB, 0x07
.equiv TONEDATA_TYPE_FIX, 0x08
.equiv TONEDATA_TYPE_SPL, 0x40 @ key split
.equiv TONEDATA_TYPE_RHY, 0x80 @ rhythm
.macro struct_begin
.struct 0
.endm
.macro struct_field name, size
\name:
.struct \name + \size
.endm
struct_begin
struct_field o_SoundInfo_ident, 4
struct_field o_SoundInfo_pcmDmaCounter, 1
struct_field o_SoundInfo_reverb, 1
struct_field o_SoundInfo_maxChans, 1
struct_field o_SoundInfo_masterVolume, 1
struct_field o_SoundInfo_freq, 1
struct_field o_SoundInfo_mode, 1
struct_field o_SoundInfo_c15, 1
struct_field o_SoundInfo_pcmDmaPeriod, 1
struct_field o_SoundInfo_maxLines, 1
struct_field o_SoundInfo_gap, 3
struct_field o_SoundInfo_pcmSamplesPerVBlank, 4
struct_field o_SoundInfo_pcmFreq, 4
struct_field o_SoundInfo_divFreq, 4
struct_field o_SoundInfo_cgbChans, 4
struct_field o_SoundInfo_func, 4
struct_field o_SoundInfo_intp, 4
struct_field o_SoundInfo_CgbSound, 4
struct_field o_SoundInfo_CgbOscOff, 4
struct_field o_SoundInfo_MidiKeyToCgbFreq, 4
struct_field o_SoundInfo_MPlayJumpTable, 4
struct_field o_SoundInfo_plynote, 4
struct_field o_SoundInfo_ExtVolPit, 4
struct_field o_SoundInfo_gap2, 16
struct_field o_SoundInfo_chans, 768
struct_field o_SoundInfo_pcmBuffer, PCM_DMA_BUF_SIZE * 2
struct_field SoundInfo_size, 0
struct_begin
struct_field o_SoundChannel_status, 1
struct_field o_SoundChannel_type, 1
struct_field o_SoundChannel_rightVolume, 1
struct_field o_SoundChannel_leftVolume, 1
struct_field o_SoundChannel_attack, 1
struct_field o_SoundChannel_decay, 1
struct_field o_SoundChannel_sustain, 1
struct_field o_SoundChannel_release, 1
struct_field o_SoundChannel_ky, 1
struct_field o_SoundChannel_ev, 1
struct_field o_SoundChannel_er, 1
struct_field o_SoundChannel_el, 1
struct_field o_SoundChannel_iev, 1
struct_field o_SoundChannel_iel, 1
struct_field o_SoundChannel_d1, 1
struct_field o_SoundChannel_d2, 1
struct_field o_SoundChannel_gt, 1
struct_field o_SoundChannel_mk, 1
struct_field o_SoundChannel_ve, 1
struct_field o_SoundChannel_pr, 1
struct_field o_SoundChannel_rp, 1
struct_field o_SoundChannel_d3, 3
struct_field o_SoundChannel_ct, 4
struct_field o_SoundChannel_fw, 4
struct_field o_SoundChannel_freq, 4
struct_field o_SoundChannel_wav, 4
struct_field o_SoundChannel_cp, 4
struct_field o_SoundChannel_track, 4
struct_field o_SoundChannel_pp, 4
struct_field o_SoundChannel_np, 4
struct_field o_SoundChannel_d4, 4
struct_field o_SoundChannel_xpi, 2
struct_field o_SoundChannel_xpc, 2
struct_field SoundChannel_size, 0
struct_begin
struct_field o_MusicPlayerTrack_flags, 1
struct_field o_MusicPlayerTrack_wait, 1
struct_field o_MusicPlayerTrack_patternLevel, 1
struct_field o_MusicPlayerTrack_repN, 1
struct_field o_MusicPlayerTrack_gateTime, 1
struct_field o_MusicPlayerTrack_key, 1
struct_field o_MusicPlayerTrack_velocity, 1
struct_field o_MusicPlayerTrack_runningStatus, 1
struct_field o_MusicPlayerTrack_keyM, 1
struct_field o_MusicPlayerTrack_pitM, 1
struct_field o_MusicPlayerTrack_keyShift, 1
struct_field o_MusicPlayerTrack_keyShiftX, 1
struct_field o_MusicPlayerTrack_tune, 1
struct_field o_MusicPlayerTrack_pitX, 1
struct_field o_MusicPlayerTrack_bend, 1
struct_field o_MusicPlayerTrack_bendRange, 1
struct_field o_MusicPlayerTrack_volMR, 1
struct_field o_MusicPlayerTrack_volML, 1
struct_field o_MusicPlayerTrack_vol, 1
struct_field o_MusicPlayerTrack_volX, 1
struct_field o_MusicPlayerTrack_pan, 1
struct_field o_MusicPlayerTrack_panX, 1
struct_field o_MusicPlayerTrack_modM, 1
struct_field o_MusicPlayerTrack_mod, 1
struct_field o_MusicPlayerTrack_modT, 1
struct_field o_MusicPlayerTrack_lfoSpeed, 1
struct_field o_MusicPlayerTrack_lfoSpeedC, 1
struct_field o_MusicPlayerTrack_lfoDelay, 1
struct_field o_MusicPlayerTrack_lfoDelayC, 1
struct_field o_MusicPlayerTrack_priority, 1
struct_field o_MusicPlayerTrack_echoVolume, 1
struct_field o_MusicPlayerTrack_echoLength, 1
struct_field o_MusicPlayerTrack_chan, 4
struct_field o_MusicPlayerTrack_ToneData_type, 1
struct_field o_MusicPlayerTrack_ToneData_key, 1
struct_field o_MusicPlayerTrack_ToneData_length, 1
struct_field o_MusicPlayerTrack_ToneData_pan_sweep, 1
struct_field o_MusicPlayerTrack_ToneData_wav, 4
struct_field o_MusicPlayerTrack_ToneData_attack, 1
struct_field o_MusicPlayerTrack_ToneData_decay, 1
struct_field o_MusicPlayerTrack_ToneData_sustain, 1
struct_field o_MusicPlayerTrack_ToneData_release, 1
struct_field o_MusicPlayerTrack_gap, 10
struct_field o_MusicPlayerTrack_unk_3A, 2
struct_field o_MusicPlayerTrack_unk_3C, 4
struct_field o_MusicPlayerTrack_cmdPtr, 4
struct_field o_MusicPlayerTrack_patternStack, 12
struct_field MusicPlayerTrack_size, 0
.equiv o_MusicPlayerTrack_ToneData_keySplitTable, o_MusicPlayerTrack_ToneData_attack
struct_begin
struct_field o_MusicPlayerInfo_songHeader, 4
struct_field o_MusicPlayerInfo_status, 4
struct_field o_MusicPlayerInfo_trackCount, 1
struct_field o_MusicPlayerInfo_priority, 1
struct_field o_MusicPlayerInfo_cmd, 1
struct_field o_MusicPlayerInfo_unk_B, 1
struct_field o_MusicPlayerInfo_clock, 4
struct_field o_MusicPlayerInfo_gap, 8
struct_field o_MusicPlayerInfo_memAccArea, 4
struct_field o_MusicPlayerInfo_tempoD, 2
struct_field o_MusicPlayerInfo_tempoU, 2
struct_field o_MusicPlayerInfo_tempoI, 2
struct_field o_MusicPlayerInfo_tempoC, 2
struct_field o_MusicPlayerInfo_fadeOI, 2
struct_field o_MusicPlayerInfo_fadeOC, 2
struct_field o_MusicPlayerInfo_fadeOV, 2
struct_field o_MusicPlayerInfo_padding, 2
struct_field o_MusicPlayerInfo_tracks, 4
struct_field o_MusicPlayerInfo_tone, 4
struct_field o_MusicPlayerInfo_ident, 4
struct_field o_MusicPlayerInfo_func, 4
struct_field o_MusicPlayerInfo_intp, 4
struct_field MusicPlayerInfo_size, 0
struct_begin
struct_field o_CgbChannel_sf, 1
struct_field o_CgbChannel_ty, 1
struct_field o_CgbChannel_rightVolume, 1
struct_field o_CgbChannel_leftVolume, 1
struct_field o_CgbChannel_at, 1
struct_field o_CgbChannel_de, 1
struct_field o_CgbChannel_su, 1
struct_field o_CgbChannel_re, 1
struct_field o_CgbChannel_ky, 1
struct_field o_CgbChannel_ev, 1
struct_field o_CgbChannel_eg, 1
struct_field o_CgbChannel_ec, 1
struct_field o_CgbChannel_echoVolume, 1
struct_field o_CgbChannel_echoLength, 1
struct_field o_CgbChannel_d1, 1
struct_field o_CgbChannel_d2, 1
struct_field o_CgbChannel_gt, 1
struct_field o_CgbChannel_mk, 1
struct_field o_CgbChannel_ve, 1
struct_field o_CgbChannel_pr, 1
struct_field o_CgbChannel_rp, 1
struct_field o_CgbChannel_d3, 3
struct_field o_CgbChannel_d5, 1
struct_field o_CgbChannel_sg, 1
struct_field o_CgbChannel_n4, 1
struct_field o_CgbChannel_pan, 1
struct_field o_CgbChannel_panMask, 1
struct_field o_CgbChannel_mo, 1
struct_field o_CgbChannel_le, 1
struct_field o_CgbChannel_sw, 1
struct_field o_CgbChannel_fr, 4
struct_field o_CgbChannel_wp, 4
struct_field o_CgbChannel_cp, 4
struct_field o_CgbChannel_tp, 4
struct_field o_CgbChannel_pp, 4
struct_field o_CgbChannel_np, 4
struct_field o_CgbChannel_d4, 8
struct_field CgbChannel_size, 0

View File

@ -22,37 +22,7 @@ gUnknown_80B69F8: @ 80B69F8
gUnknown_80B6A28: @ 80B6A28
.incbin "baserom.gba", 0xB6A28, 0xC
.global gUnknown_80B6A34
gUnknown_80B6A34: @ 80B6A34
.incbin "baserom.gba", 0xB6A34, 0x48
.global gUnknown_80B6A7C
gUnknown_80B6A7C: @ 80B6A7C
.incbin "baserom.gba", 0xB6A7C, 0x24
.global gUnknown_80B6AA0
gUnknown_80B6AA0: @ 80B6AA0
.incbin "baserom.gba", 0xB6AA0, 0x74
.global gUnknown_80B6B14
gUnknown_80B6B14: @ 80B6B14
.incbin "baserom.gba", 0xB6B14, 0x64
.global gUnknown_80B6B78
gUnknown_80B6B78: @ 80B6B78
.incbin "baserom.gba", 0xB6B78, 0x10
.global gUnknown_80B6B88
gUnknown_80B6B88: @ 80B6B88
.incbin "baserom.gba", 0xB6B88, 0x54
.global gUnknown_80B6BDC
gUnknown_80B6BDC: @ 80B6BDC
.incbin "baserom.gba", 0xB6BDC, 0xDC
.global gUnknown_80B6CB8
gUnknown_80B6CB8: @ 80B6CB8
.incbin "baserom.gba", 0xB6CB8, 0xD8
.include "data/text/save.inc"
.global gUnknown_80B6D90
gUnknown_80B6D90: @ 80B6D90

View File

@ -156,7 +156,9 @@ gUnknown_80D40FC: @ 80D40FC
.global gUnknown_80D4104
gUnknown_80D4104: @ 80D4104
.incbin "baserom.gba", 0xD4104, 0x1C
.string "Where would you like to go?"
.byte 0
.align 2, 0
.global gUnknown_80D4120
gUnknown_80D4120: @ 80D4120
@ -1286,85 +1288,7 @@ gUnknown_80DCA24: @ 80DCA24
gUnknown_80DCA2C: @ 80DCA2C
.incbin "baserom.gba", 0xDCA2C, 0x8
.global gUnknown_80DCA34
gUnknown_80DCA34: @ 80DCA34
.incbin "baserom.gba", 0xDCA34, 0x84
.global gUnknown_80DCAB8
gUnknown_80DCAB8: @ 80DCAB8
.incbin "baserom.gba", 0xDCAB8, 0x18
.global gUnknown_80DCAD0
gUnknown_80DCAD0: @ 80DCAD0
.incbin "baserom.gba", 0xDCAD0, 0x28C
.global gUnknown_80DCD5C
gUnknown_80DCD5C: @ 80DCD5C
.incbin "baserom.gba", 0xDCD5C, 0x34
.global gUnknown_80DCD90
gUnknown_80DCD90: @ 80DCD90
.incbin "baserom.gba", 0xDCD90, 0x28
.global gUnknown_80DCDB8
gUnknown_80DCDB8: @ 80DCDB8
.incbin "baserom.gba", 0xDCDB8, 0x24
.global gUnknown_80DCDDC
gUnknown_80DCDDC: @ 80DCDDC
.incbin "baserom.gba", 0xDCDDC, 0x3C
.global gUnknown_80DCE18
gUnknown_80DCE18: @ 80DCE18
.incbin "baserom.gba", 0xDCE18, 0x20
.global gUnknown_80DCE38
gUnknown_80DCE38: @ 80DCE38
.incbin "baserom.gba", 0xDCE38, 0x30
.global gUnknown_80DCE68
gUnknown_80DCE68: @ 80DCE68
.incbin "baserom.gba", 0xDCE68, 0x48
.global gUnknown_80DCEB0
gUnknown_80DCEB0: @ 80DCEB0
.incbin "baserom.gba", 0xDCEB0, 0x2C
.global gUnknown_80DCEDC
gUnknown_80DCEDC: @ 80DCEDC
.incbin "baserom.gba", 0xDCEDC, 0x68
.global gUnknown_80DCF44
gUnknown_80DCF44: @ 80DCF44
.incbin "baserom.gba", 0xDCF44, 0x44
.global gUnknown_80DCF88
gUnknown_80DCF88: @ 80DCF88
.incbin "baserom.gba", 0xDCF88, 0x24
.global gUnknown_80DCFAC
gUnknown_80DCFAC: @ 80DCFAC
.incbin "baserom.gba", 0xDCFAC, 0x48
.global gUnknown_80DCFF4
gUnknown_80DCFF4: @ 80DCFF4
.incbin "baserom.gba", 0xDCFF4, 0x60
.global gUnknown_80DD054
gUnknown_80DD054: @ 80DD054
.incbin "baserom.gba", 0xDD054, 0x44
.global gUnknown_80DD098
gUnknown_80DD098: @ 80DD098
.incbin "baserom.gba", 0xDD098, 0x48
.global gUnknown_80DD0E0
gUnknown_80DD0E0: @ 80DD0E0
.incbin "baserom.gba", 0xDD0E0, 0x24
.global gUnknown_80DD104
gUnknown_80DD104: @ 80DD104
.incbin "baserom.gba", 0xDD104, 0x44
.include "data/text/luminous_cave.inc"
.global gUnknown_80DD148
gUnknown_80DD148: @ 80DD148
@ -1458,93 +1382,7 @@ gUnknown_80DD358: @ 80DD358
gUnknown_80DD370: @ 80DD370
.incbin "baserom.gba", 0xDD370, 0x18
.global gUnknown_80DD388
gUnknown_80DD388: @ 80DD388
.incbin "baserom.gba", 0xDD388, 0x98
.global gUnknown_80DD420
gUnknown_80DD420: @ 80DD420
.incbin "baserom.gba", 0xDD420, 0xA4
.global gUnknown_80DD4C4
gUnknown_80DD4C4: @ 80DD4C4
.incbin "baserom.gba", 0xDD4C4, 0x30
.global gUnknown_80DD4F4
gUnknown_80DD4F4: @ 80DD4F4
.incbin "baserom.gba", 0xDD4F4, 0x40
.global gUnknown_80DD534
gUnknown_80DD534: @ 80DD534
.incbin "baserom.gba", 0xDD534, 0x30
.global gUnknown_80DD564
gUnknown_80DD564: @ 80DD564
.incbin "baserom.gba", 0xDD564, 0x30
.global gUnknown_80DD594
gUnknown_80DD594: @ 80DD594
.incbin "baserom.gba", 0xDD594, 0x24
.global gUnknown_80DD5B8
gUnknown_80DD5B8: @ 80DD5B8
.incbin "baserom.gba", 0xDD5B8, 0x54
.global gUnknown_80DD60C
gUnknown_80DD60C: @ 80DD60C
.incbin "baserom.gba", 0xDD60C, 0x30
.global gUnknown_80DD63C
gUnknown_80DD63C: @ 80DD63C
.incbin "baserom.gba", 0xDD63C, 0x28
.global gUnknown_80DD664
gUnknown_80DD664: @ 80DD664
.incbin "baserom.gba", 0xDD664, 0xC
.global gUnknown_80DD670
gUnknown_80DD670: @ 80DD670
.incbin "baserom.gba", 0xDD670, 0xC
.global gUnknown_80DD67C
gUnknown_80DD67C: @ 80DD67C
.incbin "baserom.gba", 0xDD67C, 0xC
.global gUnknown_80DD688
gUnknown_80DD688: @ 80DD688
.incbin "baserom.gba", 0xDD688, 0xC
.global gUnknown_80DD694
gUnknown_80DD694: @ 80DD694
.incbin "baserom.gba", 0xDD694, 0x8
.global gUnknown_80DD69C
gUnknown_80DD69C: @ 80DD69C
.incbin "baserom.gba", 0xDD69C, 0x8
.global gUnknown_80DD6A4
gUnknown_80DD6A4: @ 80DD6A4
.incbin "baserom.gba", 0xDD6A4, 0x10
.global gUnknown_80DD6B4
gUnknown_80DD6B4: @ 80DD6B4
.incbin "baserom.gba", 0xDD6B4, 0x8
.global gUnknown_80DD6BC
gUnknown_80DD6BC: @ 80DD6BC
.incbin "baserom.gba", 0xDD6BC, 0x8
.global gUnknown_80DD6C4
gUnknown_80DD6C4: @ 80DD6C4
.incbin "baserom.gba", 0xDD6C4, 0xC
.global gUnknown_80DD6D0
gUnknown_80DD6D0: @ 80DD6D0
.incbin "baserom.gba", 0xDD6D0, 0x10
.global gUnknown_80DD6E0
gUnknown_80DD6E0: @ 80DD6E0
.incbin "baserom.gba", 0xDD6E0, 0xC
.include "data/text/party_menu.inc"
.global gUnknown_80DD6EC
gUnknown_80DD6EC: @ 80DD6EC
@ -1662,218 +1500,8 @@ gUnknown_80DDB24: @ 80DDB24
gUnknown_80DDB60: @ 80DDB60
.incbin "baserom.gba", 0xDDB60, 0x48
.global gUnknown_80DDBA8
gUnknown_80DDBA8: @ 80DDBA8
.incbin "baserom.gba", 0xDDBA8, 0x54
.global gUnknown_80DDBFC
gUnknown_80DDBFC: @ 80DDBFC
.incbin "baserom.gba", 0xDDBFC, 0x34
.global gUnknown_80DDC30
gUnknown_80DDC30: @ 80DDC30
.incbin "baserom.gba", 0xDDC30, 0x40
.global gUnknown_80DDC70
gUnknown_80DDC70: @ 80DDC70
.incbin "baserom.gba", 0xDDC70, 0x4C
.global gUnknown_80DDCBC
gUnknown_80DDCBC: @ 80DDCBC
.incbin "baserom.gba", 0xDDCBC, 0x70
.global gUnknown_80DDD2C
gUnknown_80DDD2C: @ 80DDD2C
.incbin "baserom.gba", 0xDDD2C, 0x5C
.global gUnknown_80DDD88
gUnknown_80DDD88: @ 80DDD88
.incbin "baserom.gba", 0xDDD88, 0x34
.global gUnknown_80DDDBC
gUnknown_80DDDBC: @ 80DDDBC
.incbin "baserom.gba", 0xDDDBC, 0x1C
.global gUnknown_80DDDD8
gUnknown_80DDDD8: @ 80DDDD8
.incbin "baserom.gba", 0xDDDD8, 0x48
.global gUnknown_80DDE20
gUnknown_80DDE20: @ 80DDE20
.incbin "baserom.gba", 0xDDE20, 0x38
.global gUnknown_80DDE58
gUnknown_80DDE58: @ 80DDE58
.incbin "baserom.gba", 0xDDE58, 0x68
.global gUnknown_80DDEC0
gUnknown_80DDEC0: @ 80DDEC0
.incbin "baserom.gba", 0xDDEC0, 0x6C
.global gUnknown_80DDF2C
gUnknown_80DDF2C: @ 80DDF2C
.incbin "baserom.gba", 0xDDF2C, 0x8C
.global gUnknown_80DDFB8
gUnknown_80DDFB8: @ 80DDFB8
.incbin "baserom.gba", 0xDDFB8, 0x64
.global gUnknown_80DE01C
gUnknown_80DE01C: @ 80DE01C
.incbin "baserom.gba", 0xDE01C, 0x50
.global gUnknown_80DE06C
gUnknown_80DE06C: @ 80DE06C
.incbin "baserom.gba", 0xDE06C, 0x54
.global gUnknown_80DE0C0
gUnknown_80DE0C0: @ 80DE0C0
.incbin "baserom.gba", 0xDE0C0, 0x64
.global gUnknown_80DE124
gUnknown_80DE124: @ 80DE124
.incbin "baserom.gba", 0xDE124, 0x54
.global gUnknown_80DE178
gUnknown_80DE178: @ 80DE178
.incbin "baserom.gba", 0xDE178, 0x3C
.global gUnknown_80DE1B4
gUnknown_80DE1B4: @ 80DE1B4
.incbin "baserom.gba", 0xDE1B4, 0x30
.global gUnknown_80DE1E4
gUnknown_80DE1E4: @ 80DE1E4
.incbin "baserom.gba", 0xDE1E4, 0x9C
.global gUnknown_80DE280
gUnknown_80DE280: @ 80DE280
.incbin "baserom.gba", 0xDE280, 0x30
.global gUnknown_80DE2B0
gUnknown_80DE2B0: @ 80DE2B0
.incbin "baserom.gba", 0xDE2B0, 0xB8
.global gUnknown_80DE368
gUnknown_80DE368: @ 80DE368
.incbin "baserom.gba", 0xDE368, 0xC8
.global gUnknown_80DE430
gUnknown_80DE430: @ 80DE430
.incbin "baserom.gba", 0xDE430, 0x5C
.global gUnknown_80DE48C
gUnknown_80DE48C: @ 80DE48C
.incbin "baserom.gba", 0xDE48C, 0x2C
.global gUnknown_80DE4B8
gUnknown_80DE4B8: @ 80DE4B8
.incbin "baserom.gba", 0xDE4B8, 0x38
.global gUnknown_80DE4F0
gUnknown_80DE4F0: @ 80DE4F0
.incbin "baserom.gba", 0xDE4F0, 0x34
.global gUnknown_80DE524
gUnknown_80DE524: @ 80DE524
.incbin "baserom.gba", 0xDE524, 0xF0
.global gUnknown_80DE614
gUnknown_80DE614: @ 80DE614
.incbin "baserom.gba", 0xDE614, 0x34
.global gUnknown_80DE648
gUnknown_80DE648: @ 80DE648
.incbin "baserom.gba", 0xDE648, 0x4C
.global gUnknown_80DE694
gUnknown_80DE694: @ 80DE694
.incbin "baserom.gba", 0xDE694, 0x40
.global gUnknown_80DE6D4
gUnknown_80DE6D4: @ 80DE6D4
.incbin "baserom.gba", 0xDE6D4, 0x80
.global gUnknown_80DE754
gUnknown_80DE754: @ 80DE754
.incbin "baserom.gba", 0xDE754, 0x64
.global gUnknown_80DE7B8
gUnknown_80DE7B8: @ 80DE7B8
.incbin "baserom.gba", 0xDE7B8, 0x30
.global gUnknown_80DE7E8
gUnknown_80DE7E8: @ 80DE7E8
.incbin "baserom.gba", 0xDE7E8, 0x20
.global gUnknown_80DE808
gUnknown_80DE808: @ 80DE808
.incbin "baserom.gba", 0xDE808, 0x28
.global gUnknown_80DE830
gUnknown_80DE830: @ 80DE830
.incbin "baserom.gba", 0xDE830, 0x34
.global gUnknown_80DE864
gUnknown_80DE864: @ 80DE864
.incbin "baserom.gba", 0xDE864, 0x50
.global gUnknown_80DE8B4
gUnknown_80DE8B4: @ 80DE8B4
.incbin "baserom.gba", 0xDE8B4, 0x64
.global gUnknown_80DE918
gUnknown_80DE918: @ 80DE918
.incbin "baserom.gba", 0xDE918, 0x24
.global gUnknown_80DE93C
gUnknown_80DE93C: @ 80DE93C
.incbin "baserom.gba", 0xDE93C, 0x18
.global gUnknown_80DE954
gUnknown_80DE954: @ 80DE954
.incbin "baserom.gba", 0xDE954, 0x38
.global gUnknown_80DE98C
gUnknown_80DE98C: @ 80DE98C
.incbin "baserom.gba", 0xDE98C, 0x64
.global gUnknown_80DE9F0
gUnknown_80DE9F0: @ 80DE9F0
.incbin "baserom.gba", 0xDE9F0, 0x68
.global gUnknown_80DEA58
gUnknown_80DEA58: @ 80DEA58
.incbin "baserom.gba", 0xDEA58, 0x5C
.global gUnknown_80DEAB4
gUnknown_80DEAB4: @ 80DEAB4
.incbin "baserom.gba", 0xDEAB4, 0x64
.global gUnknown_80DEB18
gUnknown_80DEB18: @ 80DEB18
.incbin "baserom.gba", 0xDEB18, 0x3C
.global gUnknown_80DEB54
gUnknown_80DEB54: @ 80DEB54
.incbin "baserom.gba", 0xDEB54, 0xAC
.global gUnknown_80DEC00
gUnknown_80DEC00: @ 80DEC00
.incbin "baserom.gba", 0xDEC00, 0x70
.global gUnknown_80DEC70
gUnknown_80DEC70: @ 80DEC70
.incbin "baserom.gba", 0xDEC70, 0x50
.global gUnknown_80DECC0
gUnknown_80DECC0: @ 80DECC0
.incbin "baserom.gba", 0xDECC0, 0x3C
.global gUnknown_80DECFC
gUnknown_80DECFC: @ 80DECFC
.incbin "baserom.gba", 0xDECFC, 0x48
.include "data/text/wonder_mail_1.inc"
.global gUnknown_80DED44
gUnknown_80DED44: @ 80DED44
.incbin "baserom.gba", 0xDED44, 0x4
@ -1918,169 +1546,7 @@ gUnknown_80DEEBC: @ 80DEEBC
gUnknown_80DEEE4: @ 80DEEE4
.incbin "baserom.gba", 0xDEEE4, 0x20
.global gUnknown_80DEF04
gUnknown_80DEF04: @ 80DEF04
.incbin "baserom.gba", 0xDEF04, 0x24
.global gUnknown_80DEF28
gUnknown_80DEF28: @ 80DEF28
.incbin "baserom.gba", 0xDEF28, 0x58
.global gUnknown_80DEF80
gUnknown_80DEF80: @ 80DEF80
.incbin "baserom.gba", 0xDEF80, 0x5C
.global gUnknown_80DEFDC
gUnknown_80DEFDC: @ 80DEFDC
.incbin "baserom.gba", 0xDEFDC, 0x68
.global gUnknown_80DF044
gUnknown_80DF044: @ 80DF044
.incbin "baserom.gba", 0xDF044, 0x5C
.global gUnknown_80DF0A0
gUnknown_80DF0A0: @ 80DF0A0
.incbin "baserom.gba", 0xDF0A0, 0x40
.global gUnknown_80DF0E0
gUnknown_80DF0E0: @ 80DF0E0
.incbin "baserom.gba", 0xDF0E0, 0x58
.global gUnknown_80DF138
gUnknown_80DF138: @ 80DF138
.incbin "baserom.gba", 0xDF138, 0x5C
.global gUnknown_80DF194
gUnknown_80DF194: @ 80DF194
.incbin "baserom.gba", 0xDF194, 0x2C
.global gUnknown_80DF1C0
gUnknown_80DF1C0: @ 80DF1C0
.incbin "baserom.gba", 0xDF1C0, 0x48
.global gUnknown_80DF208
gUnknown_80DF208: @ 80DF208
.incbin "baserom.gba", 0xDF208, 0x48
.global gUnknown_80DF250
gUnknown_80DF250: @ 80DF250
.incbin "baserom.gba", 0xDF250, 0xB4
.global gUnknown_80DF304
gUnknown_80DF304: @ 80DF304
.incbin "baserom.gba", 0xDF304, 0x2C
.global gUnknown_80DF330
gUnknown_80DF330: @ 80DF330
.incbin "baserom.gba", 0xDF330, 0x50
.global gUnknown_80DF380
gUnknown_80DF380: @ 80DF380
.incbin "baserom.gba", 0xDF380, 0x34
.global gUnknown_80DF3B4
gUnknown_80DF3B4: @ 80DF3B4
.incbin "baserom.gba", 0xDF3B4, 0x64
.global gUnknown_80DF418
gUnknown_80DF418: @ 80DF418
.incbin "baserom.gba", 0xDF418, 0x34
.global gUnknown_80DF44C
gUnknown_80DF44C: @ 80DF44C
.incbin "baserom.gba", 0xDF44C, 0x20
.global gUnknown_80DF46C
gUnknown_80DF46C: @ 80DF46C
.incbin "baserom.gba", 0xDF46C, 0x88
.global gUnknown_80DF4F4
gUnknown_80DF4F4: @ 80DF4F4
.incbin "baserom.gba", 0xDF4F4, 0x50
.global gUnknown_80DF544
gUnknown_80DF544: @ 80DF544
.incbin "baserom.gba", 0xDF544, 0x50
.global gUnknown_80DF594
gUnknown_80DF594: @ 80DF594
.incbin "baserom.gba", 0xDF594, 0x50
.global gUnknown_80DF5E4
gUnknown_80DF5E4: @ 80DF5E4
.incbin "baserom.gba", 0xDF5E4, 0x58
.global gUnknown_80DF63C
gUnknown_80DF63C: @ 80DF63C
.incbin "baserom.gba", 0xDF63C, 0x58
.global gUnknown_80DF694
gUnknown_80DF694: @ 80DF694
.incbin "baserom.gba", 0xDF694, 0x5C
.global gUnknown_80DF6F0
gUnknown_80DF6F0: @ 80DF6F0
.incbin "baserom.gba", 0xDF6F0, 0x20
.global gUnknown_80DF710
gUnknown_80DF710: @ 80DF710
.incbin "baserom.gba", 0xDF710, 0x2C
.global gUnknown_80DF73C
gUnknown_80DF73C: @ 80DF73C
.incbin "baserom.gba", 0xDF73C, 0x40
.global gUnknown_80DF77C
gUnknown_80DF77C: @ 80DF77C
.incbin "baserom.gba", 0xDF77C, 0x58
.global gUnknown_80DF7D4
gUnknown_80DF7D4: @ 80DF7D4
.incbin "baserom.gba", 0xDF7D4, 0x9C
.global gUnknown_80DF870
gUnknown_80DF870: @ 80DF870
.incbin "baserom.gba", 0xDF870, 0x44
.global gUnknown_80DF8B4
gUnknown_80DF8B4: @ 80DF8B4
.incbin "baserom.gba", 0xDF8B4, 0x38
.global gUnknown_80DF8EC
gUnknown_80DF8EC: @ 80DF8EC
.incbin "baserom.gba", 0xDF8EC, 0x3C
.global gUnknown_80DF928
gUnknown_80DF928: @ 80DF928
.incbin "baserom.gba", 0xDF928, 0x24
.global gUnknown_80DF94C
gUnknown_80DF94C: @ 80DF94C
.incbin "baserom.gba", 0xDF94C, 0x20
.global gUnknown_80DF96C
gUnknown_80DF96C: @ 80DF96C
.incbin "baserom.gba", 0xDF96C, 0x38
.global gUnknown_80DF9A4
gUnknown_80DF9A4: @ 80DF9A4
.incbin "baserom.gba", 0xDF9A4, 0x4C
.global gUnknown_80DF9F0
gUnknown_80DF9F0: @ 80DF9F0
.incbin "baserom.gba", 0xDF9F0, 0x8
.global gUnknown_80DF9F8
gUnknown_80DF9F8: @ 80DF9F8
.incbin "baserom.gba", 0xDF9F8, 0xB0
.global gUnknown_80DFAA8
gUnknown_80DFAA8: @ 80DFAA8
.incbin "baserom.gba", 0xDFAA8, 0x6C
.global gUnknown_80DFB14
gUnknown_80DFB14: @ 80DFB14
.incbin "baserom.gba", 0xDFB14, 0xBC
.include "data/text/wonder_mail_2.inc"
.global gUnknown_80DFBD0
gUnknown_80DFBD0: @ 80DFBD0
@ -2194,73 +1660,13 @@ gUnknown_80DFE04: @ 80DFE04
gUnknown_80DFE1C: @ 80DFE1C
.incbin "baserom.gba", 0xDFE1C, 0x30
.global gUnknown_80DFE4C
gUnknown_80DFE4C: @ 80DFE4C
.incbin "baserom.gba", 0xDFE4C, 0x50
.global gUnknown_80DFE9C
gUnknown_80DFE9C: @ 80DFE9C
.incbin "baserom.gba", 0xDFE9C, 0x34
.global gUnknown_80DFED0
gUnknown_80DFED0: @ 80DFED0
.incbin "baserom.gba", 0xDFED0, 0x5C
.global gUnknown_80DFF2C
gUnknown_80DFF2C: @ 80DFF2C
.incbin "baserom.gba", 0xDFF2C, 0x78
.global gUnknown_80DFFA4
gUnknown_80DFFA4: @ 80DFFA4
.incbin "baserom.gba", 0xDFFA4, 0x6C
.global gUnknown_80E0010
gUnknown_80E0010: @ 80E0010
.incbin "baserom.gba", 0xE0010, 0x64
.global gUnknown_80E0074
gUnknown_80E0074: @ 80E0074
.incbin "baserom.gba", 0xE0074, 0x20
.global gUnknown_80E0094
gUnknown_80E0094: @ 80E0094
.incbin "baserom.gba", 0xE0094, 0x74
.global gUnknown_80E0108
gUnknown_80E0108: @ 80E0108
.incbin "baserom.gba", 0xE0108, 0x44
.global gUnknown_80E014C
gUnknown_80E014C: @ 80E014C
.incbin "baserom.gba", 0xE014C, 0xC
.global gUnknown_80E0158
gUnknown_80E0158: @ 80E0158
.incbin "baserom.gba", 0xE0158, 0x14
.include "data/text/wonder_mail_3.inc"
.global gUnknown_80E016C
gUnknown_80E016C: @ 80E016C
.incbin "baserom.gba", 0xE016C, 0x18
.global gUnknown_80E0184
gUnknown_80E0184: @ 80E0184
.incbin "baserom.gba", 0xE0184, 0x1C
.global gUnknown_80E01A0
gUnknown_80E01A0: @ 80E01A0
.incbin "baserom.gba", 0xE01A0, 0x24
.global gUnknown_80E01C4
gUnknown_80E01C4: @ 80E01C4
.incbin "baserom.gba", 0xE01C4, 0x2C
.global gUnknown_80E01F0
gUnknown_80E01F0: @ 80E01F0
.incbin "baserom.gba", 0xE01F0, 0x28
.global gUnknown_80E0218
gUnknown_80E0218: @ 80E0218
.incbin "baserom.gba", 0xE0218, 0x30
.include "data/text/wonder_mail_complete.inc"
.global gUnknown_80E0248
gUnknown_80E0248: @ 80E0248
@ -2530,73 +1936,7 @@ gUnknown_80E0B3C: @ 80E0B3C
gUnknown_80E0BD4: @ 80E0BD4
.incbin "baserom.gba", 0xE0BD4, 0x78
.global gUnknown_80E0C4C
gUnknown_80E0C4C: @ 80E0C4C
.incbin "baserom.gba", 0xE0C4C, 0x24
.global gUnknown_80E0C70
gUnknown_80E0C70: @ 80E0C70
.incbin "baserom.gba", 0xE0C70, 0x160
.global gUnknown_80E0DD0
gUnknown_80E0DD0: @ 80E0DD0
.incbin "baserom.gba", 0xE0DD0, 0x108
.global gUnknown_80E0ED8
gUnknown_80E0ED8: @ 80E0ED8
.incbin "baserom.gba", 0xE0ED8, 0x1F0
.global gUnknown_80E10C8
gUnknown_80E10C8: @ 80E10C8
.incbin "baserom.gba", 0xE10C8, 0x144
.global gUnknown_80E120C
gUnknown_80E120C: @ 80E120C
.incbin "baserom.gba", 0xE120C, 0x160
.global gUnknown_80E136C
gUnknown_80E136C: @ 80E136C
.incbin "baserom.gba", 0xE136C, 0xB4
.global gUnknown_80E1420
gUnknown_80E1420: @ 80E1420
.incbin "baserom.gba", 0xE1420, 0x15C
.global gUnknown_80E157C
gUnknown_80E157C: @ 80E157C
.incbin "baserom.gba", 0xE157C, 0x120
.global gUnknown_80E169C
gUnknown_80E169C: @ 80E169C
.incbin "baserom.gba", 0xE169C, 0x12C
.global gUnknown_80E17C8
gUnknown_80E17C8: @ 80E17C8
.incbin "baserom.gba", 0xE17C8, 0x74
.global gUnknown_80E183C
gUnknown_80E183C: @ 80E183C
.incbin "baserom.gba", 0xE183C, 0x2C
.global gUnknown_80E1868
gUnknown_80E1868: @ 80E1868
.incbin "baserom.gba", 0xE1868, 0x1C8
.global gUnknown_80E1A30
gUnknown_80E1A30: @ 80E1A30
.incbin "baserom.gba", 0xE1A30, 0xA8
.global gUnknown_80E1AD8
gUnknown_80E1AD8: @ 80E1AD8
.incbin "baserom.gba", 0xE1AD8, 0xB0
.global gUnknown_80E1B88
gUnknown_80E1B88: @ 80E1B88
.incbin "baserom.gba", 0xE1B88, 0x1FC
.global gUnknown_80E1D84
gUnknown_80E1D84: @ 80E1D84
.incbin "baserom.gba", 0xE1D84, 0x178
.include "data/text/wonder_mail_4.inc"
.global gUnknown_80E1EFC
gUnknown_80E1EFC: @ 80E1EFC
@ -11966,42 +11306,3 @@ gUnknown_812F1F8: @ 812F1F8
gUnknown_813237C: @ 813237C
.incbin "baserom.gba", 0x13237C, 0x13D610
.global gUnknown_826F98C
gUnknown_826F98C: @ 826F98C
.incbin "baserom.gba", 0x26F98C, 0x90
.global gUnknown_826FA1C
gUnknown_826FA1C: @ 826FA1C
.incbin "baserom.gba", 0x26FA1C, 0xB4
.global gUnknown_826FAD0
gUnknown_826FAD0: @ 826FAD0
.incbin "baserom.gba", 0x26FAD0, 0x30
.global gUnknown_826FB00
gUnknown_826FB00: @ 826FB00
.incbin "baserom.gba", 0x26FB00, 0x18
.global gUnknown_826FB18
gUnknown_826FB18: @ 826FB18
.incbin "baserom.gba", 0x26FB18, 0x84
.global gUnknown_826FB9C
gUnknown_826FB9C: @ 826FB9C
.incbin "baserom.gba", 0x26FB9C, 0x18
.global gUnknown_826FBB4
gUnknown_826FBB4: @ 826FBB4
.incbin "baserom.gba", 0x26FBB4, 0x3C
.global gUnknown_826FBF0
gUnknown_826FBF0: @ 826FBF0
.incbin "baserom.gba", 0x26FBF0, 0x10
.global gUnknown_826FC00
gUnknown_826FC00: @ 826FC00
.incbin "baserom.gba", 0x26FC00, 0x34
.global gUnknown_826FC34
gUnknown_826FC34: @ 826FC34
.incbin "baserom.gba", 0x26FC34, 0x30

View File

@ -1,9 +1,8 @@
.section .rodata
.global gUnknown_9E8665C
gUnknown_9E8665C: @ 9E8665C
.incbin "baserom.gba", 0x1E8665C, 0x60
.include "include/macros/m4a.inc"
.global gUnknown_9E866BC
gUnknown_9E866BC: @ 9E866BC
.incbin "baserom.gba", 0x1E866BC
.include "sound/music_player_table.inc"
.include "sound/song_table.inc"
.incbin "baserom.gba", 0x1E8841C

131
data/text/luminous_cave.inc Normal file
View File

@ -0,0 +1,131 @@
gUnknown_80DCA34:: @ 80DCA34
.string "#+...#WA voice emanates from somewhere...#P#+...Ye who seek awak"
.string "ening...#P#+This is Luminous Cave.#W\n"
.string "#+Do ye seek a new evolution?"
.byte 0
.align 2, 0
gUnknown_80DCAB8:: @ 80DCAB8
.string "#+Do ye seek evolution?"
.byte 0
.align 2, 0
gUnknown_80DCAD0:: @ 80DCAD0
.string "#+There are those among Pokémon\n"
.string "#+that can evolve.#P#+Such Pokémon can evolve at this very\n"
.string "#+spot if they satisfy certain conditions.#P#+Evolution brings about changes\n"
.string "#+in appearance and abilities.#P#+Not only that~2c some Pokémon even change\n"
.string "#+type and learn different moves.#P#+However...#W The requirements for\n"
.string "#+evolution differ among Pokémon.#P#+Some become ready for evolution\n"
.string "#+merely by leveling up.#P#+Still others may need special items\n"
.string "#+to attain evolution.#P#+Ye must also be aware of this:#P#+Once it has evolved~2c a Pokémon\n"
.string "#+can never regain its previous form.#P#+That is why ye must think carefully\n"
.string "#+before committing to evolution."
.byte 0
.align 2, 0
gUnknown_80DCD5C:: @ 80DCD5C
.string "#+Ye shall return if evolution\n"
.string "#+is what ye seek..."
.byte 0
.align 2, 0
gUnknown_80DCD90:: @ 80DCD90
.string "#+Will ye give an item for evolution?"
.byte 0
.align 2, 0
gUnknown_80DCDB8:: @ 80DCDB8
.string "#+Will ye give yet another item?"
.byte 0
.align 2, 0
gUnknown_80DCDDC:: @ 80DCDDC
.string "#+Alas~2c ye seem to lack what is needed\n"
.string "#+for evolution."
.byte 0
.align 2, 0
gUnknown_80DCE18:: @ 80DCE18
.string "#+Ye seem to have but one item."
.byte 0
.align 2, 0
gUnknown_80DCE38:: @ 80DCE38
.string "#+...Ye who seek awakening...\n"
.string "#+Let us begin."
.byte 0
.align 2, 0
gUnknown_80DCE68:: @ 80DCE68
.string "#+...#W"
.byte 0x24
.string "n0 is undergoing changes...#P#+"
.byte 0x24
.string "n0~27s appearance changed...#P"
.byte 0
.align 2, 0
gUnknown_80DCEB0:: @ 80DCEB0
.string "#+It evolved from #C4"
.byte 0x24
.string "m0#R\n"
.string "#+to #C6"
.byte 0x24
.string "m1#R!"
.byte 0
.align 2, 0
gUnknown_80DCEDC:: @ 80DCEDC
.string "#+...#P#+One cannot evolve if one\n"
.string "#+is in the company of others.#P#+Come alone if ye wish to evolve."
.byte 0
.align 2, 0
gUnknown_80DCF44:: @ 80DCF44
.string "#+...#P#+Ye cannot evolve yet.#P#+Ye have not high enough a level."
.byte 0
.align 2, 0
gUnknown_80DCF88:: @ 80DCF88
.string "#+...#P#+Ye cannot evolve anymore."
.byte 0
.align 2, 0
gUnknown_80DCFAC:: @ 80DCFAC
.string "#+...#P#+Ye cannot evolve yet.#P#+Ye need your Friend Area to evolve."
.byte 0
.align 2, 0
gUnknown_80DCFF4:: @ 80DCFF4
.string "#+...#P#+Ye cannot evolve yet.#P#+The Friend Area to which ye shall go\n"
.string "#+has no room for ye."
.byte 0
.align 2, 0
gUnknown_80DD054:: @ 80DD054
.string "#+...#P#+Ye cannot evolve yet.#P#+Ye seem to lack the IQ to evolve."
.byte 0
.align 2, 0
gUnknown_80DD098:: @ 80DD098
.string "#+#+...#P#+Ye cannot evolve yet.#P#+Ye seem to lack an item to evolve."
.byte 0
.align 2, 0
gUnknown_80DD0E0:: @ 80DD0E0
.string "#+#+...#P#+Ye cannot evolve yet. "
.byte 0
.align 2, 0
gUnknown_80DD104:: @ 80DD104
.string "#+Ye must give a name to\n"
.string "#+the evolved Pokémon. "
.byte 0
.align 2, 0
.asciz "pksdir0"
.align 2, 0
.asciz "pksdir0"
.align 2, 0

147
data/text/party_menu.inc Normal file
View File

@ -0,0 +1,147 @@
gUnknown_80DD388:: @ 80DD388
.string "You have chosen to say farewell\n"
.string "to this Pokémon.#PThe Pokémon will leave its Friend Area.\n"
.string "It will no longer be available for\n"
.string "adventures. Is that OK?"
.byte 0
.align 2, 0
gUnknown_80DD420:: @ 80DD420
.string "If you say farewell to this\n"
.string "Pokémon~2c it will be gone forever.#PYou will never be able to get another one\n"
.string "like it to join your team.\n"
.string "Will you release it anyway?"
.byte 0
.align 2, 0
gUnknown_80DD4C4:: @ 80DD4C4
.string "#+"
.byte 0x24
.string "m1 joined the\n"
.string "#+rescue team for adventures!"
.byte 0
.align 2, 0
gUnknown_80DD4F4:: @ 80DD4F4
.string "#+"
.byte 0x24
.string "m1 left the team to remain\n"
.string "#+on standby in the Friend Area."
.byte 0
.align 2, 0
gUnknown_80DD534:: @ 80DD534
.string "#+"
.byte 0x24
.string "m1 became the leader\n"
.string "#+of the rescue team."
.byte 0
.align 2, 0
gUnknown_80DD564:: @ 80DD564
.string "#+"
.byte 0x24
.string "m1 left\n"
.string "#+the Friend Area.\n"
.string "#+Bye-bye~2c "
.byte 0x24
.string "m1!"
.byte 0
gUnknown_80DD594:: @ 80DD594
.string "#+The #C4"
.byte 0x24
.string "i1#R was\n"
.string "#+handed over. "
.byte 0
.align 2, 0
gUnknown_80DD5B8:: @ 80DD5B8
.string "#+The #C4"
.byte 0x24
.string "i1#R was\n"
.string "#+handed over.#P#+The #C4"
.byte 0x24
.string "i0#R was\n"
.string "#+returned to the Toolbox."
.byte 0
.align 2, 0
gUnknown_80DD60C:: @ 80DD60C
.string "#+The #C4"
.byte 0x24
.string "i0#R was\n"
.string "#+returned to the Toolbox."
.byte 0
.align 2, 0
gUnknown_80DD63C:: @ 80DD63C
.string "#+The #C4"
.byte 0x24
.string "i0#R was\n"
.string "#+sent to storage."
.byte 0
.align 2, 0
gUnknown_80DD664:: @ 80DD664
.string "Stand By"
.byte 0
.align 2, 0
gUnknown_80DD670:: @ 80DD670
.string "Make Leader"
.byte 0
gUnknown_80DD67C:: @ 80DD67C
.string "Join Team"
.byte 0
.align 2, 0
gUnknown_80DD688:: @ 80DD688
.string "Give Gummi"
.byte 0
.align 2, 0
gUnknown_80DD694:: @ 80DD694
.string "Give"
.byte 0
.align 2, 0
gUnknown_80DD69C:: @ 80DD69C
.string "Take"
.byte 0
.align 2, 0
gUnknown_80DD6A4:: @ 80DD6A4
.string "Say Farewell"
.byte 0
.align 2, 0
gUnknown_80DD6B4:: @ 80DD6B4
.string "Summary"
.byte 0
.align 2, 0
gUnknown_80DD6BC:: @ 80DD6BC
.string "Moves"
.byte 0
.align 2, 0
gUnknown_80DD6C4:: @ 80DD6C4
.string "Check IQ"
.byte 0
.align 2, 0
gUnknown_80DD6D0:: @ 80DD6D0
.string "Item: #C4"
.byte 0x24
.string "i0#R "
.byte 0
.align 2, 0
gUnknown_80DD6E0:: @ 80DD6E0
.string "%s"
.byte 0
.align 2, 0
.string "pksdir0"
.byte 0
.align 2, 0

57
data/text/save.inc Normal file
View File

@ -0,0 +1,57 @@
gUnknown_80B6A34:: @ 80B6A34
.string "#+Quicksaving your adventure...\n"
.string "#+Please don~27t turn off the power."
.byte 0
.align 2, 0
gUnknown_80B6A7C:: @ 80B6A7C
.string "#+Your adventure has been saved."
.byte 0
.align 2, 0
gUnknown_80B6AA0:: @ 80B6AA0
.string "#+Your adventure has been saved.\n"
.string "#+When you are in a dungeon~2c quicksave\n"
.string "#+your progress before ending the game."
.byte 0
.align 2, 0
gUnknown_80B6B14:: @ 80B6B14
.string "#+The data could not be written.\n"
.string "#+Please turn off the power and remove\n"
.string "#+and reinsert the DS Card."
.byte 0
.align 2, 0
gUnknown_80B6B78:: @ 80B6B78
.string "#+Save failed."
.byte 0
.align 2, 0
gUnknown_80B6B88:: @ 80B6B88
.string "#+Error reading data.\n"
.string "#+Please turn off the power and reinsert\n"
.string "#+the DS Game Card."
.byte 0
.align 2, 0
gUnknown_80B6BDC:: @ 80B6BDC
.string "#+Your data was not properly saved~2c\n"
.string "#+so your game cannot be resumed\n"
.string "#+from your last spot.#P#+Your last outing is considered a defeat.\n"
.string "#+Before shutting down~2c save in your\n"
.string "#+team base~2c or quicksave in a dungeon."
.byte 0
.align 2, 0
gUnknown_80B6CB8:: @ 80B6CB8
.string "#+You may not resume your dungeon\n"
.string "#+adventure using this saved data.\n"
.string "#+Your last outing is considered a defeat."
.byte 0
.align 2, 0
.asciz "pksdir0"
.align 2, 0
.incbin "baserom.gba", 0xB6D30, 0x60

347
data/text/wonder_mail_1.inc Normal file
View File

@ -0,0 +1,347 @@
gUnknown_80DDBA8:: @ 80DDBA8
.string " What you need to do is\n"
.string "tell your friend--the one you rescued--\n"
.string "this here password."
.byte 0
.align 2, 0
gUnknown_80DDBFC:: @ 80DDBFC
.string " All righty!\n"
.string "Here~27s your #CGA-OK Mail password#R."
.byte 0
.align 2, 0
gUnknown_80DDC30:: @ 80DDC30
.string " Okeydoke! That~27s all done.\n"
.string "Come around whenever you need."
.byte 0
.align 2, 0
gUnknown_80DDC70:: @ 80DDC70
.string " Okeydoke! I sent off your\n"
.string "#CGA-OK Mail#R.#P Let me save your adventure."
.byte 0
.align 2, 0
gUnknown_80DDCBC:: @ 80DDCBC
.string "#+Please choose the Pokémon you want to\n"
.string "#+send as a helper to your friend.\n"
.string "#+(Its hold item will not be sent.)"
.byte 0
.align 2, 0
gUnknown_80DDD2C:: @ 80DDD2C
.string " ...Uh~2c no?\n"
.string "There appear to be no Pokémon in your\n"
.string "Friend Areas. What do you want to do?"
.byte 0
.align 2, 0
gUnknown_80DDD88:: @ 80DDD88
.string " You~27re sure you want to\n"
.string "send this here Pokémon?"
.byte 0
.align 2, 0
gUnknown_80DDDBC:: @ 80DDDBC
.string " You~27re sure about this?"
.byte 0
.align 2, 0
gUnknown_80DDDD8:: @ 80DDDD8
.string " All righty. I need you to\n"
.string "pick the #CGA-OK Mail#R you want to send."
.byte 0
.align 2, 0
gUnknown_80DDE20:: @ 80DDE20
.string " ...Uh~2c no?\n"
.string "I don~27t see any #CGA-OK Mail#R here."
.byte 0
.align 2, 0
gUnknown_80DDE58:: @ 80DDE58
.string " Did you know? If you use\n"
.string "a #CGGame Link cable#R~2c you can send\n"
.string "a #CGhelper Pokémon#R to your friend."
.byte 0
.align 2, 0
gUnknown_80DDEC0:: @ 80DDEC0
.string " Don~27t you worry. Sending\n"
.string "a Pokémon doesn~27t mean it will go away.\n"
.string "So! Want to send one to your friend?"
.byte 0
.align 2, 0
gUnknown_80DDF2C:: @ 80DDF2C
.string " ...Uh~2c no?\n"
.string "There~27s no space at all to receive\n"
.string "any more mail.#P Delete some old mail~2c\n"
.string "and then come to me to receive\n"
.string "your mail~2c OK?"
.byte 0
.align 2, 0
gUnknown_80DDFB8:: @ 80DDFB8
.string " All righty! Connect up\n"
.string "the #CGGame Link cable#R~2c if you~27d please.\n"
.string "Your friend ready~2c too?"
.byte 0
.align 2, 0
gUnknown_80DE01C:: @ 80DE01C
.incbin "baserom.gba", 0xDE01C, 0x50
gUnknown_80DE06C:: @ 80DE06C
.string " Okeydoke!\n"
.string "I received your friend~27s #CGSOS Mail#R.#P Let me save your adventure."
.byte 0
.align 2, 0
gUnknown_80DE0C0:: @ 80DE0C0
.string " Okeydoke! You~27re good to go.\n"
.string "Just give me a shout when you~27d like\n"
.string "to go rescue your friend."
.byte 0
.align 2, 0
gUnknown_80DE124:: @ 80DE124
.string " OK~2c I need you to enter\n"
.string "the #CGSOS Mail password#R that your\n"
.string "friend gave you."
.byte 0
.align 2, 0
gUnknown_80DE178:: @ 80DE178
.string " How do you want to receive\n"
.string "your friend~27s #CGSOS Mail#R?"
.byte 0
.align 2, 0
gUnknown_80DE1B4:: @ 80DE1B4
.string " How do you want to send\n"
.string "your #CGA-OK Mail#R?"
.byte 0
.align 2, 0
gUnknown_80DE1E4:: @ 80DE1E4
.string " ...Uh~2c no?\n"
.string "You don~27t have an #CGSOS Mail#R.#P You~27ll need to arrange\n"
.string "to receive your friend~27s #CGSOS Mail#R first.\n"
.string "That~27s what you need to do."
.byte 0
.align 2, 0
gUnknown_80DE280:: @ 80DE280
.string " Okeydoke!\n"
.string "Let me show you to the rescue site."
.byte 0
.align 2, 0
gUnknown_80DE2B0:: @ 80DE2B0
.string " ...Uh~2c no?\n"
.string "Doesn~27t look like you can go to the dungeon\n"
.string "named in this #CGSOS Mail#R.#P Come see me about doing\n"
.string "this rescue when you can actually go\n"
.string "to that dungeon~2c all right?"
.byte 0
.align 2, 0
gUnknown_80DE368:: @ 80DE368
.string " ...Uh~2c no?\n"
.string "You~27ve blown this rescue mission too\n"
.string "often. Your friend~27s team is beyond help.#P I~27m sorry to say this~2c\n"
.string "but you~27ll have to tell your friend that\n"
.string "your rescue attempts failed."
.byte 0
.align 2, 0
gUnknown_80DE430:: @ 80DE430
.string " Okeydoke.\n"
.string "I~27ll need you to choose the #CGSOS Mail#R\n"
.string "for you to go on a rescue mission."
.byte 0
.align 2, 0
gUnknown_80DE48C:: @ 80DE48C
.string " What kind of mail do you\n"
.string "want to delete?"
.byte 0
.align 2, 0
gUnknown_80DE4B8:: @ 80DE4B8
.string " All righty. Choose\n"
.string "the #CGSOS Mail#R you don~27t need."
.byte 0
gUnknown_80DE4F0:: @ 80DE4F0
.string " ...Uh~2c no?\n"
.string "You don~27t have any #CGSOS Mail#R."
.byte 0
.align 2, 0
gUnknown_80DE524:: @ 80DE524
.string " If you want a reward~2c #C2don~27t\n"
.string "delete an A-OK Mail#R before getting a\n"
.string "#CGThank-You Mail#R back for it.#P #C2Be careful#R if you~27re going\n"
.string "to delete any #CGA-OK Mail#R.#P Okeydoke.\n"
.string "Choose an #CGA-OK Mail#R\n"
.string "you don~27t need anymore."
.byte 0
.align 2, 0
gUnknown_80DE614:: @ 80DE614
.string " ...Uh~2c no?\n"
.string "You don~27t have any #CGA-OK Mail#R."
.byte 0
.align 2, 0
gUnknown_80DE648:: @ 80DE648
.string " Uh~2c OK.\n"
.string "So~2c you want me to delete every piece\n"
.string "of mail that you have."
.byte 0
.align 2, 0
gUnknown_80DE694:: @ 80DE694
.string " ...Uh~2c no?\n"
.string "You don~27t have a single piece of\n"
.string "mail on you!"
.byte 0
.align 2, 0
gUnknown_80DE6D4:: @ 80DE6D4
.string " So~2c delete all your #CGSOS Mail#R~2c\n"
.string "#CGA-OK Mail#R~2c and your #CGThank-You Mail#R?\n"
.string "You~27re absolutely~2c positively sure?"
.byte 0
gUnknown_80DE754:: @ 80DE754
.string " If I delete any mail~2c it~27s\n"
.string "gone forever and ever. Bye-bye.\n"
.string "You~27re really~2c really sure now?"
.byte 0
gUnknown_80DE7B8:: @ 80DE7B8
.string " OK~2c then.\n"
.string "Let me save your adventure now."
.byte 0
.align 2, 0
gUnknown_80DE7E8:: @ 80DE7E8
.string " Okeydoke. That~27s all done."
.byte 0
.align 2, 0
gUnknown_80DE808:: @ 80DE808
.string " Do you want to delete\n"
.string "any other mail?"
.byte 0
.align 2, 0
gUnknown_80DE830:: @ 80DE830
.string " Okeydoke.\n"
.string "I~27ll delete #CGevery piece of mail#R."
.byte 0
.align 2, 0
gUnknown_80DE864:: @ 80DE864
.string " Okeydoke.\n"
.string "Every bit of mail has been deleted.#P Let me save your adventure."
.byte 0
.align 2, 0
gUnknown_80DE8B4:: @ 80DE8B4
.string " Well~2c hello~2c there!\n"
.string "This is the #CGFriend Rescue#R counter.\n"
.string "What can I help you with today?"
.byte 0
.align 2, 0
gUnknown_80DE918:: @ 80DE918
.string " Help you with anything\n"
.string "else today?"
.byte 0
gUnknown_80DE93C:: @ 80DE93C
.string " Come again anytime!"
.byte 0
.align 2, 0
gUnknown_80DE954:: @ 80DE954
.string " ...Uh~2c no?\n"
.string "Something~27s not working right here..."
.byte 0
.align 2, 0
gUnknown_80DE98C:: @ 80DE98C
.string " ...Uh~2c no?\n"
.string "The number of GBA systems isn~27t right.\n"
.string "You~27d better try this again from the top."
.byte 0
.align 2, 0
gUnknown_80DE9F0:: @ 80DE9F0
.string " ...Uh~2c no? You~27re not in the\n"
.string "same mode as your friend.\n"
.string "You~27d better try this again from the top."
.byte 0
gUnknown_80DEA58:: @ 80DEA58
.string " ...Uh~2c no?\n"
.string "Your storage space is stuffed full.\n"
.string "You~27d better make room and try again."
.byte 0
.align 2, 0
gUnknown_80DEAB4:: @ 80DEAB4
.string " ...Uh~2c no? It looks like\n"
.string "you received this mail before.\n"
.string "You can~27t get the same mail twice. "
.byte 0
.align 2, 0
gUnknown_80DEB18:: @ 80DEB18
.string " ...Uh~2c no?\n"
.string "You~27re not eligible to receive this mail."
.byte 0
.align 2, 0
gUnknown_80DEB54:: @ 80DEB54
.string " ...Uh~2c no?\n"
.string "There~27s no room for you to \n"
.string "receive any more mail.#P You~27d better delete some\n"
.string "mail and make room before you come see\n"
.string "me again about receiving new mail."
.byte 0
.align 2, 0
gUnknown_80DEC00:: @ 80DEC00
.string " ...Uh~2c no? Looks like your\n"
.string "friend didn~27t do what needed doing.\n"
.string "You~27d better do this again from the top."
.byte 0
.align 2, 0
gUnknown_80DEC70:: @ 80DEC70
.string " ...Uh~2c no?\n"
.string "This here password looks wrong.\n"
.string "Do you want to try that again?"
.byte 0
.align 2, 0
gUnknown_80DECC0:: @ 80DECC0
.string " ...Uh~2c no? This password~27s\n"
.string "not for any #CGSOS Mail#R."
.byte 0
.align 2, 0
gUnknown_80DECFC:: @ 80DECFC
.string ": I received the #CGSOS Mail#R.\n"
.string "Your adventure will be saved."
.byte 0
.align 2, 0
.asciz "pksdir0"
.align 2, 0

283
data/text/wonder_mail_2.inc Normal file
View File

@ -0,0 +1,283 @@
gUnknown_80DEF04:: @ 80DEF04
.string " ...Oh?\n"
.string "Something~27s gone wrong."
.byte 0
.align 2, 0
gUnknown_80DEF28:: @ 80DEF28
.string " ...Oh? The number of linked\n"
.string "GBA systems is incorrect.\n"
.string "Please try again from the start."
.byte 0
.align 2, 0
gUnknown_80DEF80:: @ 80DEF80
.string " ...Oh? It looks like your\n"
.string "friend chose a different mode.\n"
.string "Please try again from the start."
.byte 0
.align 2, 0
gUnknown_80DEFDC:: @ 80DEFDC
.string " ...Oh? It looks like your\n"
.string "storage space is full. Please clear some\n"
.string "space and try again from the start."
.byte 0
.align 2, 0
gUnknown_80DF044:: @ 80DF044
.string " ...Oh?\n"
.string "I think you~27ve received this mail before.\n"
.string "You can~27t get the same mail twice."
.byte 0
.align 2, 0
gUnknown_80DF0A0:: @ 80DF0A0
.string " ...Oh?\n"
.string "I don~27t think you~27re eligible to receive\n"
.string "this mail."
.byte 0
.align 2, 0
gUnknown_80DF0E0:: @ 80DF0E0
.string " ...Oh?\n"
.string "There is no room to receive new mail.\n"
.string "Please delete some mail and try again."
.byte 0
.align 2, 0
gUnknown_80DF138:: @ 80DF138
.string " ...Oh? Your friend didn~27t\n"
.string "follow through on their side.\n"
.string "Please try again from the start."
.byte 0
.align 2, 0
gUnknown_80DF194:: @ 80DF194
.string " Your #CGThank-You Mail#R\n"
.string "has been sent."
.byte 0
.align 2, 0
gUnknown_80DF1C0:: @ 80DF1C0
.string " ...Oh?\n"
.string "This password appears to be wrong.\n"
.string "Would you like to try again?"
.byte 0
.align 2, 0
gUnknown_80DF208:: @ 80DF208
.string " ...Oh? This password doesn~27t\n"
.string "appear to be for a #CGThank-You Mail#R."
.byte 0
.align 2, 0
gUnknown_80DF250:: @ 80DF250
.string ": This is the counter for\n"
.string "#CGThank-You Mail#R.#P: Oh~2c hi~2c #CN%s#R.\n"
.string "I~27ve been waiting for you. You wanted me\n"
.string "to process a #CGThank-You Mail#R?#P: Let me get on it right away"
.string "."
.byte 0
.align 2, 0
gUnknown_80DF304:: @ 80DF304
.string " Is it OK to send this\n"
.string "#CGThank-You Mail#R?"
.byte 0
.align 2, 0
gUnknown_80DF330:: @ 80DF330
.string " Please choose the\n"
.string "#CGThank-You Mail#R that you want to\n"
.string "send to your friend."
.byte 0
.align 2, 0
gUnknown_80DF380:: @ 80DF380
.string " OK. Please enter the\n"
.string "#CGThank-You Mail password#R."
.byte 0
.align 2, 0
gUnknown_80DF3B4:: @ 80DF3B4
.string " Please give this password\n"
.string "to the friend that rescued your team.#P I also must save your\n"
.string "adventure."
.byte 0
.align 2, 0
gUnknown_80DF418:: @ 80DF418
.string " OK~2c here is your\n"
.string "#CGThank-You Mail password#R."
.byte 0
.align 2, 0
gUnknown_80DF44C:: @ 80DF44C
.string " I need to save your\n"
.string "adventure."
.byte 0
.align 2, 0
gUnknown_80DF46C:: @ 80DF46C
.string " There we go.\n"
.string "I~27m all done.#P Doesn~27t it feel great to\n"
.string "be appreciated for doing something good?\n"
.string "Please keep up your rescue work!"
.byte 0
.align 2, 0
gUnknown_80DF4F4:: @ 80DF4F4
.string " A #CGThank-You Mail#R has\n"
.string "arrived from your friend for your rescue\n"
.string "mission."
.byte 0
.align 2, 0
gUnknown_80DF544:: @ 80DF544
.string "#+Communicating...\n"
.string "#+Please wait with the power on.\n"
.string "#+To cancel~2c press {B_BUTTON}."
.byte 0
.align 2, 0
gUnknown_80DF594:: @ 80DF594
.string " There. I~27ve sent your\n"
.string "#CGThank-You Mail#R.\n"
.string "I need to save your adventure."
.byte 0
.align 2, 0
gUnknown_80DF5E4:: @ 80DF5E4
.string " Please connect the GBA\n"
.string "systems with a #CGGame Link cable#R.\n"
.string "Is your friend also ready?"
.byte 0
.align 2, 0
gUnknown_80DF63C:: @ 80DF63C
.string " There~2c all done.\n"
.string "#CN%s#R~2c I hope your friend\n"
.string "appreciates your sense of gratitude."
.byte 0
.align 2, 0
gUnknown_80DF694:: @ 80DF694
.string " The item you~27ve chosen\n"
.string "here can~27t be exchanged later.\n"
.string "Are you certain this item is OK?"
.byte 0
.align 2, 0
gUnknown_80DF6F0:: @ 80DF6F0
.string " I~27ve saved your adventure. "
.byte 0
.align 2, 0
gUnknown_80DF710:: @ 80DF710
.string " OK~2c please choose\n"
.string "the item to be sent."
.byte 0
.align 2, 0
gUnknown_80DF73C:: @ 80DF73C
.string " ...Oh?\n"
.string "Your storage space is empty.\n"
.string "What would you like to do?"
.byte 0
.align 2, 0
gUnknown_80DF77C:: @ 80DF77C
.string " Would you like to choose\n"
.string "a #CGreward item#R from storage and\n"
.string "send it with your mail?"
.byte 0
.align 2, 0
gUnknown_80DF7D4:: @ 80DF7D4
.string " ...Oh?\n"
.string "You~27ve already attached a #CGreward item#R\n"
.string "to this mail.#P I~27m sorry~2c but once an item\n"
.string "has been attached to mail~2c it can~27t be\n"
.string "exchanged."
.byte 0
.align 2, 0
gUnknown_80DF870:: @ 80DF870
.string " Would you like to send it\n"
.string "again with the item you chose before?"
.byte 0
.align 2, 0
gUnknown_80DF8B4:: @ 80DF8B4
.string " ...Oh?\n"
.string "You don~27t seem to have a #CGThank-You Mail#R."
.byte 0
.align 2, 0
gUnknown_80DF8EC:: @ 80DF8EC
.string " Hello.\n"
.string "I handle #CGThank-You Mail#R.\n"
.string "How may I serve you?"
.byte 0
.align 2, 0
gUnknown_80DF928:: @ 80DF928
.string " May I help you with\n"
.string "anything else?"
.byte 0
.align 2, 0
gUnknown_80DF94C:: @ 80DF94C
.string " Please come see me\n"
.string "anytime."
.byte 0
.align 2, 0
gUnknown_80DF96C:: @ 80DF96C
.string " How would you like to send\n"
.string "your #CGThank-You Mail#R?"
.byte 0
.align 2, 0
gUnknown_80DF9A4:: @ 80DF9A4
.string " How would you like to\n"
.string "receive your friend~27s #CGThank-You Mail#R?"
.byte 0
.string "pksdir0"
.byte 0
.align 2, 0
gUnknown_80DF9F0:: @ 80DF9F0
.string "????"
.byte 0
.align 2, 0
gUnknown_80DF9F8:: @ 80DF9F8
.string " Oh~2c hello!\n"
.string "Your rescue mission went well~2c didn~27t it?\n"
.string "I wouldn~27t expect any less~2c #CG%s#R!#P Well~2c well!\n"
.string "Here is your reward from the Pokémon\n"
.string "Rescue Organization!"
.byte 0
.align 2, 0
gUnknown_80DFAA8:: @ 80DFAA8
.string " I hope you will keep on\n"
.string "rescuing your friends in\n"
.string "dire straits.#P And now~2c I must save\n"
.string "your adventure."
.byte 0
.align 2, 0
gUnknown_80DFB14:: @ 80DFB14
.string " Oh~2c yes~2c that~27s right.\n"
.string "Please don~27t forget to send an #CGA-OK Mail#R\n"
.string "to the friend you just rescued.#P Please give me a shout if\n"
.string "you would like to send #CGA-OK Mail#R."
.byte 0
.align 2, 0
.string "pksdir0"
.byte 0

View File

@ -0,0 +1,68 @@
gUnknown_80DFE4C:: @ 80DFE4C
.string "Are you sure you want to replace the\n"
.string "old #CGWonder Mail#R with the new one?"
.byte 0
.align 2, 0
gUnknown_80DFE9C:: @ 80DFE9C
.string "This #CGWonder Mail#R has already been\n"
.string "received."
.byte 0
.align 2, 0
gUnknown_80DFED0:: @ 80DFED0
.string "This #CGWonder Mail#R has already been\n"
.string "received.\n"
.string "You may not receive the same one again."
.byte 0
.align 2, 0
gUnknown_80DFF2C:: @ 80DFF2C
.string "Only #CGone piece#R of #CGWonder Mail#R can be held.\n"
.string "Please receive it after completing any\n"
.string "rescue mission in progress."
.byte 0
.align 2, 0
gUnknown_80DFFA4:: @ 80DFFA4
.string "The rescue team has quicksaved in\n"
.string "a dungeon with a mission in progress.\n"
.string "Please complete the mission first."
.byte 0
.align 2, 0
gUnknown_80E0010:: @ 80E0010
.string "The rescue team has quicksaved in\n"
.string "a dungeon with a mission in progress.\n"
.string "Mail cannot be deleted now."
.byte 0
gUnknown_80E0074:: @ 80E0074
.string "Received the #CGWonder Mail#R!"
.byte 0
.align 2, 0
gUnknown_80E0094:: @ 80E0094
.string "Only #CGone piece#R of #CGWonder Mail#R can be held.\n"
.string "Is it OK to replace the old #CGWonder Mail#R\n"
.string "with the new one?"
.byte 0
.align 2, 0
gUnknown_80E0108:: @ 80E0108
.string "Your #CGJob List#R is full.\n"
.string "Please select and delete unwanted mail."
.byte 0
.align 2, 0
gUnknown_80E014C:: @ 80E014C
.string "New Mail"
.byte 0
.align 2, 0
gUnknown_80E0158:: @ 80E0158
.string "Old Mail"
.byte 0
.align 2, 0
.string "pksdir0"
.byte 0

190
data/text/wonder_mail_4.inc Normal file
View File

@ -0,0 +1,190 @@
gUnknown_80E0C4C:: @ 80E0C4C
.string " So~2c what~27d you want to\n"
.string "know?"
.byte 0
.align 2, 0
gUnknown_80E0C70:: @ 80E0C70
.string " If you need to call for\n"
.string "help~2c first send your friend\n"
.string "an #CGSOS Mail#R.#P Once you send that mail~2c\n"
.string "wait until your friend sends you back\n"
.string "an #CGA-OK Mail#R.#P When you get that\n"
.string "#CGA-OK Mail#R back~2c your team\n"
.string "can continue from where it went down.#P Make sure you send your\n"
.string "friend a #CGThank-You Mail#R.\n"
.string "That~27s if you get revived~2c of course."
.byte 0
.align 2, 0
gUnknown_80E0DD0:: @ 80E0DD0
.string " If your team gets defeated\n"
.string "in a dungeon~2c you can send an #CGSOS Mail#R\n"
.string "to a friend willing to help.#P But I have to warn you.\n"
.string "You can~27t get anyone to rescue you\n"
.string "in certain places.#P If you need to send\n"
.string "an #CGSOS Mail#R~2c you send it from the\n"
.string "#CGmain menu#R."
.byte 0
.align 2, 0
gUnknown_80E0ED8:: @ 80E0ED8
.string " If your friend manages to\n"
.string "rescue your team~2c you need to receive\n"
.string "an #CGA-OK Mail#R from your friend.#P See~2c once you get that\n"
.string "#CGA-OK Mail#R~2c your team can continue from\n"
.string "where it went down in the dungeon.#P And~2c if you use\n"
.string "a #CGGame Link cable#R~2c your friend can\n"
.string "even send you a #CGhelper Pokémon#R.#P There~27s just one thing.\n"
.string "A #CGhelper Pokémon#R can~27t bring\n"
.string "any item it happens to be holding.#P You can receive that\n"
.string "team-saving #CGA-OK Mail#R on the #CGmain menu#R~2c\n"
.string "all right?"
.byte 0
.align 2, 0
gUnknown_80E10C8:: @ 80E10C8
.string " If your team gets rescued~2c\n"
.string "be sure to send your friend\n"
.string "a #CGThank-You Mail#R.#P You do that by going to\n"
.string "the #CGright counter#R~2c or\n"
.string "by selecting it from the #CGmain menu#R.#P You can attach an item in\n"
.string "storage to your #CGThank-You Mail#R\n"
.string "as a #CGreward item#R.#P You don~27t want to ever\n"
.string "forget to express your thanks."
.byte 0
.align 2, 0
gUnknown_80E120C:: @ 80E120C
.string " If you want to go and\n"
.string "rescue your friend~27s KO~27d team~2c\n"
.string "you need to receive an #CGSOS Mail#R.#P When you get that mail~2c\n"
.string "you can rescue your friend at\n"
.string "the #CGleft counter#R over there.#P If you do manage to rescue\n"
.string "the team~2c you send your friend\n"
.string "an #CGA-OK Mail#R.#P After you do that~2c your\n"
.string "friend can send back to you\n"
.string "a #CGThank-You Mail#R."
.byte 0
.align 2, 0
gUnknown_80E136C:: @ 80E136C
.string " To go off on a rescue~2c\n"
.string "you first need to receive your friend~27s\n"
.string "#CGSOS Mail#R.#P You do that at\n"
.string "the #CGleft counter#R over there~2c\n"
.string "or by selecting it from the #CGmain menu#R."
.byte 0
.align 2, 0
gUnknown_80E1420:: @ 80E1420
.string " If you succeed in rescuing\n"
.string "that team~2c you send your friend an\n"
.string "#CGA-OK Mail#R.#P You do that by going to\n"
.string "the #CGleft counter#R~2c\n"
.string "or from the #CGmain menu#R.#P You can send your friend\n"
.string "a Pokémon as a helper from your Friend\n"
.string "Areas using a #CGGame Link cable#R.#P This Pokémon won~27t\n"
.string "disappear from its Friend Area~2c so\n"
.string "don~27t you worry any."
.byte 0
.align 2, 0
gUnknown_80E157C:: @ 80E157C
.string " If you get an #CGSOS Mail#R~2c\n"
.string "you head off on the rescue from\n"
.string "the #CGleft counter#R.#P But~2c I have to warn you.\n"
.string "You can~27t go off to rescue in a dungeon\n"
.string "if you can~27t get into it.#P You~27ll be able to get\n"
.string "there when you go farther in your\n"
.string "adventure~2c so it won~27t do to fret."
.byte 0
.align 2, 0
gUnknown_80E169C:: @ 80E169C
.string " If you send your friend\n"
.string "an #CGA-OK Mail#R~2c you can look forward\n"
.string "to getting a #CGThank-You Mail#R back.#P You can receive it at\n"
.string "the #CGright counter#R\n"
.string "or on the #CGmain menu#R.#P But you need to #C2be careful#R.\n"
.string "You #C2must not delete the A-OK Mail#R\n"
.string "before you get the #CGThank-You Mail#R back."
.byte 0
.align 2, 0
gUnknown_80E17C8:: @ 80E17C8
.string " I~27m your guide to what you\n"
.string "can expect at the Pelipper Post Office.\n"
.string "If you have any questions~2c just ask away!"
.byte 0
.align 2, 0
gUnknown_80E183C:: @ 80E183C
.string " Did you want to ask about\n"
.string "anything else?"
.byte 0
.align 2, 0
gUnknown_80E1868:: @ 80E1868
.string " #CGThe Pelipper Post Office#R\n"
.string "keeps track of information from\n"
.string "around the world.#P We inform folks\n"
.string "about everything from gossip to calls\n"
.string "for help from fellow Pokémon.#P For the latest news~2c check\n"
.string "#CGyour Mailbox#R or the #CGBulletin Board#R\n"
.string "outside~2c all right?#P Oh~2c that~27s not all.\n"
.string "You can arrange for #CGFriend Rescue#R\n"
.string "missions at that counter there.#P The #CGleft counter#R is\n"
.string "for rescues~2c and the #CGright counter#R\n"
.string "is for Thank-You Mail."
.byte 0
.align 2, 0
gUnknown_80E1A30:: @ 80E1A30
.string " The #CGBulletin Board#R outside\n"
.string "here lists rescue requests.#P Take on rescue jobs from\n"
.string "the Bulletin Board. Be a hero and handle\n"
.string "the jobs for fellow Pokémon in need!"
.byte 0
.align 2, 0
gUnknown_80E1AD8:: @ 80E1AD8
.string " If your rescue team\n"
.string "becomes famous for doing lots of rescues~2c\n"
.string "expect to get rescue requests directly.#P Our delivery "
.byte 0x24
.string "m0\n"
.string "will take those jobs straight to your\n"
.string "#CGMailbox#R."
.byte 0
.align 2, 0
gUnknown_80E1B88:: @ 80E1B88
.string " Friend Rescue is what we\n"
.string "call rescue missions between friends using\n"
.string "a #CGGame Link cable#R~2c #CGpasswords#R~2c etc.#P For instance~2c you can send\n"
.string "out for help saying your team wiped out\n"
.string "in a dungeon at such and such a place.#P Your friend could play\n"
.string "the hero and come to your team~27s rescue.\n"
.string "Or it can be the other way around~2c too.#P If you use #CGpasswords#R~2c\n"
.string "you can do rescues with friends in\n"
.string "far-away places.#P You can apply for Friend\n"
.string "Rescue jobs at the #CGleft counter#R of\n"
.string "that counter there."
.byte 0
.align 2, 0
gUnknown_80E1D84:: @ 80E1D84
.string " Deleting mail just means\n"
.string "getting rid of old mail that you don~27t\n"
.string "need anymore.#P If you do lots of Friend\n"
.string "Rescues~2c you~27ll find #CGSOS Mail#R and\n"
.string "#CGA-OK Mail#R piling up.#P Once you get #CG30 pieces#R~2c\n"
.string "you won~27t be able to receive more mail.\n"
.string "That~27s why you~27ll need to delete old mail.#P You can look through old\n"
.string "mail at the #CGleft counter#R over there."
.byte 0
.align 2, 0
.string "pksdir0"
.byte 0

View File

@ -0,0 +1,40 @@
gUnknown_80E0184:: @ 80E0184
.string " Thank you for rescuing me!"
.byte 0
.align 2, 0
gUnknown_80E01A0:: @ 80E01A0
.string " Thank you for rescuing\n"
.string "#C5"
.byte 0x24
.string "m1#R!"
.byte 0
.align 2, 0
gUnknown_80E01C4:: @ 80E01C4
.string " Thank you for escorting me\n"
.string "to #C5"
.byte 0x24
.string "m1#R! "
.byte 0
.align 2, 0
gUnknown_80E01F0:: @ 80E01F0
.string " Thank you for delivering\n"
.string "the #C4"
.byte 0x24
.string "i0#R!"
.byte 0
.align 2, 0
gUnknown_80E0218:: @ 80E0218
.string " Thank you for getting me\n"
.string "the #C4"
.byte 0x24
.string "i0#R!"
.byte 0
.align 2, 0
.string "pksdir0"
.byte 0
.align 2, 0

6
include/code_800558C.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef GUARD_code_800558C_H
#define GUARD_code_800558C_H
extern void *gUnknown_203B078;
#endif //GUARD_code_800558C_H

6
include/code_800B540.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef GUARD_code_800B540_H
#define GUARD_code_800B540_H
void sub_800CDA8(int a0);
#endif //GUARD_code_800B540_H

34
include/file_system.h Normal file
View File

@ -0,0 +1,34 @@
#ifndef GUARD_FILE_SYSTEM_H
#define GUARD_FILE_SYSTEM_H
struct File
{
char *name;
u8 *data;
};
struct OpenedFile
{
struct File *file;
u8 *data;
};
struct FileArchive
{
char magic[8];
s32 count;
struct File *entries;
};
struct SiroArchive
{
u32 magic;
u8 *data;
};
struct OpenedFile *OpenFile(const char *filename, const struct FileArchive *arc);
u8 *GetFileDataPtr(struct OpenedFile *openedFile, int unused);
struct OpenedFile *OpenFileAndGetFileDataPtr(const char *filename, const struct FileArchive *arc);
struct OpenedFile *Call_OpenFileAndGetFileDataPtr(const char *filename, const struct FileArchive *arc);
#endif //GUARD_FILE_SYSTEM_H

View File

@ -8,6 +8,8 @@
#define IWRAM_DATA __attribute__((section("iwram_data")))
#define EWRAM_DATA __attribute__((section("ewram_data")))
#define UNUSED __attribute__((unused))
#define NAKED __attribute__((naked))
#define ALIGNED(n) __attribute__((aligned(n)))
@ -59,4 +61,4 @@
#define WIN_RANGE(a, b) (((a) << 8) | (b))
#endif // GUARD_GBA_DEFINES
#endif // GUARD_GBA_DEFINES

View File

@ -1,10 +1,11 @@
#ifndef GUARD_GLOBAL_H
#define GUARD_GLOBAL_H
#include <string.h>
#include "gba/gba.h"
// IDE support
#ifdef __APPLE__
#if defined(__APPLE__) || defined(__CYGWIN__)
#define _(x) x
#define __(x) x
#define INCBIN_U8 {0}
@ -13,9 +14,6 @@
#define INCBIN_S8 {0}
#define INCBIN_S16 {0}
#define INCBIN_S32 {0}
void * memcpy (void *, const void *, size_t);
void * memset (void *, int, size_t);
int strcmp (const char *, const char *);
#endif
// Prevent cross-jump optimization.
@ -26,13 +24,7 @@ int strcmp (const char *, const char *);
#define asm_unified(x) asm(".syntax unified\n" x "\n.syntax divided\n")
#define nonmatching(fndec, x) {\
__attribute__((naked))\
fndec\
{\
asm_unified(x);\
}\
}
#define NAKED __attribute__((naked))
#define ARRAY_COUNT(array) (sizeof(array) / sizeof((array)[0]))

13
include/macros/m4a.inc Normal file
View File

@ -0,0 +1,13 @@
.macro song label, music_player, unknown
.4byte \label
.2byte \music_player
.2byte \unknown
.endm
.macro music_player info_struct, track_struct, unknown_1, unknown_2
.4byte \info_struct
.4byte \track_struct
.byte \unknown_1
.space 1
.2byte \unknown_2
.endm

56
include/memory.h Normal file
View File

@ -0,0 +1,56 @@
#ifndef GUARD_MEMORY_H
#define GUARD_MEMORY_H
#define HEAP_SIZE 0x24000
struct HeapSettings
{
u8 *start;
u32 size;
};
struct HeapMemoryBlock {
u8 *start;
s32 size;
s32 allocatedSize;
};
struct HeapFreeListElement
{
u32 unk_atb;
u32 atb;
u32 grp;
struct HeapMemoryBlock block;
};
struct HeapDescriptor
{
u32 unk0;
struct HeapDescriptor *parentHeap;
struct HeapFreeListElement *freeList;
s32 freeCount;
u32 freeListLength;
u8 *start;
u32 size;
};
void InitHeap(void);
void MemoryClear8(u8 *dest, s32 size);
void MemoryClear16(u16 *dest, s32 size);
void MemoryClear32(u32 *dest, s32 size);
void MemoryFill8(u8 *dest, u8 value, s32 size);
void MemoryFill16(u16 *dest, u16 value, s32 size);
void MemoryFill32(u32 *dest, u32 value, s32 size);
void MemoryCopy8(u8 *dest, u8 *src, s32 size);
void MemoryCopy16(u16 *dest, u16 *src, s32 size);
void MemoryCopy32(u32 *dest, u32 *src, s32 size);
void MemoryCopy8(u8 *dest, u8 *src, s32 size);
void MemoryCopy16(u16 *dest, u16 *src, s32 size);
void MemoryCopy32(u32 *dest, u32 *src, s32 size);
void InitHeapInternal(void);
void DoInitHeap(struct HeapDescriptor *, struct HeapSettings *, struct HeapFreeListElement *, u32);
void InitSubHeap(struct HeapDescriptor *, struct HeapMemoryBlock *, u32);
#endif // GUARD_MEMORY_H

View File

@ -1,14 +0,0 @@
/<EWRAM>/ {
r sym_ewram.ld
d
}
/<EWRAM2>/ {
r sym_ewram2.ld
d
}
/<IWRAM>/ {
r sym_iwram.ld
d
}

View File

@ -1,5 +1,8 @@
ENTRY(Start)
gNumMusicPlayers = 8;
gMaxLines = 0;
SECTIONS {
. = 0x2000000;
@ -7,24 +10,16 @@ SECTIONS {
ALIGN(4)
{
ewram_start = .;
<EWRAM>
. = ALIGN(4);
INCLUDE "sym_ewram.ld"
src/agb_flash.o(.bss);
. = ALIGN(4);
tools/agbcc/lib/libgcc.a:fp-bit.o(.bss);
. = ALIGN(4);
tools/agbcc/lib/libgcc.a:dp-bit.o(.bss);
. = ALIGN(4);
tools/agbcc/lib/libc.a:syscalls.o(.bss);
. = ALIGN(16);
<EWRAM2>
. = ALIGN(4);
INCLUDE "sym_ewram2.ld"
tools/agbcc/lib/libc.a:impure.o(.data);
. = ALIGN(4);
tools/agbcc/lib/libc.a:locale.o(.data);
. = ALIGN(4);
tools/agbcc/lib/libc.a:mallocr.o(.data);
. = ALIGN(4);
gUnknown_203BC04 = .;
. = 0x40000;
}
@ -35,7 +30,7 @@ SECTIONS {
ALIGN(4)
{
iwram_start = .;
<IWRAM>
INCLUDE "sym_iwram.ld"
. = 0x8000;
}
@ -48,16 +43,20 @@ SECTIONS {
asm/code.o(.text);
asm/event_flag.o(.text);
asm/code_8002774.o(.text);
src/memory.o(.text);
asm/memory.o(.text);
asm/code_80035F0.o(.text);
src/other_random.o(.text);
src/util.o(.text);
asm/bg_palette_buffer.o(.text);
src/bg_palette_buffer.o(.text);
asm/input.o(.text);
asm/code_8004AA0.o(.text);
src/sprite.o(.text);
asm/sprite.o(.text);
asm/code_800558C.o(.text);
src/random.o(.text);
src/text.o(.text);
. = ALIGN(4);
asm/text.o(.text);
asm/code_8009804.o(.text);
src/file_system.o(.text);
@ -66,9 +65,14 @@ SECTIONS {
asm/code_800B540.o(.text);
src/flash.o(.text);
asm/code_800D090.o(.text);
src/save.o(.text);
asm/save.o(.text);
src/save1.o(.text);
asm/code_8012A18.o(.text);
asm/m4a.o(.text);
asm/m4a_1.o(.text);
src/m4a_2.o(.text);
asm/m4a_3.o(.text);
src/m4a_4.o(.text);
asm/syscall.o(.text);
src/agb_flash.o(.text);
src/agb_flash_1m.o(.text);
@ -133,23 +137,17 @@ SECTIONS {
data/data.o(.rodata);
src/file_system.o(.rodata);
data/data_80B9BB8.o(.rodata);
src/m4a_tables.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);
. = ALIGN(4);
tools/agbcc/lib/libc.a:sprintf.o(.rodata);
. = ALIGN(4);
tools/agbcc/lib/libc.a:vfprintf.o(.rodata);
. = ALIGN(4);
tools/agbcc/lib/libc.a:dtoa.o(.rodata);
. = ALIGN(4);
tools/agbcc/lib/libc.a:impure.o(.rodata);
. = ALIGN(4);
tools/agbcc/lib/libc.a:locale.o(.rodata);
. = ALIGN(4);
tools/agbcc/lib/libc.a:mprec.o(.rodata);
. = ALIGN(4);
tools/agbcc/lib/libc.a:syscalls.o(.rodata);
. = ALIGN(4);
data/data_8270000.o(.rodata);
@ -164,7 +162,8 @@ SECTIONS {
unk_code_end = .;
}
unk_code_ram_end = unk_code_ram + (unk_code_end - unk_code);
unk_code_section_size = (unk_code_end - unk_code);
unk_code_ram_end = unk_code_ram + unk_code_section_size;
end = unk_code_ram_end;
. = 0x8300000;

1
red.sha1 Normal file
View File

@ -0,0 +1 @@
9f4cfc5b5f4859d17169a485462e977c7aac2b89 pmd_red.gba

View File

@ -1 +0,0 @@
2100cf6f17e12cd34f1513647dfa506b pmd_red.gba

View File

@ -0,0 +1,10 @@
.align 2
gMPlayTable:: @ 9E8665C
music_player 0x20008F0, 0x2000000, 12, 0
music_player 0x2000970, 0x20003C0, 6, 0
music_player 0x20009B0, 0x20005A0, 1, 0
music_player 0x2000A40, 0x20005F0, 1, 0
music_player 0x20009F0, 0x2000640, 2, 0
music_player 0x2000870, 0x20006E0, 2, 0
music_player 0x20008B0, 0x2000780, 2, 0
music_player 0x2000930, 0x2000820, 1, 0

942
sound/song_table.inc Normal file
View File

@ -0,0 +1,942 @@
.align 2
gSongTable:: @ 9E866BC
song 0x9F5185C, 0, 0
song 0x9F5218C, 0, 0
song 0x9F52D24, 0, 0
song 0x9F53728, 0, 0
song 0x9F53B10, 0, 0
song 0x9F54734, 0, 0
song 0x9F5506C, 0, 0
song 0x9F56720, 0, 0
song 0x9F56B8C, 0, 0
song 0x9F57254, 0, 0
song 0x9F57C58, 0, 0
song 0x9F588BC, 0, 0
song 0x9F59210, 0, 0
song 0x9F59F68, 0, 0
song 0x9F5B598, 0, 0
song 0x9F5CF8C, 0, 0
song 0x9F5DE00, 0, 0
song 0x9F5E8E0, 0, 0
song 0x9F5F9C8, 0, 0
song 0x9F60510, 0, 0
song 0x9F61EA8, 0, 0
song 0x9F63224, 0, 0
song 0x9F666B8, 0, 0
song 0x9F678E8, 0, 0
song 0x9F698F0, 0, 0
song 0x9F6AED8, 0, 0
song 0x9F6CDDC, 0, 0
song 0x9F6FBF8, 0, 0
song 0x9F71EC8, 0, 0
song 0x9F73E7C, 0, 0
song 0x9F75DD0, 0, 0
song 0x9F77848, 0, 0
song 0x9F79C08, 0, 0
song 0x9F7A6EC, 0, 0
song 0x9F7B9BC, 0, 0
song 0x9F7D470, 0, 0
song 0x9F7DD20, 0, 0
song 0x9F7FA74, 0, 0
song 0x9F7FC3C, 0, 0
song 0x9F81164, 0, 0
song 0x9F8192C, 0, 0
song 0x9F82150, 0, 0
song 0x9F832D4, 0, 0
song 0x9F83A88, 0, 0
song 0x9F86808, 0, 0
song 0x9F871BC, 0, 0
song 0x9F87678, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9F876AC, 0, 0
song 0x9F877DC, 0, 0
song 0x9F878FC, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9F88B90, 0, 0
song 0x9F89B38, 0, 0
song 0x9F8AE6C, 0, 0
song 0x9F8C1A0, 0, 0
song 0x9F8DCFC, 0, 0
song 0x9F8F384, 0, 0
song 0x9F8FD4C, 0, 0
song 0x9F90F70, 0, 0
song 0x9F93C60, 0, 0
song 0x9F94FBC, 0, 0
song 0x9F96190, 0, 0
song 0x9F976A0, 0, 0
song 0x9F97C6C, 0, 0
song 0x9F992BC, 0, 0
song 0x9F9961C, 0, 0
song 0x9F9B188, 0, 0
song 0x9F9BA2C, 0, 0
song 0x9F9CC24, 0, 0
song 0x9F9DDA0, 0, 0
song 0x9F9ECF4, 0, 0
song 0x9FA06B0, 0, 0
song 0x9FA0F50, 0, 0
song 0x9FA3AA0, 0, 0
song 0x9FA5254, 0, 0
song 0x9FA79C8, 0, 0
song 0x9FA8760, 0, 0
song 0x9FA9C7C, 0, 0
song 0x9FAB3D0, 0, 0
song 0x9FAC714, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9FAC838, 1, 1
song 0x9FAC944, 1, 1
song 0x9FAC9C4, 1, 1
song 0x9FACA5C, 1, 1
song 0x9FACB10, 1, 1
song 0x9FACC04, 1, 1
song 0x9FACCBC, 1, 1
song 0x9FACD28, 1, 1
song 0x9FACE3C, 1, 1
song 0x9E8841C, 0, 0
song 0x9FACF88, 1, 1
song 0x9FAD054, 1, 1
song 0x9FAD140, 1, 1
song 0x9FAD1DC, 1, 1
song 0x9FAD270, 1, 1
song 0x9FAD394, 1, 1
song 0x9FAD494, 1, 1
song 0x9FAD694, 1, 1
song 0x9FAD784, 1, 1
song 0x9FAD91C, 1, 1
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9FAD938, 2, 2
song 0x9FAD95C, 2, 2
song 0x9FAD984, 2, 2
song 0x9FAD9A0, 2, 2
song 0x9FAD9C0, 4, 4
song 0x9FAD9E4, 2, 2
song 0x9FADA08, 2, 2
song 0x9FADA3C, 2, 2
song 0x9FADA6C, 2, 2
song 0x9FADA9C, 2, 2
song 0x9FADAC0, 2, 2
song 0x9FADB14, 6, 6
song 0x9FADB20, 6, 6
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9FADB58, 2, 2
song 0x9FADB94, 2, 2
song 0x9FADBB4, 5, 5
song 0x9FADBDC, 3, 3
song 0x9E8841C, 0, 0
song 0x9FADBE8, 3, 3
song 0x9FADC30, 3, 3
song 0x9FADCB8, 2, 2
song 0x9FADD38, 2, 2
song 0x9FADD8C, 2, 2
song 0x9FADDB4, 5, 5
song 0x9FADDDC, 5, 5
song 0x9FADE20, 2, 2
song 0x9FADE64, 2, 2
song 0x9FADE88, 5, 5
song 0x9FADF14, 3, 3
song 0x9FADF34, 3, 3
song 0x9FADF60, 3, 3
song 0x9FADF80, 3, 3
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9FADFD8, 2, 2
song 0x9FAE038, 4, 4
song 0x9FAE184, 3, 3
song 0x9FAE1C4, 2, 2
song 0x9FAE250, 3, 3
song 0x9FAE2A4, 2, 2
song 0x9FAE2C8, 3, 3
song 0x9FAE2FC, 2, 2
song 0x9FAE328, 3, 3
song 0x9FAE358, 3, 3
song 0x9FAE380, 3, 3
song 0x9FAE3A8, 2, 2
song 0x9FAE3D4, 3, 3
song 0x9FAE3E0, 2, 2
song 0x9FAE408, 3, 3
song 0x9FAE43C, 3, 3
song 0x9FAE468, 3, 3
song 0x9FAE49C, 2, 2
song 0x9FAE4C4, 3, 3
song 0x9FAE4EC, 4, 4
song 0x9FAE968, 5, 5
song 0x9FAEA48, 5, 5
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9FAEA78, 5, 5
song 0x9FAEB64, 5, 5
song 0x9FAEB8C, 5, 5
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9FAEBB8, 3, 3
song 0x9FAEBEC, 6, 6
song 0x9FAEC40, 5, 5
song 0x9FAECCC, 5, 5
song 0x9FAED10, 2, 2
song 0x9FAEDBC, 2, 2
song 0x9FAEDF8, 6, 6
song 0x9FAEE64, 6, 6
song 0x9FAEE84, 6, 6
song 0x9FAEEAC, 3, 3
song 0x9FAEED4, 3, 3
song 0x9FAEEE0, 6, 6
song 0x9FAEF34, 6, 6
song 0x9FAEF58, 6, 6
song 0x9FAEF90, 6, 6
song 0x9FAF004, 6, 6
song 0x9FAF044, 6, 6
song 0x9FAF0E0, 6, 6
song 0x9FAF16C, 6, 6
song 0x9FAF1F4, 2, 2
song 0x9FAF224, 3, 3
song 0x9FAF308, 5, 5
song 0x9FAF33C, 5, 5
song 0x9FAF3F0, 5, 5
song 0x9FAF3FC, 5, 5
song 0x9FAF4C4, 5, 5
song 0x9FAF654, 5, 5
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9FAF6A0, 3, 3
song 0x9FAF6E8, 3, 3
song 0x9FAF750, 3, 3
song 0x9FAF784, 3, 3
song 0x9FAF844, 4, 4
song 0x9FAF88C, 2, 2
song 0x9FAF904, 5, 5
song 0x9FAF95C, 2, 2
song 0x9FAF998, 2, 2
song 0x9FAF9F8, 5, 5
song 0x9FAFAD4, 3, 3
song 0x9FAFB08, 5, 5
song 0x9FAFB3C, 5, 5
song 0x9FAFB70, 2, 2
song 0x9FAFBAC, 5, 5
song 0x9FAFBE4, 2, 2
song 0x9FAFC20, 5, 5
song 0x9FAFC7C, 5, 5
song 0x9FAFCB0, 2, 2
song 0x9FAFD08, 2, 2
song 0x9FAFD74, 2, 2
song 0x9FAFDE8, 2, 2
song 0x9FAFE38, 2, 2
song 0x9FAFE84, 5, 5
song 0x9FAFF88, 5, 5
song 0x9FAFFB4, 5, 5
song 0x9FAFFE0, 5, 5
song 0x9FB006C, 5, 5
song 0x9FB0148, 5, 5
song 0x9FB019C, 5, 5
song 0x9FB0200, 5, 5
song 0x9FB0254, 5, 5
song 0x9FB02CC, 5, 5
song 0x9FB035C, 5, 5
song 0x9FB043C, 5, 5
song 0x9FB04D8, 5, 5
song 0x9FB05A8, 4, 4
song 0x9FB062C, 5, 5
song 0x9FB06C0, 5, 5
song 0x9FB08C4, 5, 5
song 0x9FB097C, 5, 5
song 0x9FB09E0, 5, 5
song 0x9FB0B9C, 5, 5
song 0x9FB0C20, 5, 5
song 0x9FB0CD0, 5, 5
song 0x9FB0D40, 5, 5
song 0x9E8841C, 0, 0
song 0x9FB0D9C, 3, 3
song 0x9FB0DC8, 3, 3
song 0x9FB0F4C, 5, 5
song 0x9FB11EC, 5, 5
song 0x9FB120C, 5, 5
song 0x9FB1254, 5, 5
song 0x9FB12CC, 5, 5
song 0x9FB1358, 5, 5
song 0x9FB13E0, 5, 5
song 0x9FB14F0, 5, 5
song 0x9FB1718, 5, 5
song 0x9FB17E4, 5, 5
song 0x9FB1874, 5, 5
song 0x9FB18A4, 2, 2
song 0x9FB1960, 5, 5
song 0x9FB198C, 3, 3
song 0x9FB1FC4, 5, 5
song 0x9FB2020, 5, 5
song 0x9FB2090, 3, 3
song 0x9FB20D8, 5, 5
song 0x9FB2284, 5, 5
song 0x9FB23C0, 5, 5
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9E8841C, 0, 0
song 0x9FB2438, 5, 5
song 0x9FB24F0, 5, 5
song 0x9FB254C, 5, 5
song 0x9FB257C, 5, 5
song 0x9FB25D0, 5, 5
song 0x9FB2644, 5, 5
song 0x9FB2690, 5, 5
song 0x9FB26D0, 3, 3
song 0x9FB2708, 3, 3
song 0x9FB2748, 3, 3
song 0x9FB279C, 3, 3
song 0x9FB2808, 5, 5
song 0x9FB286C, 2, 2
song 0x9FB28D0, 2, 2
song 0x9FB291C, 5, 5
song 0x9FB29A4, 5, 5
song 0x9FB29E0, 5, 5
song 0x9FB2A30, 5, 5
song 0x9FB2A80, 5, 5
song 0x9FB2AC8, 5, 5
song 0x9FB2AF8, 5, 5
song 0x9FB2B1C, 5, 5
song 0x9FB2BB0, 5, 5
song 0x9FB2C04, 5, 5
song 0x9FB2C8C, 5, 5
song 0x9FB2CDC, 5, 5
song 0x9FB2D08, 5, 5
song 0x9FB2D54, 5, 5
song 0x9FB2D7C, 5, 5
song 0x9FB2E28, 5, 5
song 0x9FB2E80, 5, 5
song 0x9FB2EB4, 5, 5
song 0x9FB2F20, 5, 5
song 0x9FB2F2C, 5, 5
song 0x9FB2F34, 5, 5
song 0x9FB2F3C, 5, 5
song 0x9FB2F68, 5, 5
song 0x9FB2F74, 5, 5
song 0x9FB2FE4, 5, 5
song 0x9FB3008, 5, 5
song 0x9FB3074, 5, 5
song 0x9FB30F0, 5, 5
song 0x9FB314C, 5, 5
song 0x9FB31B0, 5, 5
song 0x9FB3228, 5, 5
song 0x9FB327C, 5, 5
song 0x9FB32EC, 5, 5
song 0x9FB3334, 5, 5
song 0x9FB3378, 5, 5
song 0x9FB33F8, 5, 5
song 0x9FB3474, 5, 5
song 0x9FB34EC, 5, 5
song 0x9FB3530, 5, 5
song 0x9FB35A4, 5, 5
song 0x9FB3618, 5, 5
song 0x9FB3698, 5, 5
song 0x9FB371C, 5, 5
song 0x9FB37D0, 5, 5
song 0x9FB37FC, 5, 5
song 0x9FB384C, 5, 5
song 0x9FB39C0, 5, 5
song 0x9FB3A3C, 5, 5
song 0x9FB3A9C, 5, 5
song 0x9FB3AF4, 5, 5
song 0x9FB3C08, 5, 5
song 0x9FB3CB0, 5, 5
song 0x9FB3D0C, 5, 5
song 0x9FB3D5C, 5, 5
song 0x9FB3DB0, 5, 5
song 0x9FB3E24, 5, 5
song 0x9FB3F60, 5, 5
song 0x9FB400C, 5, 5
song 0x9FB4094, 5, 5
song 0x9FB411C, 5, 5
song 0x9FB4230, 5, 5
song 0x9FB4324, 5, 5
song 0x9FB4350, 5, 5
song 0x9FB43D0, 5, 5
song 0x9FB44E0, 5, 5
song 0x9FB4554, 5, 5
song 0x9FB45B0, 5, 5
song 0x9FB4658, 5, 5
song 0x9FB46D4, 5, 5
song 0x9FB4750, 5, 5
song 0x9FB47C4, 5, 5
song 0x9FB4820, 5, 5
song 0x9FB4874, 5, 5
song 0x9FB48B8, 5, 5
song 0x9FB4910, 5, 5
song 0x9FB497C, 5, 5
song 0x9FB49E4, 5, 5
song 0x9FB4A4C, 5, 5
song 0x9FB4AF0, 5, 5
song 0x9FB4B84, 5, 5
song 0x9FB4BE8, 5, 5
song 0x9FB4C58, 5, 5
song 0x9FB4D44, 5, 5
song 0x9FB4E88, 5, 5
song 0x9FB4EDC, 5, 5
song 0x9FB4F94, 5, 5
song 0x9FB508C, 5, 5
song 0x9FB5140, 5, 5
song 0x9FB51A8, 5, 5
song 0x9FB5208, 5, 5
song 0x9FB5294, 5, 5
song 0x9FB534C, 5, 5
song 0x9FB53B0, 5, 5
song 0x9FB54DC, 5, 5
song 0x9FB55B0, 5, 5
song 0x9FB5688, 5, 5
song 0x9FB56DC, 5, 5
song 0x9FB5730, 5, 5
song 0x9FB57B8, 5, 5
song 0x9FB57EC, 5, 5
song 0x9FB5864, 5, 5
song 0x9FB5898, 5, 5
song 0x9FB58FC, 5, 5
song 0x9FB59DC, 5, 5
song 0x9FB5A64, 5, 5
song 0x9FB5AB0, 5, 5
song 0x9FB5B10, 5, 5
song 0x9FB5B98, 5, 5
song 0x9FB5CBC, 5, 5
song 0x9FB5D24, 5, 5
song 0x9FB5DD0, 5, 5
song 0x9FB5E88, 5, 5
song 0x9FB5ED4, 5, 5
song 0x9FB5EFC, 5, 5
song 0x9FB5F6C, 2, 2
song 0x9FB5FD4, 5, 5
song 0x9FB60A8, 5, 5
song 0x9FB617C, 5, 5
song 0x9FB6210, 5, 5
song 0x9FB62A4, 5, 5
song 0x9FB62EC, 5, 5
song 0x9FB63C4, 5, 5
song 0x9FB6440, 5, 5
song 0x9FB6484, 5, 5
song 0x9FB663C, 5, 5
song 0x9FB6740, 5, 5
song 0x9FB67C0, 5, 5
song 0x9FB6830, 5, 5
song 0x9FB68D8, 5, 5
song 0x9FB696C, 5, 5
song 0x9FB69D4, 5, 5
song 0x9FB6A58, 5, 5
song 0x9FB6AF8, 5, 5
song 0x9FB6B28, 5, 5
song 0x9FB6B70, 5, 5
song 0x9FB6C30, 5, 5
song 0x9FB6C94, 5, 5
song 0x9FB6D40, 5, 5
song 0x9FB6DB0, 5, 5
song 0x9FB6E88, 5, 5
song 0x9FB703C, 5, 5
song 0x9FB71F0, 5, 5
song 0x9FB73A8, 5, 5
song 0x9FB7464, 5, 5
song 0x9FB74D8, 5, 5
song 0x9FB7534, 5, 5
song 0x9FB7658, 5, 5
song 0x9FB7688, 5, 5
song 0x9FB7708, 5, 5
song 0x9FB7798, 5, 5
song 0x9FB77D8, 5, 5
song 0x9FB78F0, 5, 5
song 0x9FB792C, 5, 5
song 0x9FB79F0, 5, 5
song 0x9FB7AA8, 5, 5
song 0x9FB7B88, 2, 2
song 0x9FB7CDC, 5, 5
song 0x9FB7DA0, 5, 5
song 0x9FB7E28, 5, 5
song 0x9FB7EC4, 5, 5
song 0x9FB7F5C, 5, 5
song 0x9FB8074, 5, 5
song 0x9FB8150, 5, 5
song 0x9FB82B8, 5, 5
song 0x9FB834C, 5, 5
song 0x9FB85C0, 5, 5
song 0x9FB8670, 5, 5
song 0x9FB86C8, 5, 5
song 0x9FB87C4, 5, 5
song 0x9FB880C, 5, 5
song 0x9FB8884, 5, 5
song 0x9FB893C, 5, 5
song 0x9FB8B48, 5, 5
song 0x9FB8C5C, 5, 5
song 0x9FB8D14, 5, 5
song 0x9FB8D54, 5, 5
song 0x9FB8DF0, 5, 5
song 0x9FB8E40, 5, 5
song 0x9FB8F18, 5, 5
song 0x9FB8F68, 5, 5
song 0x9FB9000, 5, 5
song 0x9FB9070, 5, 5
song 0x9FB90E0, 5, 5
song 0x9FB9150, 5, 5
song 0x9FB9244, 5, 5
song 0x9FB9388, 5, 5
song 0x9FB93B4, 5, 5
song 0x9FB943C, 5, 5
song 0x9FB9528, 5, 5
song 0x9FB955C, 5, 5
song 0x9FB9568, 5, 5
song 0x9FB961C, 5, 5
song 0x9E8841C, 0, 0
song 0x9FB965C, 5, 5
song 0x9FB96B4, 5, 5
song 0x9FB9764, 5, 5
song 0x9FB97B8, 5, 5
song 0x9FB97F8, 5, 5
song 0x9FB9854, 5, 5
song 0x9FB988C, 5, 5
song 0x9FB9984, 5, 5
song 0x9FB9A68, 5, 5
song 0x9FB9AB0, 5, 5
song 0x9FB9AF8, 5, 5
song 0x9FB9BD0, 5, 5
song 0x9FB9C54, 5, 5
song 0x9FB9D58, 5, 5
song 0x9FB9D9C, 5, 5
song 0x9FB9DFC, 5, 5
song 0x9FB9E60, 5, 5
song 0x9FB9EBC, 5, 5
song 0x9FB9F34, 5, 5
song 0x9FBA014, 5, 5
song 0x9FBA07C, 5, 5
song 0x9FBA110, 5, 5
song 0x9FBA178, 5, 5
song 0x9FBA270, 5, 5
song 0x9FBA31C, 5, 5
song 0x9FBA3C8, 5, 5
song 0x9FBA4B0, 5, 5
song 0x9FBA508, 5, 5
song 0x9FBA54C, 5, 5
song 0x9FBA5C0, 5, 5
song 0x9FBA638, 5, 5
song 0x9FBA728, 5, 5
song 0x9FBA7A4, 5, 5
song 0x9FBA868, 5, 5
song 0x9FBA928, 5, 5
song 0x9FBA9A0, 5, 5
song 0x9FBAA34, 5, 5
song 0x9FBAA78, 5, 5
song 0x9FBAAD4, 5, 5
song 0x9FBAB48, 5, 5
song 0x9FBAC60, 5, 5
song 0x9FBACB0, 5, 5
song 0x9FBAD68, 5, 5
song 0x9FBADDC, 5, 5
song 0x9FBAE50, 5, 5
song 0x9FBAEC8, 5, 5
song 0x9FBAF40, 5, 5
song 0x9FBAF80, 5, 5
song 0x9FBAFDC, 5, 5
song 0x9FBB0B4, 5, 5
song 0x9FBB110, 5, 5
song 0x9FBB364, 5, 5
song 0x9FBB454, 5, 5
song 0x9FBB56C, 5, 5
song 0x9FBB660, 5, 5
song 0x9FBB754, 5, 5
song 0x9FBB7FC, 5, 5
song 0x9FBB848, 5, 5
song 0x9FBB894, 5, 5
song 0x9FBB90C, 5, 5
song 0x9FBB9DC, 5, 5
song 0x9FBBA20, 5, 5
song 0x9FBBA58, 5, 5
song 0x9FBBAC8, 5, 5
song 0x9FBBB38, 5, 5
song 0x9FBBB74, 5, 5
song 0x9FBBC20, 5, 5
song 0x9FBBC58, 5, 5
song 0x9FBBD08, 5, 5
song 0x9FBBD54, 5, 5
song 0x9FBBEB4, 5, 5
song 0x9FBBF44, 5, 5
song 0x9FBBF80, 5, 5
song 0x9FBBFC8, 5, 5
song 0x9FBC080, 5, 5
song 0x9FBC0C8, 5, 5
song 0x9FBC0F4, 5, 5
song 0x9FBC140, 2, 2
song 0x9FBC178, 5, 5
song 0x9FBC1B0, 5, 5
song 0x9FBC1EC, 5, 5
song 0x9FBC25C, 5, 5
song 0x9FBC340, 5, 5
song 0x9FBC37C, 5, 5
song 0x9FBC3AC, 5, 5
song 0x9FBC464, 5, 5
song 0x9FBC538, 5, 5
song 0x9FBC59C, 5, 5
song 0x9FBC674, 5, 5
song 0x9FBC6D8, 5, 5
song 0x9FBC890, 5, 5
song 0x9FBC8F4, 5, 5
song 0x9FBC990, 5, 5
song 0x9FBC9E0, 5, 5
song 0x9FBCA38, 2, 2
song 0x9FBCA94, 2, 2
song 0x9FBCAD4, 2, 2
song 0x9FBCB10, 2, 2
song 0x9FBCB50, 2, 2
song 0x9FBCB8C, 2, 2
song 0x9FBCBC4, 3, 3
song 0x9FBCBF4, 3, 3
song 0x9FBCC30, 2, 2
song 0x9FBCC6C, 2, 2
song 0x9FBCCB4, 2, 2
song 0x9FBCD0C, 5, 5
song 0x9FBCD68, 5, 5
song 0x9FBCDDC, 5, 5
song 0x9FBCE38, 5, 5
song 0x9FBCE44, 5, 5
song 0x9FBCE4C, 5, 5
song 0x9FBCE7C, 5, 5
song 0x9FBCEB0, 5, 5
song 0x9FBCEDC, 3, 3
song 0x9FBCF18, 3, 3
song 0x9FBCFA8, 5, 5
song 0x9FBCFB4, 3, 3
song 0x9FBCFD8, 3, 3
song 0x9FBD0E0, 5, 5
song 0x9FBD174, 5, 5
song 0x9FBD1E4, 6, 6
song 0x9FBD218, 6, 6
song 0x9FBD268, 2, 2
song 0x9FBD2D0, 2, 2
song 0x9FBD310, 2, 2
song 0x9FBD380, 5, 5
song 0x9FBD3B8, 6, 6
song 0x9FBD404, 2, 2
song 0x9FBD430, 3, 3
song 0x9FBD488, 2, 2
song 0x9FBD4B4, 2, 2
song 0x9FBD4EC, 6, 6
song 0x9FBD5C4, 6, 6

248
src/bg_palette_buffer.c Normal file
View File

@ -0,0 +1,248 @@
#include "global.h"
#define BG_PALETTE_BUFFER_SIZE 512
#define BG_PALETTE_BUFFER_CHUNK_SIZE 16
extern u16 gBGPaletteBuffer[BG_PALETTE_BUFFER_SIZE];
extern bool8 gBGPaletteUsed[BG_PALETTE_BUFFER_SIZE / BG_PALETTE_BUFFER_CHUNK_SIZE];
extern void CpuCopy(void* src, void* dest, u32 size);
#ifndef NONMATCHING
NAKED
#endif
void InitBGPaletteBuffer(void)
{
#ifdef NONMATCHING
u16 color = 0;
u16* ptr;
u32 i;
bool8 paletteUsed;
u8* p;
ptr = gBGPaletteBuffer;
i = 0x80;
i <<= 2;
do {
*ptr++ = color;
i--;
} while (i);
paletteUsed = TRUE;
p = gBGPaletteUsed;
p += 31;
do
*p-- = paletteUsed;
while ((s32) p >= (s32) &gBGPaletteUsed);
#else
asm_unified("\tpush {lr}\n"
"\tmovs r2, 0\n"
"\tldr r1, =gBGPaletteBuffer\n"
"\tmovs r0, 0x80\n"
"\tlsls r0, 2\n"
"_0800463E:\n"
"\tstrh r2, [r1]\n"
"\tadds r1, 0x2\n"
"\tsubs r0, 0x1\n"
"\tcmp r0, 0\n"
"\tbne _0800463E\n"
"\tldr r1, =gBGPaletteUsed\n"
"\tmovs r2, 0x1\n"
"\tadds r0, r1, 0\n"
"\tadds r0, 0x1F\n"
"_08004650:\n"
"\tstrb r2, [r0]\n"
"\tsubs r0, 0x1\n"
"\tcmp r0, r1\n"
"\tbge _08004650\n"
"\tpop {r0}\n"
"\tbx r0\n"
"\t.align 2, 0\n"
"\t.pool");
#endif
}
#ifndef NONMATCHING
NAKED
#endif
void SetBGPaletteBufferColorRGB(s32 index, u8 *RGBArray, s32 a1, u8 *a2)
{
#ifdef NONMATCHING
if (a1 < 0) {
a1 = 0;
}
if (a1 > 31) {
a1 = 31;
}
gBGPaletteUsed[index / 16] = 1;
if (!a2) {
gBGPaletteBuffer[index] = ((RGBArray[2] * a1 / 256 & 0x1F) << 10) | ((RGBArray[1] * a1 / 256 & 0x1F) << 5) | (RGBArray[0] * a1 / 256 & 0x1F);
}
else
{
gBGPaletteBuffer[index] = ((a2[4 * RGBArray[2] + 2] * a1 / 256 & 0x1F) << 10) | ((a2[4 * RGBArray[1] + 1] * a1 / 256 & 0x1F) << 5) | (a2[4 * RGBArray[0]] * a1 / 256 & 0x1F);
}
#else
asm_unified("\tpush {r4-r7,lr}\n"
"\tadds r4, r0, 0\n"
"\tadds r5, r1, 0\n"
"\tcmp r2, 0\n"
"\tbge _08004670\n"
"\tmovs r2, 0\n"
"_08004670:\n"
"\tcmp r2, 0x1F\n"
"\tble _08004676\n"
"\tmovs r2, 0x1F\n"
"_08004676:\n"
"\tldr r1, =gBGPaletteUsed\n"
"\tadds r0, r4, 0\n"
"\tcmp r4, 0\n"
"\tbge _08004680\n"
"\tadds r0, 0xF\n"
"_08004680:\n"
"\tasrs r0, 4\n"
"\tadds r0, r1\n"
"\tmovs r1, 0x1\n"
"\tstrb r1, [r0]\n"
"\tcmp r3, 0\n"
"\tbne _080046D4\n"
"\tldr r0, =gBGPaletteBuffer\n"
"\tlsls r1, r4, 1\n"
"\tadds r6, r1, r0\n"
"\tldrb r0, [r5, 0x2]\n"
"\tmuls r0, r2\n"
"\tcmp r0, 0\n"
"\tbge _0800469C\n"
"\tadds r0, 0xFF\n"
"_0800469C:\n"
"\tasrs r0, 8\n"
"\tmovs r3, 0x1F\n"
"\tands r0, r3\n"
"\tlsls r4, r0, 10\n"
"\tldrb r0, [r5, 0x1]\n"
"\tmuls r0, r2\n"
"\tcmp r0, 0\n"
"\tbge _080046AE\n"
"\tadds r0, 0xFF\n"
"_080046AE:\n"
"\tasrs r0, 8\n"
"\tands r0, r3\n"
"\tlsls r1, r0, 5\n"
"\torrs r1, r4\n"
"\tldrb r0, [r5]\n"
"\tmuls r0, r2\n"
"\tcmp r0, 0\n"
"\tbge _080046C0\n"
"\tadds r0, 0xFF\n"
"_080046C0:\n"
"\tasrs r0, 8\n"
"\tands r0, r3\n"
"\torrs r1, r0\n"
"\tstrh r1, [r6]\n"
"\tb _08004722\n"
"\t.align 2, 0\n"
"\t.pool\n"
"_080046D4:\n"
"\tldr r1, =gBGPaletteBuffer\n"
"\tlsls r0, r4, 1\n"
"\tadds r7, r0, r1\n"
"\tldrb r0, [r5, 0x2]\n"
"\tlsls r0, 2\n"
"\tadds r0, r3\n"
"\tldrb r0, [r0, 0x2]\n"
"\tmuls r0, r2\n"
"\tcmp r0, 0\n"
"\tbge _080046EA\n"
"\tadds r0, 0xFF\n"
"_080046EA:\n"
"\tasrs r0, 8\n"
"\tmovs r4, 0x1F\n"
"\tands r0, r4\n"
"\tlsls r6, r0, 10\n"
"\tldrb r0, [r5, 0x1]\n"
"\tlsls r0, 2\n"
"\tadds r0, r3\n"
"\tldrb r0, [r0, 0x1]\n"
"\tmuls r0, r2\n"
"\tcmp r0, 0\n"
"\tbge _08004702\n"
"\tadds r0, 0xFF\n"
"_08004702:\n"
"\tasrs r0, 8\n"
"\tands r0, r4\n"
"\tlsls r1, r0, 5\n"
"\torrs r1, r6\n"
"\tldrb r0, [r5]\n"
"\tlsls r0, 2\n"
"\tadds r0, r3\n"
"\tldrb r0, [r0]\n"
"\tmuls r0, r2\n"
"\tcmp r0, 0\n"
"\tbge _0800471A\n"
"\tadds r0, 0xFF\n"
"_0800471A:\n"
"\tasrs r0, 8\n"
"\tands r0, r4\n"
"\torrs r1, r0\n"
"\tstrh r1, [r7]\n"
"_08004722:\n"
"\tpop {r4-r7}\n"
"\tpop {r0}\n"
"\tbx r0\n"
"\t.align 2, 0\n"
"\t.pool");
#endif
}
void SetBGPaletteBufferColorArray(s32 index, u8 *colorArray)
{
gBGPaletteUsed[index / BG_PALETTE_BUFFER_CHUNK_SIZE] = TRUE;
gBGPaletteBuffer[index] = (colorArray[2] >> 3) << 10 | (colorArray[1] >> 3) << 5 | colorArray[0] >> 3;
}
void SetBGPaletteBufferColor(s32 index, u16 *color)
{
gBGPaletteUsed[index / BG_PALETTE_BUFFER_CHUNK_SIZE] = TRUE;
gBGPaletteBuffer[index] = *color;
}
void nullsub_4(void)
{
}
void nullsub_5(void)
{
}
void nullsub_143(void)
{
}
void TransferBGPaletteBuffer(void)
{
u32 i;
s32 paletteBufferIndex;
u16 *dest;
i = 0;
paletteBufferIndex = 0;
dest = (u16 *)PLTT;
do
{
if (gBGPaletteUsed[i])
{
gBGPaletteUsed[i] = 0;
CpuCopy(dest, &gBGPaletteBuffer[paletteBufferIndex], sizeof(u16) * 16);
}
++i;
dest += 16;
paletteBufferIndex += 16;
}
while ( paletteBufferIndex < BG_PALETTE_BUFFER_SIZE );
}

View File

@ -1,33 +1,9 @@
#include "global.h"
#include "file_system.h"
struct File
{
char *name;
u8 *data;
};
extern struct OpenedFile gFileCache[64];
struct OpenedFile
{
struct File *file;
u8 *data;
};
struct FileArchive
{
char magic[8];
s32 count;
struct File *entries;
};
struct SiroArchive
{
u32 magic;
u8 *data;
};
extern struct OpenedFile gUnknown_202D2A8[];
extern u32 gUnknown_203B094;
extern u32 gFileCacheCursorPosition;
extern u32 gUnknown_202D2A4;
extern int sprintf(char *, const char *, ...);
@ -41,11 +17,11 @@ void InitFileSystem(void)
for (i = 0; i < 64; i++)
{
gUnknown_202D2A8[i].file = NULL;
gUnknown_202D2A8[i].data = NULL;
gFileCache[i].file = NULL;
gFileCache[i].data = NULL;
}
gUnknown_203B094 = 0;
gFileCacheCursorPosition = 0;
gUnknown_202D2A4 = 1;
}
@ -56,14 +32,14 @@ u32 sub_800A8F8(u32 value)
return oldValue;
}
struct OpenedFile *OpenFile(char *filename, struct FileArchive *arc)
struct OpenedFile *OpenFile(const char *filename, const struct FileArchive *arc)
{
char buffer[0x12C];
s32 left, right;
s32 cursor;
s32 i;
s32 magic = 0;
s32 magicFound;
u32 magic = 0;
bool32 magicFound;
struct File *entries;
struct File *file;
@ -71,7 +47,7 @@ struct OpenedFile *OpenFile(char *filename, struct FileArchive *arc)
magicFound = 0;
if (!(u8)magic)
if (!(bool8)magic)
magicFound = 1;
if (!magicFound)
@ -108,18 +84,18 @@ struct OpenedFile *OpenFile(char *filename, struct FileArchive *arc)
return NULL;
}
cursor = gUnknown_203B094;
cursor = gFileCacheCursorPosition;
for (i = 0; i < 64; i++)
{
cursor++;
if (cursor > 63)
cursor = 0;
if (!gUnknown_202D2A8[cursor].file)
if (!gFileCache[cursor].file)
{
gUnknown_202D2A8[cursor].file = file;
gUnknown_202D2A8[cursor].data = NULL;
return &gUnknown_202D2A8[cursor];
gFileCache[cursor].file = file;
gFileCache[cursor].data = NULL;
return &gFileCache[cursor];
}
}
@ -138,7 +114,7 @@ u8 *GetFileDataPtr(struct OpenedFile *openedFile, int unused)
return GetSiroPtr(openedFile);
}
struct OpenedFile *OpenFileAndGetFileDataPtr(char *filename, struct FileArchive *arc)
struct OpenedFile *OpenFileAndGetFileDataPtr(const char *filename, const struct FileArchive *arc)
{
struct OpenedFile *openedFile = OpenFile(filename, arc);
if (openedFile)
@ -146,7 +122,7 @@ struct OpenedFile *OpenFileAndGetFileDataPtr(char *filename, struct FileArchive
return openedFile;
}
struct OpenedFile *Call_OpenFileAndGetFileDataPtr(char *filename, struct FileArchive *arc)
struct OpenedFile *Call_OpenFileAndGetFileDataPtr(const char *filename, const struct FileArchive *arc)
{
return OpenFileAndGetFileDataPtr(filename, arc);
}
@ -157,11 +133,11 @@ void CloseFile(struct OpenedFile *openedFile)
for (i = 0; i < 64; i++)
{
if (&gUnknown_202D2A8[i] == openedFile)
if (&gFileCache[i] == openedFile)
{
gUnknown_202D2A8[i].file = NULL;
gUnknown_202D2A8[i].data = NULL;
gUnknown_203B094 = i;
gFileCache[i].file = NULL;
gFileCache[i].data = NULL;
gFileCacheCursorPosition = i;
return;
}
}

View File

@ -1,12 +1,11 @@
#include "global.h"
#include "gba/flash.h"
#include "flash.h"
#include "memory.h"
extern u8 gFlashEnabled;
extern FlashIntrFunc *sub_800B6E8(s32);
extern void MemoryFill8(void *, u8, s32);
extern void MemoryCopy8(void *, void *, s32);
static u8 TryProgramSector(s32, u8 *);

947
src/m4a_2.c Normal file
View File

@ -0,0 +1,947 @@
#include "gba/m4a_internal.h"
#include "global.h"
extern char SoundMainRAM_Buffer[0x400];
extern struct SoundInfo gSoundInfo;
u32 MidiKeyToFreq(struct WaveData *wav, u8 key, u8 fineAdjust)
{
u32 val1;
u32 val2;
u32 fineAdjustShifted = fineAdjust << 24;
if (key > 178)
{
key = 178;
fineAdjustShifted = 255 << 24;
}
val1 = gScaleTable[key];
val1 = gFreqTable[val1 & 0xF] >> (val1 >> 4);
val2 = gScaleTable[key + 1];
val2 = gFreqTable[val2 & 0xF] >> (val2 >> 4);
return umul3232H32(wav->freq, val1 + umul3232H32(val2 - val1, fineAdjustShifted));
}
void UnusedDummyFunc()
{
}
void MPlayContinue(struct MusicPlayerInfo *mplayInfo)
{
if (mplayInfo->ident == ID_NUMBER)
{
mplayInfo->ident++;
mplayInfo->status &= ~MUSICPLAYER_STATUS_PAUSE;
mplayInfo->ident = ID_NUMBER;
}
}
void MPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed)
{
if (mplayInfo->ident == ID_NUMBER)
{
mplayInfo->ident++;
mplayInfo->fadeOC = speed;
mplayInfo->fadeOI = speed;
mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT);
mplayInfo->ident = ID_NUMBER;
}
}
void m4aSoundInit(void)
{
s32 i;
CpuCopy32((void *)((s32)SoundMainRAM & ~1), SoundMainRAM_Buffer, sizeof(SoundMainRAM_Buffer));
SoundInit(&gSoundInfo);
MPlayExtender(gCgbChans);
m4aSoundMode(SOUND_MODE_DA_BIT_8
| SOUND_MODE_FREQ_18157
| (14 << SOUND_MODE_MASVOL_SHIFT)
| (5 << SOUND_MODE_MAXCHN_SHIFT));
for (i = 0; i < NUM_MUSIC_PLAYERS; i++)
{
struct MusicPlayerInfo *mplayInfo = gMPlayTable[i].info;
MPlayOpen(mplayInfo, gMPlayTable[i].track, gMPlayTable[i].unk_8);
mplayInfo->unk_B = gMPlayTable[i].unk_A;
mplayInfo->memAccArea = gMPlayMemAccArea;
}
}
void m4aSoundMain(void)
{
SoundMain();
}
void m4aSongNumStart(u16 n)
{
const struct MusicPlayer *mplayTable = gMPlayTable;
const struct Song *songTable = gSongTable;
const struct Song *song = &songTable[n];
const struct MusicPlayer *mplay = &mplayTable[song->ms];
MPlayStart(mplay->info, song->header);
}
void m4aSongNumStartOrChange(u16 n)
{
const struct MusicPlayer *mplayTable = gMPlayTable;
const struct Song *songTable = gSongTable;
const struct Song *song = &songTable[n];
const struct MusicPlayer *mplay = &mplayTable[song->ms];
if (mplay->info->songHeader != song->header)
{
MPlayStart(mplay->info, song->header);
}
else
{
if ((mplay->info->status & MUSICPLAYER_STATUS_TRACK) == 0
|| (mplay->info->status & MUSICPLAYER_STATUS_PAUSE))
{
MPlayStart(mplay->info, song->header);
}
}
}
void m4aSongNumStartOrContinue(u16 n)
{
const struct MusicPlayer *mplayTable = gMPlayTable;
const struct Song *songTable = gSongTable;
const struct Song *song = &songTable[n];
const struct MusicPlayer *mplay = &mplayTable[song->ms];
if (mplay->info->songHeader != song->header)
MPlayStart(mplay->info, song->header);
else if ((mplay->info->status & MUSICPLAYER_STATUS_TRACK) == 0)
MPlayStart(mplay->info, song->header);
else if (mplay->info->status & MUSICPLAYER_STATUS_PAUSE)
MPlayContinue(mplay->info);
}
void m4aSongNumStop(u16 n)
{
const struct MusicPlayer *mplayTable = gMPlayTable;
const struct Song *songTable = gSongTable;
const struct Song *song = &songTable[n];
const struct MusicPlayer *mplay = &mplayTable[song->ms];
if (mplay->info->songHeader == song->header)
m4aMPlayStop(mplay->info);
}
void m4aSongNumContinue(u16 n)
{
const struct MusicPlayer *mplayTable = gMPlayTable;
const struct Song *songTable = gSongTable;
const struct Song *song = &songTable[n];
const struct MusicPlayer *mplay = &mplayTable[song->ms];
if (mplay->info->songHeader == song->header)
MPlayContinue(mplay->info);
}
void m4aMPlayAllStop(void)
{
s32 i;
for (i = 0; i < NUM_MUSIC_PLAYERS; i++)
m4aMPlayStop(gMPlayTable[i].info);
}
void m4aMPlayContinue(struct MusicPlayerInfo *mplayInfo)
{
MPlayContinue(mplayInfo);
}
void m4aMPlayAllContinue(void)
{
s32 i;
for (i = 0; i < NUM_MUSIC_PLAYERS; i++)
MPlayContinue(gMPlayTable[i].info);
}
void m4aMPlayFadeOut(struct MusicPlayerInfo *mplayInfo, u16 speed)
{
MPlayFadeOut(mplayInfo, speed);
}
void m4aMPlayFadeOutTemporarily(struct MusicPlayerInfo *mplayInfo, u16 speed)
{
if (mplayInfo->ident == ID_NUMBER)
{
mplayInfo->ident++;
mplayInfo->fadeOC = speed;
mplayInfo->fadeOI = speed;
mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT) | TEMPORARY_FADE;
mplayInfo->ident = ID_NUMBER;
}
}
void m4aMPlayFadeIn(struct MusicPlayerInfo *mplayInfo, u16 speed)
{
if (mplayInfo->ident == ID_NUMBER)
{
mplayInfo->ident++;
mplayInfo->fadeOC = speed;
mplayInfo->fadeOI = speed;
mplayInfo->fadeOV = (0 << FADE_VOL_SHIFT) | FADE_IN;
mplayInfo->status &= ~MUSICPLAYER_STATUS_PAUSE;
mplayInfo->ident = ID_NUMBER;
}
}
void m4aMPlayImmInit(struct MusicPlayerInfo *mplayInfo)
{
s32 trackCount = mplayInfo->trackCount;
struct MusicPlayerTrack *track = mplayInfo->tracks;
while (trackCount > 0)
{
if (track->flags & MPT_FLG_EXIST)
{
if (track->flags & MPT_FLG_START)
{
Clear64byte(track);
track->flags = MPT_FLG_EXIST;
track->bendRange = 2;
track->volX = 64;
track->lfoSpeed = 22;
track->tone.type = 1;
}
}
trackCount--;
track++;
}
}
void MPlayExtender(struct CgbChannel *cgbChans)
{
struct SoundInfo *soundInfo;
u32 ident;
REG_SOUNDCNT_X = SOUND_MASTER_ENABLE
| SOUND_4_ON
| SOUND_3_ON
| SOUND_2_ON
| SOUND_1_ON;
REG_SOUNDCNT_L = 0; // set master volume to zero
REG_NR12 = 0x8;
REG_NR22 = 0x8;
REG_NR42 = 0x8;
REG_NR14 = 0x80;
REG_NR24 = 0x80;
REG_NR44 = 0x80;
REG_NR30 = 0;
REG_NR50 = 0x77;
soundInfo = SOUND_INFO_PTR;
ident = soundInfo->ident;
if (ident != ID_NUMBER)
return;
soundInfo->ident++;
gMPlayJumpTable[8] = ply_memacc;
gMPlayJumpTable[17] = ply_lfos;
gMPlayJumpTable[19] = ply_mod;
gMPlayJumpTable[28] = ply_xcmd;
gMPlayJumpTable[29] = ply_endtie;
gMPlayJumpTable[30] = SampleFreqSet;
gMPlayJumpTable[31] = TrackStop;
gMPlayJumpTable[32] = FadeOutBody;
gMPlayJumpTable[33] = TrkVolPitSet;
soundInfo->cgbChans = (struct CgbChannel *)cgbChans;
soundInfo->CgbSound = CgbSound;
soundInfo->CgbOscOff = CgbOscOff;
soundInfo->MidiKeyToCgbFreq = MidiKeyToCgbFreq;
soundInfo->maxLines = MAX_LINES;
CpuFill32(0, cgbChans, sizeof(struct CgbChannel) * 4);
cgbChans[0].ty = 1;
cgbChans[0].panMask = 0x11;
cgbChans[1].ty = 2;
cgbChans[1].panMask = 0x22;
cgbChans[2].ty = 3;
cgbChans[2].panMask = 0x44;
cgbChans[3].ty = 4;
cgbChans[3].panMask = 0x88;
soundInfo->ident = ident;
}
void MusicPlayerJumpTableCopy(void)
{
asm("swi 0x2A");
}
void ClearChain(void *x)
{
void (*func)(void *) = *(&gMPlayJumpTable[34]);
func(x);
}
void Clear64byte(void *x)
{
void (*func)(void *) = *(&gMPlayJumpTable[35]);
func(x);
}
void SoundInit(struct SoundInfo *soundInfo)
{
soundInfo->ident = 0;
if (REG_DMA1CNT & (DMA_REPEAT << 16))
REG_DMA1CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4;
if (REG_DMA2CNT & (DMA_REPEAT << 16))
REG_DMA2CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4;
REG_DMA1CNT_H = DMA_32BIT;
REG_DMA2CNT_H = DMA_32BIT;
REG_SOUNDCNT_X = SOUND_MASTER_ENABLE
| SOUND_4_ON
| SOUND_3_ON
| SOUND_2_ON
| SOUND_1_ON;
REG_SOUNDCNT_H = SOUND_B_FIFO_RESET | SOUND_B_TIMER_0 | SOUND_B_LEFT_OUTPUT
| SOUND_A_FIFO_RESET | SOUND_A_TIMER_0 | SOUND_A_RIGHT_OUTPUT
| SOUND_ALL_MIX_FULL;
REG_SOUNDBIAS_H = (REG_SOUNDBIAS_H & 0x3F) | 0x40;
REG_DMA1SAD = (s32)soundInfo->pcmBuffer;
REG_DMA1DAD = (s32)&REG_FIFO_A;
REG_DMA2SAD = (s32)soundInfo->pcmBuffer + PCM_DMA_BUF_SIZE;
REG_DMA2DAD = (s32)&REG_FIFO_B;
SOUND_INFO_PTR = soundInfo;
CpuFill32(0, soundInfo, sizeof(struct SoundInfo));
soundInfo->maxChans = 8;
soundInfo->masterVolume = 15;
soundInfo->plynote = (u32)ply_note;
soundInfo->CgbSound = DummyFunc;
soundInfo->CgbOscOff = (void (*)(u8))DummyFunc;
soundInfo->MidiKeyToCgbFreq = (u32 (*)(u8, u8, u8))DummyFunc;
soundInfo->ExtVolPit = (u32)DummyFunc;
MPlayJumpTableCopy(gMPlayJumpTable);
soundInfo->MPlayJumpTable = (u32)gMPlayJumpTable;
SampleFreqSet(SOUND_MODE_FREQ_13379);
soundInfo->ident = ID_NUMBER;
}
void SampleFreqSet(u32 freq)
{
struct SoundInfo *soundInfo = SOUND_INFO_PTR;
freq = (freq & 0xF0000) >> 16;
soundInfo->freq = freq;
soundInfo->pcmSamplesPerVBlank = gPcmSamplesPerVBlankTable[freq - 1];
soundInfo->pcmDmaPeriod = PCM_DMA_BUF_SIZE / soundInfo->pcmSamplesPerVBlank;
// LCD refresh rate 59.7275Hz
soundInfo->pcmFreq = (597275 * soundInfo->pcmSamplesPerVBlank + 5000) / 10000;
// CPU frequency 16.78Mhz
soundInfo->divFreq = (16777216 / soundInfo->pcmFreq + 1) >> 1;
// Turn off timer 0.
REG_TM0CNT_H = 0;
// cycles per LCD fresh 280896
REG_TM0CNT_L = -(280896 / soundInfo->pcmSamplesPerVBlank);
m4aSoundVSyncOn();
while (*(vu8 *)REG_ADDR_VCOUNT == 159)
;
while (*(vu8 *)REG_ADDR_VCOUNT != 159)
;
REG_TM0CNT_H = TIMER_ENABLE | TIMER_1CLK;
}
void m4aSoundMode(u32 mode)
{
struct SoundInfo *soundInfo = SOUND_INFO_PTR;
u32 temp;
if (soundInfo->ident != ID_NUMBER)
return;
soundInfo->ident++;
temp = mode & (SOUND_MODE_REVERB_SET | SOUND_MODE_REVERB_VAL);
if (temp)
soundInfo->reverb = temp & SOUND_MODE_REVERB_VAL;
temp = mode & SOUND_MODE_MAXCHN;
if (temp)
{
struct SoundChannel *chan;
soundInfo->maxChans = temp >> SOUND_MODE_MAXCHN_SHIFT;
temp = MAX_DIRECTSOUND_CHANNELS;
chan = &soundInfo->chans[0];
while (temp != 0)
{
chan->status = 0;
temp--;
chan++;
}
}
temp = mode & SOUND_MODE_MASVOL;
if (temp)
soundInfo->masterVolume = temp >> SOUND_MODE_MASVOL_SHIFT;
temp = mode & SOUND_MODE_DA_BIT;
if (temp)
{
temp = (temp & 0x300000) >> 14;
REG_SOUNDBIAS_H = (REG_SOUNDBIAS_H & 0x3F) | temp;
}
temp = mode & SOUND_MODE_FREQ;
if (temp)
{
m4aSoundVSyncOff();
SampleFreqSet(temp);
}
soundInfo->ident = ID_NUMBER;
}
void SoundClear(void)
{
struct SoundInfo *soundInfo = SOUND_INFO_PTR;
s32 i;
void *chan;
if (soundInfo->ident != ID_NUMBER)
return;
soundInfo->ident++;
i = MAX_DIRECTSOUND_CHANNELS;
chan = &soundInfo->chans[0];
while (i > 0)
{
((struct SoundChannel *)chan)->status = 0;
i--;
chan = (void *)((s32)chan + sizeof(struct SoundChannel));
}
chan = soundInfo->cgbChans;
if (chan)
{
i = 1;
while (i <= 4)
{
soundInfo->CgbOscOff(i);
((struct CgbChannel *)chan)->sf = 0;
i++;
chan = (void *)((s32)chan + sizeof(struct CgbChannel));
}
}
soundInfo->ident = ID_NUMBER;
}
void m4aSoundVSyncOff(void)
{
struct SoundInfo *soundInfo = SOUND_INFO_PTR;
if (soundInfo->ident >= ID_NUMBER && soundInfo->ident <= ID_NUMBER + 1)
{
soundInfo->ident += 10;
if (REG_DMA1CNT & (DMA_REPEAT << 16))
REG_DMA1CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4;
if (REG_DMA2CNT & (DMA_REPEAT << 16))
REG_DMA2CNT = ((DMA_ENABLE | DMA_START_NOW | DMA_32BIT | DMA_SRC_INC | DMA_DEST_FIXED) << 16) | 4;
REG_DMA1CNT_H = DMA_32BIT;
REG_DMA2CNT_H = DMA_32BIT;
CpuFill32(0, soundInfo->pcmBuffer, sizeof(soundInfo->pcmBuffer));
}
}
void m4aSoundVSyncOn(void)
{
struct SoundInfo *soundInfo = SOUND_INFO_PTR;
u32 ident = soundInfo->ident;
if (ident == ID_NUMBER)
return;
REG_DMA1CNT_H = DMA_ENABLE | DMA_START_SPECIAL | DMA_32BIT | DMA_REPEAT;
REG_DMA2CNT_H = DMA_ENABLE | DMA_START_SPECIAL | DMA_32BIT | DMA_REPEAT;
soundInfo->pcmDmaCounter = 0;
soundInfo->ident = ident - 10;
}
void MPlayOpen(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *tracks, u8 trackCount)
{
struct SoundInfo *soundInfo;
if (trackCount == 0)
return;
if (trackCount > MAX_MUSICPLAYER_TRACKS)
trackCount = MAX_MUSICPLAYER_TRACKS;
soundInfo = SOUND_INFO_PTR;
if (soundInfo->ident != ID_NUMBER)
return;
soundInfo->ident++;
Clear64byte(mplayInfo);
mplayInfo->tracks = tracks;
mplayInfo->trackCount = trackCount;
mplayInfo->status = MUSICPLAYER_STATUS_PAUSE;
while (trackCount != 0)
{
tracks->flags = 0;
trackCount--;
tracks++;
}
if (soundInfo->func != 0)
{
mplayInfo->func = soundInfo->func;
mplayInfo->intp = soundInfo->intp;
soundInfo->func = 0;
}
soundInfo->intp = (u32)mplayInfo;
soundInfo->func = (u32)MPlayMain;
soundInfo->ident = ID_NUMBER;
mplayInfo->ident = ID_NUMBER;
}
void MPlayStart(struct MusicPlayerInfo *mplayInfo, struct SongHeader *songHeader)
{
s32 i;
u8 unk_B;
struct MusicPlayerTrack *track;
if (mplayInfo->ident != ID_NUMBER)
return;
unk_B = mplayInfo->unk_B;
if (!unk_B
|| ((!mplayInfo->songHeader || !(mplayInfo->tracks[0].flags & MPT_FLG_START))
&& ((mplayInfo->status & MUSICPLAYER_STATUS_TRACK) == 0
|| (mplayInfo->status & MUSICPLAYER_STATUS_PAUSE)))
|| (mplayInfo->priority <= songHeader->priority))
{
mplayInfo->ident++;
mplayInfo->status = 0;
mplayInfo->songHeader = songHeader;
mplayInfo->tone = songHeader->tone;
mplayInfo->priority = songHeader->priority;
mplayInfo->clock = 0;
mplayInfo->tempoD = 150;
mplayInfo->tempoI = 150;
mplayInfo->tempoU = 0x100;
mplayInfo->tempoC = 0;
mplayInfo->fadeOI = 0;
i = 0;
track = mplayInfo->tracks;
while (i < songHeader->trackCount && i < mplayInfo->trackCount)
{
TrackStop(mplayInfo, track);
track->flags = MPT_FLG_EXIST | MPT_FLG_START;
track->chan = 0;
track->cmdPtr = songHeader->part[i];
i++;
track++;
}
while (i < mplayInfo->trackCount)
{
TrackStop(mplayInfo, track);
track->flags = 0;
i++;
track++;
}
if (songHeader->reverb & 0x80)
m4aSoundMode(songHeader->reverb);
mplayInfo->ident = ID_NUMBER;
}
}
void m4aMPlayStop(struct MusicPlayerInfo *mplayInfo)
{
s32 i;
struct MusicPlayerTrack *track;
if (mplayInfo->ident != ID_NUMBER)
return;
mplayInfo->ident++;
mplayInfo->status |= MUSICPLAYER_STATUS_PAUSE;
i = mplayInfo->trackCount;
track = mplayInfo->tracks;
while (i > 0)
{
TrackStop(mplayInfo, track);
i--;
track++;
}
mplayInfo->ident = ID_NUMBER;
}
void FadeOutBody(struct MusicPlayerInfo *mplayInfo)
{
s32 i;
struct MusicPlayerTrack *track;
u16 fadeOI = mplayInfo->fadeOI;
register u32 temp asm("r3");
register u16 mask asm("r2");
if (fadeOI == 0)
return;
mplayInfo->fadeOC--;
temp = 0xFFFF;
mask = temp;
if (mplayInfo->fadeOC != 0)
return;
mplayInfo->fadeOC = fadeOI;
if (mplayInfo->fadeOV & FADE_IN)
{
mplayInfo->fadeOV += (4 << FADE_VOL_SHIFT);
if ((u16)(mplayInfo->fadeOV & mask) >= (64 << FADE_VOL_SHIFT))
{
mplayInfo->fadeOV = (64 << FADE_VOL_SHIFT);
mplayInfo->fadeOI = 0;
}
}
else
{
mplayInfo->fadeOV -= (4 << FADE_VOL_SHIFT);
if ((s16)(mplayInfo->fadeOV & mask) <= 0)
{
i = mplayInfo->trackCount;
track = mplayInfo->tracks;
while (i > 0)
{
register u32 fadeOV asm("r7");
u32 val;
TrackStop(mplayInfo, track);
val = TEMPORARY_FADE;
fadeOV = mplayInfo->fadeOV;
val &= fadeOV;
if (!val)
track->flags = 0;
i--;
track++;
}
if (mplayInfo->fadeOV & TEMPORARY_FADE)
mplayInfo->status |= MUSICPLAYER_STATUS_PAUSE;
else
mplayInfo->status = MUSICPLAYER_STATUS_PAUSE;
mplayInfo->fadeOI = 0;
return;
}
}
i = mplayInfo->trackCount;
track = mplayInfo->tracks;
while (i > 0)
{
if (track->flags & MPT_FLG_EXIST)
{
track->volX = (mplayInfo->fadeOV >> FADE_VOL_SHIFT);
track->flags |= MPT_FLG_VOLCHG;
}
i--;
track++;
}
}
void TrkVolPitSet(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
if (track->flags & MPT_FLG_VOLSET)
{
s32 x;
s32 y;
x = (u32)(track->vol * track->volX) >> 5;
if (track->modT == 1)
x = (u32)(x * (track->modM + 128)) >> 7;
y = 2 * track->pan + track->panX;
if (track->modT == 2)
y += track->modM;
if (y < -128)
y = -128;
else if (y > 127)
y = 127;
track->volMR = (u32)((y + 128) * x) >> 8;
track->volML = (u32)((127 - y) * x) >> 8;
}
if (track->flags & MPT_FLG_PITSET)
{
s32 bend = track->bend * track->bendRange;
register s32 x asm("r1") = track->tune;
x += bend;
x *= 4;
x += (track->keyShift << 8);
x += (track->keyShiftX << 8);
x += track->pitX;
if (track->modT == 0)
x += 16 * track->modM;
track->keyM = x >> 8;
track->pitM = x;
}
track->flags &= ~(MPT_FLG_PITSET | MPT_FLG_VOLSET);
}
u32 MidiKeyToCgbFreq(u8 chanNum, u8 key, u8 fineAdjust)
{
if (chanNum == 4)
{
if (key <= 20)
{
key = 0;
}
else
{
key -= 21;
if (key > 59)
key = 59;
}
return gNoiseTable[key];
}
else
{
s32 val1;
s32 val2;
if (key <= 35)
{
fineAdjust = 0;
key = 0;
}
else
{
key -= 36;
if (key > 130)
{
key = 130;
fineAdjust = 255;
}
}
val1 = gCgbScaleTable[key];
val1 = gCgbFreqTable[val1 & 0xF] >> (val1 >> 4);
val2 = gCgbScaleTable[key + 1];
val2 = gCgbFreqTable[val2 & 0xF] >> (val2 >> 4);
return val1 + ((fineAdjust * (val2 - val1)) >> 8) + 2048;
}
}
void CgbOscOff(u8 chanNum)
{
switch (chanNum)
{
case 1:
REG_NR12 = 8;
REG_NR14 = 0x80;
break;
case 2:
REG_NR22 = 8;
REG_NR24 = 0x80;
break;
case 3:
REG_NR30 = 0;
break;
default:
REG_NR42 = 8;
REG_NR44 = 0x80;
}
}
static inline int CgbPan(struct CgbChannel *chan)
{
u32 rightVolume = chan->rightVolume;
u32 leftVolume = chan->leftVolume;
if ((rightVolume = (u8)rightVolume) >= (leftVolume = (u8)leftVolume))
{
if (rightVolume / 2 >= leftVolume)
{
chan->pan = 0x0F;
return 1;
}
}
else
{
if (leftVolume / 2 >= rightVolume)
{
chan->pan = 0xF0;
return 1;
}
}
return 0;
}
#ifndef NONMATCHING
NAKED
#endif
void CgbModVol(struct CgbChannel *chan)
{
#ifdef NONMATCHING
struct SoundInfo *soundInfo = SOUND_INFO_PTR;
if ((soundInfo->mode & 1) || !CgbPan(chan))
{
chan->pan = 0xFF;
chan->eg = (u32)(chan->rightVolume + chan->leftVolume) >> 4;
}
else
{
// Force chan->rightVolume and chan->leftVolume to be read from memory again,
// even though there is no reason to do so.
// The command line option "-fno-gcse" achieves the same result as this.
asm("" : : : "memory");
chan->eg = (u32)(chan->rightVolume + chan->leftVolume) >> 4;
if (chan->eg > 15)
chan->eg = 15;
}
chan->sg = (chan->eg * chan->su + 15) >> 4;
chan->pan &= chan->panMask;
#else
asm_unified("\tpush {r4,lr}\n"
"\tadds r1, r0, 0\n"
"\tldrb r0, [r1, 0x2]\n"
"\tlsls r2, r0, 24\n"
"\tlsrs r4, r2, 24\n"
"\tldrb r3, [r1, 0x3]\n"
"\tlsls r0, r3, 24\n"
"\tlsrs r3, r0, 24\n"
"\tcmp r4, r3\n"
"\tbcc _080AFA94\n"
"\tlsrs r0, r2, 25\n"
"\tcmp r0, r3\n"
"\tbcc _080AFAA0\n"
"\tmovs r0, 0xF\n"
"\tstrb r0, [r1, 0x1B]\n"
"\tb _080AFAAE\n"
"_080AFA94:\n"
"\tlsrs r0, 25\n"
"\tcmp r0, r4\n"
"\tbcc _080AFAA0\n"
"\tmovs r0, 0xF0\n"
"\tstrb r0, [r1, 0x1B]\n"
"\tb _080AFAAE\n"
"_080AFAA0:\n"
"\tmovs r0, 0xFF\n"
"\tstrb r0, [r1, 0x1B]\n"
"\tldrb r2, [r1, 0x3]\n"
"\tldrb r3, [r1, 0x2]\n"
"\tadds r0, r2, r3\n"
"\tlsrs r0, 4\n"
"\tb _080AFABE\n"
"_080AFAAE:\n"
"\tldrb r2, [r1, 0x3]\n"
"\tldrb r3, [r1, 0x2]\n"
"\tadds r0, r2, r3\n"
"\tlsrs r0, 4\n"
"\tstrb r0, [r1, 0xA]\n"
"\tcmp r0, 0xF\n"
"\tbls _080AFAC0\n"
"\tmovs r0, 0xF\n"
"_080AFABE:\n"
"\tstrb r0, [r1, 0xA]\n"
"_080AFAC0:\n"
"\tldrb r2, [r1, 0x6]\n"
"\tldrb r3, [r1, 0xA]\n"
"\tadds r0, r2, 0\n"
"\tmuls r0, r3\n"
"\tadds r0, 0xF\n"
"\tasrs r0, 4\n"
"\tstrb r0, [r1, 0x19]\n"
"\tldrb r0, [r1, 0x1C]\n"
"\tldrb r2, [r1, 0x1B]\n"
"\tands r0, r2\n"
"\tstrb r0, [r1, 0x1B]\n"
"\tpop {r4}\n"
"\tpop {r0}\n"
"\tbx r0\n");
#endif
}

384
src/m4a_4.c Normal file
View File

@ -0,0 +1,384 @@
#include "gba/m4a_internal.h"
void m4aMPlayTempoControl(struct MusicPlayerInfo *mplayInfo, u16 tempo)
{
if (mplayInfo->ident == ID_NUMBER)
{
mplayInfo->ident++;
mplayInfo->tempoU = tempo;
mplayInfo->tempoI = (mplayInfo->tempoD * mplayInfo->tempoU) >> 8;
mplayInfo->ident = ID_NUMBER;
}
}
void m4aMPlayVolumeControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u16 volume)
{
s32 i;
u32 bit;
struct MusicPlayerTrack *track;
if (mplayInfo->ident != ID_NUMBER)
return;
mplayInfo->ident++;
i = mplayInfo->trackCount;
track = mplayInfo->tracks;
bit = 1;
while (i > 0)
{
if (trackBits & bit)
{
if (track->flags & MPT_FLG_EXIST)
{
track->volX = volume / 4;
track->flags |= MPT_FLG_VOLCHG;
}
}
i--;
track++;
bit <<= 1;
}
mplayInfo->ident = ID_NUMBER;
}
void m4aMPlayPitchControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, s16 pitch)
{
s32 i;
u32 bit;
struct MusicPlayerTrack *track;
if (mplayInfo->ident != ID_NUMBER)
return;
mplayInfo->ident++;
i = mplayInfo->trackCount;
track = mplayInfo->tracks;
bit = 1;
while (i > 0)
{
if (trackBits & bit)
{
if (track->flags & MPT_FLG_EXIST)
{
track->keyShiftX = pitch >> 8;
track->pitX = pitch;
track->flags |= MPT_FLG_PITCHG;
}
}
i--;
track++;
bit <<= 1;
}
mplayInfo->ident = ID_NUMBER;
}
void m4aMPlayPanpotControl(struct MusicPlayerInfo *mplayInfo, u16 trackBits, s8 pan)
{
s32 i;
u32 bit;
struct MusicPlayerTrack *track;
if (mplayInfo->ident != ID_NUMBER)
return;
mplayInfo->ident++;
i = mplayInfo->trackCount;
track = mplayInfo->tracks;
bit = 1;
while (i > 0)
{
if (trackBits & bit)
{
if (track->flags & MPT_FLG_EXIST)
{
track->panX = pan;
track->flags |= MPT_FLG_VOLCHG;
}
}
i--;
track++;
bit <<= 1;
}
mplayInfo->ident = ID_NUMBER;
}
void ClearModM(struct MusicPlayerTrack *track)
{
track->lfoSpeedC = 0;
track->modM = 0;
if (track->modT == 0)
track->flags |= MPT_FLG_PITCHG;
else
track->flags |= MPT_FLG_VOLCHG;
}
void m4aMPlayModDepthSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 modDepth)
{
s32 i;
u32 bit;
struct MusicPlayerTrack *track;
if (mplayInfo->ident != ID_NUMBER)
return;
mplayInfo->ident++;
i = mplayInfo->trackCount;
track = mplayInfo->tracks;
bit = 1;
while (i > 0)
{
if (trackBits & bit)
{
if (track->flags & MPT_FLG_EXIST)
{
track->mod = modDepth;
if (!track->mod)
ClearModM(track);
}
}
i--;
track++;
bit <<= 1;
}
mplayInfo->ident = ID_NUMBER;
}
void m4aMPlayLFOSpeedSet(struct MusicPlayerInfo *mplayInfo, u16 trackBits, u8 lfoSpeed)
{
s32 i;
u32 bit;
struct MusicPlayerTrack *track;
if (mplayInfo->ident != ID_NUMBER)
return;
mplayInfo->ident++;
i = mplayInfo->trackCount;
track = mplayInfo->tracks;
bit = 1;
while (i > 0)
{
if (trackBits & bit)
{
if (track->flags & MPT_FLG_EXIST)
{
track->lfoSpeed = lfoSpeed;
if (!track->lfoSpeed)
ClearModM(track);
}
}
i--;
track++;
bit <<= 1;
}
mplayInfo->ident = ID_NUMBER;
}
#define MEMACC_COND_JUMP(cond) \
if (cond) \
goto cond_true; \
else \
goto cond_false; \
void ply_memacc(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
u32 op;
u8 *addr;
u8 data;
op = *track->cmdPtr;
track->cmdPtr++;
addr = mplayInfo->memAccArea + *track->cmdPtr;
track->cmdPtr++;
data = *track->cmdPtr;
track->cmdPtr++;
switch (op)
{
case 0:
*addr = data;
return;
case 1:
*addr += data;
return;
case 2:
*addr -= data;
return;
case 3:
*addr = mplayInfo->memAccArea[data];
return;
case 4:
*addr += mplayInfo->memAccArea[data];
return;
case 5:
*addr -= mplayInfo->memAccArea[data];
return;
case 6:
MEMACC_COND_JUMP(*addr == data)
return;
case 7:
MEMACC_COND_JUMP(*addr != data)
return;
case 8:
MEMACC_COND_JUMP(*addr > data)
return;
case 9:
MEMACC_COND_JUMP(*addr >= data)
return;
case 10:
MEMACC_COND_JUMP(*addr <= data)
return;
case 11:
MEMACC_COND_JUMP(*addr < data)
return;
case 12:
MEMACC_COND_JUMP(*addr == mplayInfo->memAccArea[data])
return;
case 13:
MEMACC_COND_JUMP(*addr != mplayInfo->memAccArea[data])
return;
case 14:
MEMACC_COND_JUMP(*addr > mplayInfo->memAccArea[data])
return;
case 15:
MEMACC_COND_JUMP(*addr >= mplayInfo->memAccArea[data])
return;
case 16:
MEMACC_COND_JUMP(*addr <= mplayInfo->memAccArea[data])
return;
case 17:
MEMACC_COND_JUMP(*addr < mplayInfo->memAccArea[data])
return;
default:
return;
}
cond_true:
{
void (*func)(struct MusicPlayerInfo *, struct MusicPlayerTrack *) = *(&gMPlayJumpTable[1]);
func(mplayInfo, track);
return;
}
cond_false:
track->cmdPtr += 4;
}
void ply_xcmd(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
u32 n = *track->cmdPtr;
track->cmdPtr++;
gXcmdTable[n](mplayInfo, track);
}
void ply_xxx(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
void (*func)(struct MusicPlayerInfo *, struct MusicPlayerTrack *) = *(&gMPlayJumpTable[0]);
func(mplayInfo, track);
}
#define READ_XCMD_BYTE(var, n) \
{ \
u32 byte = track->cmdPtr[(n)]; \
byte <<= n * 8; \
(var) &= ~(0xFF << (n * 8)); \
(var) |= byte; \
}
void ply_xwave(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
u32 wav;
READ_XCMD_BYTE(wav, 0) // UB: uninitialized variable
READ_XCMD_BYTE(wav, 1)
READ_XCMD_BYTE(wav, 2)
READ_XCMD_BYTE(wav, 3)
track->tone.wav = (struct WaveData *)wav;
track->cmdPtr += 4;
}
void ply_xtype(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
track->tone.type = *track->cmdPtr;
track->cmdPtr++;
}
void ply_xatta(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
track->tone.attack = *track->cmdPtr;
track->cmdPtr++;
}
void ply_xdeca(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
track->tone.decay = *track->cmdPtr;
track->cmdPtr++;
}
void ply_xsust(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
track->tone.sustain = *track->cmdPtr;
track->cmdPtr++;
}
void ply_xrele(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
track->tone.release = *track->cmdPtr;
track->cmdPtr++;
}
void ply_xiecv(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
track->echoVolume = *track->cmdPtr;
track->cmdPtr++;
}
void ply_xiecl(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
track->echoLength = *track->cmdPtr;
track->cmdPtr++;
}
void ply_xleng(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
track->tone.length = *track->cmdPtr;
track->cmdPtr++;
}
void ply_xswee(struct MusicPlayerInfo *mplayInfo, struct MusicPlayerTrack *track)
{
track->tone.pan_sweep = *track->cmdPtr;
track->cmdPtr++;
}
void DummyFunc()
{
;
}

223
src/m4a_tables.c Normal file
View File

@ -0,0 +1,223 @@
#include "gba/m4a_internal.h"
// Some of these functions have different signatures, so we need to make this
// an array of void pointers or a struct. It's simpler to just make it an array
// for now.
void * const gMPlayJumpTableTemplate[] =
{
ply_fine,
ply_goto,
ply_patt,
ply_pend,
ply_rept,
ply_fine,
ply_fine,
ply_fine,
ply_fine,
ply_prio,
ply_tempo,
ply_keysh,
ply_voice,
ply_vol,
ply_pan,
ply_bend,
ply_bendr,
ply_lfos,
ply_lfodl,
ply_mod,
ply_modt,
ply_fine,
ply_fine,
ply_tune,
ply_fine,
ply_fine,
ply_fine,
ply_port,
ply_fine,
ply_endtie,
SampleFreqSet,
TrackStop,
FadeOutBody,
TrkVolPitSet,
RealClearChain,
SoundMainBTM,
};
const u8 gScaleTable[] =
{
0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB,
0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7, 0xD8, 0xD9, 0xDA, 0xDB,
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB,
0xB0, 0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA, 0xBB,
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B,
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B,
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B,
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B,
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
};
const u32 gFreqTable[] =
{
2147483648u,
2275179671u,
2410468894u,
2553802834u,
2705659852u,
2866546760u,
3037000500u,
3217589947u,
3408917802u,
3611622603u,
3826380858u,
4053909305u,
};
const u16 gPcmSamplesPerVBlankTable[] =
{
96,
132,
176,
224,
264,
304,
352,
448,
528,
608,
672,
704,
};
const u8 gCgbScaleTable[] =
{
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B,
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B,
0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B,
0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B,
0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B,
0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B,
0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B,
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B,
0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9A, 0x9B,
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB,
};
const s16 gCgbFreqTable[] =
{
-2004,
-1891,
-1785,
-1685,
-1591,
-1501,
-1417,
-1337,
-1262,
-1192,
-1125,
-1062,
};
const u8 gNoiseTable[] =
{
0xD7, 0xD6, 0xD5, 0xD4,
0xC7, 0xC6, 0xC5, 0xC4,
0xB7, 0xB6, 0xB5, 0xB4,
0xA7, 0xA6, 0xA5, 0xA4,
0x97, 0x96, 0x95, 0x94,
0x87, 0x86, 0x85, 0x84,
0x77, 0x76, 0x75, 0x74,
0x67, 0x66, 0x65, 0x64,
0x57, 0x56, 0x55, 0x54,
0x47, 0x46, 0x45, 0x44,
0x37, 0x36, 0x35, 0x34,
0x27, 0x26, 0x25, 0x24,
0x17, 0x16, 0x15, 0x14,
0x07, 0x06, 0x05, 0x04,
0x03, 0x02, 0x01, 0x00,
};
const u8 gCgb3Vol[] =
{
0x00, 0x00,
0x60, 0x60, 0x60, 0x60,
0x40, 0x40, 0x40, 0x40,
0x80, 0x80, 0x80, 0x80,
0x20, 0x20,
};
const u8 gClockTable[] =
{
0x00,
0x01,
0x02,
0x03,
0x04,
0x05,
0x06,
0x07,
0x08,
0x09,
0x0A,
0x0B,
0x0C,
0x0D,
0x0E,
0x0F,
0x10,
0x11,
0x12,
0x13,
0x14,
0x15,
0x16,
0x17,
0x18,
0x1C,
0x1E,
0x20,
0x24,
0x28,
0x2A,
0x2C,
0x30,
0x34,
0x36,
0x38,
0x3C,
0x40,
0x42,
0x44,
0x48,
0x4C,
0x4E,
0x50,
0x54,
0x58,
0x5A,
0x5C,
0x60,
};
const XcmdFunc gXcmdTable[] =
{
ply_xxx,
ply_xwave,
ply_xtype,
ply_xxx,
ply_xatta,
ply_xdeca,
ply_xsust,
ply_xrele,
ply_xiecv,
ply_xiecl,
ply_xleng,
ply_xswee
};

145
src/memory.c Normal file
View File

@ -0,0 +1,145 @@
#include "global.h"
#include "memory.h"
extern struct HeapFreeListElement gMainHeapFreeList[32];
extern u8 gMainHeap[HEAP_SIZE];
extern u32 gHeapCount;
extern struct HeapDescriptor gMainHeapDescriptor;
extern struct HeapDescriptor *gHeapDescriptorList[8];
extern void CpuClear(u32 *dest, s32 size);
void InitHeapInternal(void);
void InitHeap(void)
{
InitHeapInternal();
}
void MemoryClear8(u8 *dest, s32 size)
{
while (size > 0)
{
size -= 1;
*dest++ = 0;
}
}
void MemoryClear16(u16 *dest, s32 size)
{
while (size > 0)
{
size -= 2;
*dest++ = 0;
}
}
void MemoryClear32(u32 *dest, s32 size)
{
CpuClear(dest, size);
}
void MemoryFill8(u8 *dest, u8 value, s32 size)
{
while (size > 0)
{
size -= 1;
*dest++ = value;
}
}
void MemoryFill16(u16 *dest, u16 value, s32 size)
{
while (size > 0)
{
size -= 2;
*dest++ = value;
}
}
void MemoryFill32(u32 *dest, u32 value, s32 size)
{
while (size > 0)
{
size -= 4;
*dest++ = value;
}
}
void MemoryCopy8(u8 *dest, u8 *src, s32 size)
{
while (size > 0)
{
size -= 1;
*dest++ = *src++;
}
}
void MemoryCopy16(u16 *dest, u16 *src, s32 size)
{
while (size > 0)
{
size -= 2;
*dest++ = *src++;
}
}
void MemoryCopy32(u32 *dest, u32 *src, s32 size)
{
while (size > 0)
{
size -= 4;
*dest++ = *src++;
}
}
void InitHeapInternal(void)
{
struct HeapSettings settings;
settings.start = gMainHeap;
settings.size = HEAP_SIZE;
gHeapCount = 0;
DoInitHeap(&gMainHeapDescriptor, &settings, gMainHeapFreeList, sizeof(gMainHeapFreeList) / sizeof(struct HeapFreeListElement));
}
void DoInitHeap(struct HeapDescriptor *descriptor, struct HeapSettings *settings, struct HeapFreeListElement *freeList, u32 freeListLength)
{
u32 aligned_size;
aligned_size = settings->size & 0xFFFFFFFC;
gHeapDescriptorList[gHeapCount++] = descriptor;
descriptor->start = settings->start;
descriptor->size = aligned_size;
descriptor->unk0 = 2;
descriptor->parentHeap = NULL;
descriptor->freeList = freeList;
descriptor->freeCount = 1;
descriptor->freeListLength = freeListLength;
freeList->unk_atb = 0;
freeList->atb = 0;
freeList->block.start = descriptor->start;
freeList->block.size = aligned_size;
freeList->block.allocatedSize = 0;
freeList->grp = 0;
}
void InitSubHeap(struct HeapDescriptor *parentHeap, struct HeapMemoryBlock *block, u32 freeListMax)
{
u32 freeListSize;
u32 aligned_size;
u32 alignment;
struct HeapFreeListElement *freeList;
struct HeapSettings settings;
freeListSize = freeListMax * 3;
alignment = ~3;
freeListSize *= 8;
aligned_size = (block->size - freeListSize) & alignment;
freeList = (struct HeapFreeListElement *)block->start;
settings.start = &((u8 *)block->start)[freeListSize];
settings.size = aligned_size;
DoInitHeap(parentHeap, &settings, freeList, freeListMax);
}

64
src/save.c Normal file
View File

@ -0,0 +1,64 @@
#include "global.h"
extern u32 gUnknown_203B17C;
extern u32 gUnknown_203B180;
extern u32 *gUnknown_203B184;
extern u32 gUnknown_202DE28;
u32 sub_8011C1C(void)
{
return gUnknown_203B17C;
}
void sub_8011C28(u32 in)
{
gUnknown_203B17C = in;
}
u32 sub_8011C34(void)
{
return gUnknown_202DE28;
}
void sub_8011C40(u32 in)
{
gUnknown_202DE28 = in;
}
u32 sub_8011C4C(void)
{
return gUnknown_203B180;
}
void CalculateChecksum(u8 *out, u32 size)
{
u32 checksum = 0;
s32 i = size / 4;
if (i > 1)
{
u32 *ptr = (u32 *)&out[4];
--i;
do
checksum += *ptr++;
while (--i);
}
*(u32 *)out = checksum;
}
bool8 ValidateChecksum(u8 *in, u32 size)
{
u32 checksum = 0;
s32 i = size / 4;
if (i > 1)
{
u32 *ptr = (u32 *)&in[4];
--i;
do
checksum += *ptr++;
while (--i);
}
if (*(u32 *)in != checksum)
return TRUE;
return FALSE;
}

13
src/save1.c Normal file
View File

@ -0,0 +1,13 @@
#include "global.h"
extern void MemoryFree(void *);
extern u8 *gUnknown_203B194;
void sub_80129FC()
{
if (gUnknown_203B194) {
MemoryFree(gUnknown_203B194);
gUnknown_203B194 = NULL;
}
}

10
src/sprite.c Normal file
View File

@ -0,0 +1,10 @@
#include "global.h"
void ResetSprites(bool32);
void SetSavingIconCoords(u32);
void InitSprites(void)
{
ResetSprites(1);
SetSavingIconCoords(0);
}

198
src/text.c Normal file
View File

@ -0,0 +1,198 @@
#include "global.h"
#include "file_system.h"
#include "code_800558C.h"
#include "code_800B540.h"
struct UnkTextStruct1 {
u8 fill00[4];
u16 unk04;
u8 fill06[2];
u16 unk08;
u8 fill04[0x3c];
u8 unk46;
};
struct UnkTextStruct2 {
u8 fill00[0x0c];
s16 unk0c;
u8 fill0e[2];
s16 unk10;
u8 fill12[0x06];
};
extern char gUnknown_3000E94[];
EWRAM_DATA struct UnkTextStruct1 gUnknown_2027370[4];
EWRAM_DATA u8 *gKanji[2];
EWRAM_DATA u16 gUnknown_2027498;
EWRAM_DATA u8 gUnknown_20274A5;
EWRAM_DATA u32 gUnknown_20274AC;
EWRAM_DATA vu32 gUnknown_20274B0;
EWRAM_DATA u8 gUnknown_20274B4[0x3b00];
EWRAM_DATA struct OpenedFile *gKanjiFiles[2];
EWRAM_DATA struct UnkTextStruct2 gUnknown_202AFC0[4];
EWRAM_DATA u32 gUnknown_202B020;
EWRAM_DATA u32 gUnknown_202B024;
EWRAM_DATA u32 gUnknown_202B028[2];
EWRAM_DATA u32 gUnknown_202B030;
EWRAM_DATA u8 gUnknown_202B034;
EWRAM_DATA u16 gUnknown_202B038[2][32][32];
u32 xxx_update_some_bg_tiles(u32 a0);
void sub_8006438(const struct UnkTextStruct2 *a0, u8 a1, u8 a2, u32 *a3);
void sub_8006554(void *a0, void *a1, void *a2, void *a3, u32 a4, const struct UnkTextStruct2 *a5, u8 a6, u32 a7, u32 *a8, u32 a9);
void sub_800898C(void);
void sub_80089AC(const struct UnkTextStruct2 *a0, void *a1);
void sub_8009388(void);
extern const struct UnkTextStruct2 gUnknown_80B857C[4];
extern const char gUnknown_80B87B4[];
extern const char gUnknown_80B87BC[];
extern const struct FileArchive gUnknown_8300500;
extern const u32 gUnknown_80B87C4[8];
extern const u32 gUnknown_80B87E4[8];
extern const u32 gUnknown_80B8804[4];
void sub_8006218(void)
{
int i;
int j;
int k;
gUnknown_20274AC = 0;
gKanjiFiles[0] = OpenFileAndGetFileDataPtr(gUnknown_80B87B4, &gUnknown_8300500);
gKanjiFiles[1] = OpenFileAndGetFileDataPtr(gUnknown_80B87BC, &gUnknown_8300500);
gKanji[0] = gKanjiFiles[0]->data;
gKanji[1] = gKanjiFiles[1]->data;
gUnknown_202B028[0] = 11;
gUnknown_202B028[1] = 12;
for (k = 0; k < 4; k++)
{
gUnknown_2027370[k].unk04 = 0;
gUnknown_2027370[k].unk08 = 0;
gUnknown_2027370[k].unk46 = 0;
}
gUnknown_2027498 = 0;
for (i = 0; i < 20; i++)
{
gUnknown_202B038[0][i][0] = 0xf279;
gUnknown_202B038[1][i][0] = 0xf27a;
for (j = 1; j < 32; j++)
{
gUnknown_202B038[0][i][j] = 0;
gUnknown_202B038[1][i][j] = 0xf27a;
}
}
gUnknown_202B034 = 1;
gUnknown_202B030 = 0x88888888;
gUnknown_203B078 = NULL;
gUnknown_20274A5 = 0;
gUnknown_202B020 = 1;
gUnknown_202B024 = 20;
xxx_update_some_bg_tiles(0);
}
u32 xxx_update_some_bg_tiles(u32 a0)
{
u32 r5 = gUnknown_20274B0;
u32 *r4 = (u32 *)(VRAM + 0x4f40);
const u32 *r2;
gUnknown_20274B0 = a0;
if (a0 == 0 || a0 == 2)
{
sub_800CDA8(2);
r2 = gUnknown_80B87C4;
}
else
{
sub_800CDA8(1);
r2 = gUnknown_80B87E4;
}
gUnknown_202B030 = 0x88888888;
*r4++ = *r2++;
*r4++ = *r2++;
*r4++ = *r2++;
*r4++ = *r2++;
*r4++ = *r2++;
*r4++ = *r2++;
*r4++ = *r2++;
*r4++ = *r2++;
return r5;
}
u32 sub_80063B0(void)
{
return gUnknown_20274B0;
}
u8 sub_80063BC(u8 a0)
{
u8 retval = gUnknown_202B034;
gUnknown_202B034 = a0;
return retval;
}
void sub_80063CC(u32 a0)
{
gUnknown_20274AC = a0;
}
void sub_80063D8(int a0)
{
u32 retval;
if (a0 == 0)
{
gUnknown_20274B0;
retval = 0x88888888;
}
else
{
retval = (a0 & 0xf) | ((a0 & 0xf) << 4);
retval |= ((a0 & 0xf) << 8);
retval |= ((a0 & 0xf) << 12);
retval |= ((a0 & 0xf) << 16);
retval |= ((a0 & 0xf) << 20);
retval |= ((a0 & 0xf) << 24);
retval |= ((a0 & 0xf) << 28);
}
gUnknown_202B030 = retval;
}
void sub_800641C(void *a0, u8 a1, u8 a2)
{
u32 r3 = 0;
sub_8006438(a0, a1, a2, &r3);
}
void sub_8006438(const struct UnkTextStruct2 *a0, u8 a1, u8 a2, u32 *a3)
{
int i;
u32 r9 = 2;
if (a0 == NULL)
a0 = gUnknown_80B857C;
if (a2)
sub_8009388();
sub_800898C();
for (i = 0; i < 4; i++)
{
gUnknown_202AFC0[i] = a0[i];
if (a0[i].unk0c)
{
sub_8006554(gUnknown_2027370, (void *)VRAM, gUnknown_20274B4, gUnknown_202B038, gUnknown_80B8804[i], a0 + i, a1, r9, a3, 0);
sub_80089AC(a0 + i, a3);
r9 += a0[i].unk0c * a0[i].unk10;
}
}
#ifdef NONMATCHING
gUnknown_203B078 = gUnknown_3000E94;
gUnknown_20274A5 = 1;
#else
asm_unified("\tldr r2, =gUnknown_203B078\n"
"\tldr r0, =gUnknown_3000E94\n"
"\tldr r1, =gUnknown_20274A5\n"
"\tstr r0, [r2]\n"
"\tmovs r0, 0x1\n"
"\tstrb r0, [r1]");
#endif
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +1,77 @@
SoundMainRAM_Buffer: @ 3000000
.space 0x400
SoundMainRAM_Buffer = .; /* 3000000 */
. += 0x400;
gUnknown_3000400: @ 3000400
.space 0x800
gUnknown_3000400 = .; /* 3000400 */
. += 0x800;
gUnknown_3000C00: @ 3000C00
.space 0x294
gUnknown_3000C00 = .; /* 3000C00 */
. += 0x294;
gUnknown_3000E94: @ 3000E94
.space 0x144
gUnknown_3000E94 = .; /* 3000E94 */
. += 0x144;
gUnknown_3000FD8: @ 3000FD8
.space 0x10
gUnknown_3000FD8 = .; /* 3000FD8 */
. += 0x10;
gUnknown_3000FE8: @ 3000FE8
.space 0x30
gUnknown_3000FE8 = .; /* 3000FE8 */
. += 0x30;
gUnknown_3001018: @ 3001018
.space 0x180
gUnknown_3001018 = .; /* 3001018 */
. += 0x180;
gUnknown_3001198: @ 3001198
.space 0x9C0
gUnknown_3001198 = .; /* 3001198 */
. += 0x9C0;
alt_3001B58:
alt_3001B58 = .;
unk_code_ram: @ 3001B58
unk_code_ram = .; /* 3001B58 */
gUnknown_3001B58: @ 3001B58
.space 0x2
gUnknown_3001B58 = .; /* 3001B58 */
. += 0x2;
gUnknown_3001B5A: @ 3001B5A
.space 0x2
gUnknown_3001B5A = .; /* 3001B5A */
. += 0x2;
gUnknown_3001B5C: @ 3001B5C
.space 0x4
gUnknown_3001B5C = .; /* 3001B5C */
. += 0x4;
gUnknown_3001B60: @ 3001B60
.space 0x4
gUnknown_3001B60 = .; /* 3001B60 */
. += 0x4;
gUnknown_3001B64: @ 3001B64
.space 0x4
gUnknown_3001B64 = .; /* 3001B64 */
. += 0x4;
gUnknown_3001B68: @ 3001B68
.space 0x4
gUnknown_3001B68 = .; /* 3001B68 */
. += 0x4;
gUnknown_3001B6C: @ 3001B6C
.space 0x4
gUnknown_3001B6C = .; /* 3001B6C */
. += 0x4;
gUnknown_3001B70: @ 3001B70
.space 0x4
gUnknown_3001B70 = .; /* 3001B70 */
. += 0x4;
gUnknown_3001B74: @ 3001B74
.space 0x4
gUnknown_3001B74 = .; /* 3001B74 */
. += 0x4;
gUnknown_3001B78: @ 3001B78
.space 0x4
gUnknown_3001B78 = .; /* 3001B78 */
. += 0x4;
gUnknown_3001B7C: @ 3001B7C
.space 0x4
gUnknown_3001B7C = .; /* 3001B7C */
. += 0x4;
gUnknown_3001B80: @ 3001B80
.space 0x4
gUnknown_3001B80 = .; /* 3001B80 */
. += 0x4;
gUnknown_3001B84: @ 3001B84
.space 0x4
gUnknown_3001B84 = .; /* 3001B84 */
. += 0x4;
gUnknown_3001B88: @ 3001B88
.space 0x4
gUnknown_3001B88 = .; /* 3001B88 */
. += 0x4;
gUnknown_3001B8C: @ 3001B8C
.space 0x4
gUnknown_3001B8C = .; /* 3001B8C */
. += 0x4;
gUnknown_3001B90: @ 3001B90
.space 0x2470
gUnknown_3001B90 = .; /* 3001B90 */
. += 0x2470;
gUnknown_3004000: @ 3004000
gUnknown_3004000 = .; /* 3004000 */