Merge pull request #27 from PikalaxALT/pikalax_work

Separate build structures for ARM9 and ARM7
This commit is contained in:
Martmists
2020-04-26 17:49:13 +02:00
committed by GitHub
53 changed files with 8578 additions and 82 deletions
+2
View File
@@ -6,6 +6,8 @@ tools/mwccarm/**
# Build folder
build/**
arm7/build/**
arm9/build/**
# CLion folders
.idea/
+18 -3
View File
@@ -54,6 +54,9 @@ S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
$(foreach file,$(S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \
ARM9BIN := arm9/build/arm9.bin
ARM7BIN := arm7/build/arm7.bin
##################### Compiler Options #######################
MWCCVERSION := 2.0/base
@@ -107,7 +110,7 @@ else
NODEP := 1
endif
.PHONY: all clean mostlyclean tidy tools $(TOOLDIRS) patch_mwasmarm
.PHONY: all clean mostlyclean tidy tools $(TOOLDIRS) patch_mwasmarm $(ARM9BIN) $(ARM7BIN)
MAKEFLAGS += --no-print-directory
@@ -115,12 +118,18 @@ all: $(ROM)
@$(SHA1SUM) -c $(TARGET).sha1
clean: mostlyclean
make -C arm9 clean
make -C arm7 clean
make -C tools/mwasmarm_patcher clean
mostlyclean: tidy
make -C arm9 mostlyclean
make -C arm7 mostlyclean
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' \) -exec $(RM) {} +
tidy:
make -C arm9 tidy
make -C arm7 tidy
$(RM) -r $(BUILD_DIR)
tools: $(TOOLDIRS)
@@ -133,6 +142,12 @@ $(MWASMARM): patch_mwasmarm
patch_mwasmarm:
$(MWASMARM_PATCHER) $(MWASMARM)
$(ARM9BIN):
@$(MAKE) -C arm9
$(ARM7BIN):
@$(MAKE) -C arm7
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS))
$(BUILD_DIR)/%.o: %.c
@@ -144,8 +159,8 @@ $(BUILD_DIR)/%.o: %.s
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) undefined_syms.txt
$(CPP) $(VERSION_CFLAGS) -MMD -MP -MT $@ -MF $@.d -I include/ -I . -DBUILD_DIR=$(BUILD_DIR) -o $@ $<
$(ELF): $(O_FILES) $(BUILD_DIR)/$(LD_SCRIPT)
$(LD) $(LDFLAGS) $(BUILD_DIR)/$(LD_SCRIPT) -o $(ELF) $(O_FILES)
$(ELF): $(O_FILES) $(BUILD_DIR)/$(LD_SCRIPT) $(ARM9BIN) $(ARM7BIN)
$(LD) $(LDFLAGS) $(BUILD_DIR)/$(LD_SCRIPT) -o $(ELF) $(O_FILES) $(ARM9BIN) $(ARM7BIN)
$(ROM): $(ELF)
$(OBJCOPY) -O binary --gap-fill=0xFF --pad-to=0x04000000 $< $@
+175
View File
@@ -0,0 +1,175 @@
# Makefile to build Pokemon Diamond image
.PHONY: clean tidy all default patch_mwasmarm
# Try to include devkitarm if installed
TOOLCHAIN := $(DEVKITARM)
ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools
endif
### Default target ###
default: all
# If you are using WSL, it is recommended you build with NOWINE=1.
WSLENV ?= no
ifeq ($(WSLENV),)
NOWINE = 1
else
NOWINE = 0
endif
ifeq ($(OS),Windows_NT)
EXE := .exe
WINE :=
else
EXE :=
WINE := wine
endif
ifeq ($(NOWINE),1)
WINE :=
endif
################ Target Executable and Sources ###############
BUILD_DIR := build
TARGET := arm7
ROM := $(BUILD_DIR)/$(TARGET).bin
ELF := $(BUILD_DIR)/$(TARGET).elf
LD_SCRIPT := arm7.lcf
# Directories containing source files
SRC_DIRS := src
ASM_DIRS := asm data files
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
# Object files
O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
$(foreach file,$(S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \
##################### Compiler Options #######################
MWCCVERSION := 2.0/base
TOOLS_DIR = ../tools
CROSS := arm-none-eabi-
MWCCARM := $(TOOLS_DIR)/mwccarm/$(MWCCVERSION)/mwccarm.exe
# Argh... due to EABI version shenanigans, we can't use GNU LD to link together
# MWCC built objects and GNU built ones. mwldarm, however, doesn't care, so we
# have to use mwldarm for now.
# TODO: Is there a hack workaround to let us go back to GNU LD? Ideally, the
# only dependency should be MWCCARM.
MWLDARM := $(TOOLS_DIR)/mwccarm/$(MWCCVERSION)/mwldarm.exe
MWASMARM := $(TOOLS_DIR)/mwccarm/$(MWCCVERSION)/mwasmarm.exe
AS := $(WINE) $(MWASMARM)
CC := $(WINE) $(MWCCARM)
CPP := cpp -P
LD := $(WINE) $(MWLDARM)
AR := $(CROSS)ar
OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm7_thumb.s -o arm7.o
ASFLAGS = -proc arm5te -i ..
CFLAGS = -O4,p -proc v5te -thumb -fp soft -lang c99 -Cpp_exceptions off -ir ../include
LDFLAGS = -map -nodead -w off -proc v5te -interworking -map -symtab -m _start
####################### Other Tools #########################
# DS TOOLS
SHA1SUM = sha1sum
JSONPROC = $(TOOLS_DIR)/jsonproc/jsonproc
GFX = $(TOOLS_DIR)/nitrogfx/nitrogfx
MWASMARM_PATCHER = $(TOOLS_DIR)/mwasmarm_patcher/mwasmarm_patcher$(EXE)
TOOLDIRS = $(filter-out $(TOOLS_DIR)/mwccarm,$(wildcard $(TOOLS_DIR)/*))
TOOLBASE = $(TOOLDIRS:$(TOOLS_DIR)/%=%)
TOOLS = $(foreach tool,$(TOOLBASE),$(TOOLS_DIR)/$(tool)/$(tool)$(EXE))
######################### Targets ###########################
infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))
# Build tools when building the rom
# Disable dependency scanning for clean/tidy/tools
ifeq (,$(filter-out all,$(MAKECMDGOALS)))
$(call infoshell, $(MAKE) tools patch_mwasmarm)
else
NODEP := 1
endif
.PHONY: all clean mostlyclean tidy tools $(TOOLDIRS) patch_mwasmarm
MAKEFLAGS += --no-print-directory
all: $(ROM)
# @$(SHA1SUM) -c $(TARGET).sha1
clean: mostlyclean
make -C $(TOOLS_DIR)/mwasmarm_patcher clean
mostlyclean: tidy
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' \) -exec $(RM) {} +
tidy:
$(RM) -r $(BUILD_DIR)
tools: $(TOOLDIRS)
$(TOOLDIRS):
@$(MAKE) -C $@
$(MWASMARM): patch_mwasmarm
patch_mwasmarm:
$(MWASMARM_PATCHER) $(MWASMARM)
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS))
$(BUILD_DIR)/%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
$(BUILD_DIR)/%.o: %.s
$(AS) $(ASFLAGS) $< -o $@
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) undefined_syms.txt
$(CPP) $(VERSION_CFLAGS) -MMD -MP -MT $@ -MF $@.d -I include/ -I . -DBUILD_DIR=$(BUILD_DIR) -o $@ $<
$(ELF): $(O_FILES) $(BUILD_DIR)/$(LD_SCRIPT)
$(LD) $(LDFLAGS) $(BUILD_DIR)/$(LD_SCRIPT) -o $(ELF) $(O_FILES)
$(ROM): $(ELF)
$(OBJCOPY) -O binary --gap-fill=0xFF $< $@
# Make sure build directory exists before compiling anything
DUMMY != mkdir -p $(ALL_DIRS)
%.4bpp: %.png
$(GFX) $< $@
%.gbapal: %.png
$(GFX) $< $@
%.gbapal: %.pal
$(GFX) $< $@
%.lz: %
$(GFX) $< $@
%.png: ;
%.pal: ;
$(BUILD_DIR)/data/icon.o: graphics/icon.4bpp graphics/icon.gbapal
### Debug Print ###
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
+10
View File
@@ -0,0 +1,10 @@
MEMORY {
.text (RX) : ORIGIN=0x02380000, LENGTH=0
}
SECTIONS {
#include "undefined_syms.txt"
.text : AT (0x0) {
arm7_rom.o (.text)
} > .text
}
+3 -3
View File
@@ -3,9 +3,9 @@
.global ARM7AutoLoad
.section .text
arm_func_start Entry_ARM7
arm_func_start _start
Entry_ARM7:
_start:
mov ip, #67108864 ; 0x4000000
str ip, [ip, #520] ; 0x208
ldr r1, _23800cc
@@ -74,7 +74,7 @@ _23800f0: .word 0x0380fffc
_23800f4: .word 0x037f853c
_23800f8: .word 0x037f8468
_23800fc: .word 0xffff0000
arm_func_end Entry_ARM7
arm_func_end _start
arm_func_start FUN_2380100
FUN_2380100:
+1
View File
@@ -0,0 +1 @@
.include "asm/macros/function.inc"
+24
View File
@@ -0,0 +1,24 @@
.macro arm_func_start name
.balign 4, 0
.global \name
.arm
.endm
.macro arm_func_end name
.size \name, .-\name
.endm
.macro thumb_func_start name
.balign 4, 0
.global \name
.thumb
.endm
.macro non_word_aligned_thumb_func_start name
.global \name
.thumb
.endm
.macro thumb_func_end name
.size \name, .-\name
.endm
+3517
View File
File diff suppressed because it is too large Load Diff
+506
View File
@@ -0,0 +1,506 @@
SDK_SYS_STACKSIZE = 0x00000000;
CONST_34 = 0x00000034;
CONST_3F = 0x0000003F;
SDK_IRQ_STACKSIZE = 0x00000400;
// .data
// OS
OSi_IrqCallbackInfoIndex = 0x02106818;
// DGT
Unk_0210683C = 0x0210683C;
Unk_02106840 = 0x02106840;
Unk_02106900 = 0x02106900;
Unk_02106A00 = 0x02106A00;
Unk_02106A04 = 0x02106A04;
// .bss
gBacklightTop = 0x02106FA0;
gBacklightTop_2 = 0x02106FA0;
gUnknown2106FB8 = 0x02106FB8;
gUnknown21C48B8 = 0x021C48B8;
gUnk021C4918 = 0x021C4918;
OSi_IrqCallbackInfo = 0x021D341C;
isInitialized = 0x021D347C;
OSi_StackForDestructor = 0x021D3480;
OSi_RescheduleCount = 0x021D3484;
OSi_ThreadIdCount = 0x021D3488;
OSi_SystemCallbackInSwitchThread = 0x021D348C;
OSi_CurrentThreadPtr = 0x021D3490;
OSi_IsThreadInitialized = 0x021D3494;
OSi_ThreadInfo = 0x021D3498;
OSi_IdleThread = 0x021D34A8;
OSi_LauncherThread = 0x021D3568;
OSi_IdleThreadStack = 0x021D3628;
OSi_Initialized = 0x021D36F0;
OSi_MainExArenaEnabled = 0x021D36F4;
OSi_HeapInfo = 0x021D36F8;
OSi_UserExceptionHandler = 0x021D371C;
OSi_UserExceptionHandlerArg = 0x21D3720;
OSi_DebuggerHandler = 0x021D3724;
OSi_ExContext = 0x021D3728;
OSi_TimerReserved = 0x021D37A8;
OSi_UseTick = 0x021D37AC;
OSi_NeedResetTimer = 0x021D37B0;
OSi_TickCounter = 0x021D37B4;
OSi_UseAlarm = 0x021D37BC;
OSi_AlarmQueue = 0x021D37C0;
OSi_UseVAlarm = 0x021D37C8;
OSi_PreviousVCount = 0x021D37CC;
OSi_VFrameCount = 0x021D37D0;
OSi_VAlarmQueue = 0x021D37D4;
OSi_IsInitReset = 0x021D37DC;
OSi_IsResetOccurred = 0x021D37E0;
OSi_vramExclusive = 0x021D37E4;
OSi_vramLockId = 0x021D37E8;
cardi_common = 0x021D55C0;
// Overlay
FUN_021D74E0 = 0x021D74E0;
FUN_021D76AC = 0x021D76AC;
gUnk021D76C8 = 0x021D76C8;
FUN_021D77C4 = 0x021D77C4;
FUN_021D7800 = 0x021D7800;
FUN_021D78FC = 0x021D78FC;
FUN_021D79B4 = 0x021D79B4;
FUN_021D7CA4 = 0x021D7CA4;
FUN_021D7F8C = 0x021D7F8C;
FUN_021D8018 = 0x021D8018;
FUN_021D8164 = 0x021D8164;
FUN_021D82BC = 0x021D82BC;
FUN_021D8320 = 0x021D8320;
FUN_021D836C = 0x021D836C;
FUN_021D83A8 = 0x021D83A8;
FUN_021D83C0 = 0x021D83C0;
FUN_021D844C = 0x021D844C;
FUN_021D8494 = 0x021D8494;
FUN_021D85FC = 0x021D85FC;
FUN_021D8624 = 0x021D8624;
FUN_021D865C = 0x021D865C;
FUN_021D8758 = 0x021D8758;
FUN_021D8820 = 0x021D8820;
FUN_021D88E4 = 0x021D88E4;
FUN_021D89CC = 0x021D89CC;
FUN_021D8B64 = 0x021D8B64;
FUN_021D8C24 = 0x021D8C24;
FUN_021D917C = 0x021D917C;
FUN_021D959C = 0x021D959C;
FUN_021D967C = 0x021D967C;
FUN_021D96F4 = 0x021D96F4;
FUN_021D9708 = 0x021D9708;
FUN_021D971C = 0x021D971C;
FUN_021D9820 = 0x021D9820;
FUN_021D99F8 = 0x021D99F8;
FUN_021DA464 = 0x021DA464;
FUN_021DA4EC = 0x021DA4EC;
FUN_021DA54C = 0x021DA54C;
FUN_021DA58C = 0x021DA58C;
FUN_021DA5B8 = 0x021DA5B8;
FUN_021DA5C8 = 0x021DA5C8;
FUN_021DA5D0 = 0x021DA5D0;
FUN_021DA5D8 = 0x021DA5D8;
FUN_021DA7B4 = 0x021DA7B4;
FUN_021DAAA4 = 0x021DAAA4;
FUN_021DAC70 = 0x021DAC70;
FUN_021DAE40 = 0x021DAE40;
FUN_021DAED4 = 0x021DAED4;
FUN_021DAF28 = 0x021DAF28;
FUN_021DAF78 = 0x021DAF78;
FUN_021DAF98 = 0x021DAF98;
FUN_021DB030 = 0x021DB030;
FUN_021DB7E8 = 0x021DB7E8;
FUN_021DB858 = 0x021DB858;
gUnk021DBE18 = 0x021DBE18;
FUN_021DC174 = 0x021DC174;
FUN_021DD6F0 = 0x021DD6F0;
FUN_021DD718 = 0x021DD718;
FUN_021DDB08 = 0x021DDB08;
FUN_021E1374 = 0x021E1374;
FUN_021E1858 = 0x021E1858;
FUN_021E1994 = 0x021E1994;
FUN_021E1BF8 = 0x021E1BF8;
FUN_021E1C4C = 0x021E1C4C;
FUN_021E1C54 = 0x021E1C54;
FUN_021E1ECC = 0x021E1ECC;
FUN_021E1F34 = 0x021E1F34;
FUN_021E1F58 = 0x021E1F58;
FUN_021E1F60 = 0x021E1F60;
FUN_021E2464 = 0x021E2464;
FUN_021E2608 = 0x021E2608;
FUN_021E26CC = 0x021E26CC;
FUN_021E27E8 = 0x021E27E8;
FUN_021E288C = 0x021E288C;
FUN_021E28A0 = 0x021E28A0;
FUN_021E2950 = 0x021E2950;
FUN_021E29B4 = 0x021E29B4;
FUN_021E29C8 = 0x021E29C8;
FUN_021E2A70 = 0x021E2A70;
FUN_021E2AD4 = 0x021E2AD4;
FUN_021E2B80 = 0x021E2B80;
FUN_021E2B9C = 0x021E2B9C;
FUN_021E2BB8 = 0x021E2BB8;
FUN_021E2BD0 = 0x021E2BD0;
FUN_021E2C24 = 0x021E2C24;
FUN_021E2C58 = 0x021E2C58;
FUN_021E2CBC = 0x021E2CBC;
FUN_021E32F0 = 0x021E32F0;
FUN_021E331C = 0x021E331C;
FUN_021E3424 = 0x021E3424;
FUN_021E3444 = 0x021E3444;
FUN_021E495C = 0x021E495C;
FUN_021E4C54 = 0x021E4C54;
FUN_021E4C60 = 0x021E4C60;
FUN_021E4DE4 = 0x021E4DE4;
FUN_021E5614 = 0x021E5614;
FUN_021E57D4 = 0x021E57D4;
FUN_021E5970 = 0x021E5970;
FUN_021E5B30 = 0x021E5B30;
FUN_021E5FD8 = 0x021E5FD8;
FUN_021E5FE0 = 0x021E5FE0;
FUN_021E6410 = 0x021E6410;
FUN_021E643C = 0x021E643C;
FUN_021E6990 = 0x021E6990;
FUN_021E69BC = 0x021E69BC;
FUN_021E6BF4 = 0x021E6BF4;
FUN_021E7030 = 0x021E7030;
FUN_021E70F0 = 0x021E70F0;
FUN_021E7138 = 0x021E7138;
FUN_021E7184 = 0x021E7184;
FUN_021E71E8 = 0x021E71E8;
FUN_021E7750 = 0x021E7750;
FUN_021E799C = 0x021E799C;
FUN_021E7AC0 = 0x021E7AC0;
FUN_021E7EA0 = 0x021E7EA0;
FUN_021E7EB0 = 0x021E7EB0;
FUN_021E7EC4 = 0x021E7EC4;
FUN_021E7EC8 = 0x021E7EC8;
FUN_021E7ED0 = 0x021E7ED0;
FUN_021E7ED8 = 0x021E7ED8;
FUN_021E7FBC = 0x021E7FBC;
FUN_021E8128 = 0x021E8128;
FUN_021E8130 = 0x021E8130;
FUN_021E8140 = 0x021E8140;
FUN_021E8144 = 0x021E8144;
FUN_021E8148 = 0x021E8148;
FUN_021E8158 = 0x021E8158;
FUN_021E81BC = 0x021E81BC;
FUN_021E84F4 = 0x021E84F4;
FUN_021E856C = 0x021E856C;
FUN_021E8588 = 0x021E8588;
FUN_021E85E4 = 0x021E85E4;
FUN_021E85FC = 0x021E85FC;
FUN_021EAE90 = 0x021EAE90;
FUN_021EB044 = 0x021EB044;
FUN_021EC57C = 0x021EC57C;
FUN_021EC71C = 0x021EC71C;
FUN_021EC854 = 0x021EC854;
FUN_021EC864 = 0x021EC864;
FUN_021ECD64 = 0x021ECD64;
FUN_021ECF14 = 0x021ECF14;
FUN_021ED0CC = 0x021ED0CC;
FUN_021ED49C = 0x021ED49C;
FUN_021ED4E0 = 0x021ED4E0;
FUN_021ED52C = 0x021ED52C;
FUN_021ED5C4 = 0x021ED5C4;
FUN_021ED5EC = 0x021ED5EC;
FUN_021ED644 = 0x021ED644;
FUN_021ED940 = 0x021ED940;
FUN_021EDA48 = 0x021EDA48;
FUN_021EDBC8 = 0x021EDBC8;
FUN_021EF5E0 = 0x021EF5E0;
FUN_021EF604 = 0x021EF604;
FUN_021EF620 = 0x021EF620;
FUN_021EF654 = 0x021EF654;
FUN_021EF824 = 0x021EF824;
FUN_021EF844 = 0x021EF844;
FUN_021EF8C8 = 0x021EF8C8;
FUN_021EF8DC = 0x021EF8DC;
FUN_021EFA9C = 0x021EFA9C;
FUN_021F02C4 = 0x021F02C4;
FUN_021F1D8C = 0x021F1D8C;
FUN_021F1DC8 = 0x021F1DC8;
FUN_021F1DFC = 0x021F1DFC;
FUN_021F1EC0 = 0x021F1EC0;
FUN_021F1F78 = 0x021F1F78;
FUN_021F2094 = 0x021F2094;
FUN_021F20D8 = 0x021F20D8;
FUN_021F20F8 = 0x021F20F8;
FUN_021F2AF4 = 0x021F2AF4;
FUN_021F2E0C = 0x021F2E0C;
FUN_021F2E28 = 0x021F2E28;
FUN_021F2F48 = 0x021F2F48;
FUN_021F2F6C = 0x021F2F6C;
FUN_021F3A18 = 0x021F3A18;
FUN_021F3AB4 = 0x021F3AB4;
FUN_021F3B4C = 0x021F3B4C;
FUN_021F3B7C = 0x021F3B7C;
FUN_021F3DA4 = 0x021F3DA4;
FUN_021F44D8 = 0x021F44D8;
FUN_021F4520 = 0x021F4520;
FUN_021F4568 = 0x021F4568;
FUN_021F4594 = 0x021F4594;
FUN_021F45E8 = 0x021F45E8;
FUN_021F4608 = 0x021F4608;
FUN_021F4BD0 = 0x021F4BD0;
FUN_021F4C88 = 0x021F4C88;
FUN_021F4D80 = 0x021F4D80;
FUN_021F4DC8 = 0x021F4DC8;
FUN_021F4E7C = 0x021F4E7C;
FUN_021F57EC = 0x021F57EC;
FUN_021F5C44 = 0x021F5C44;
FUN_021F61DC = 0x021F61DC;
FUN_021F61E8 = 0x021F61E8;
FUN_02211E60 = 0x02211E60;
FUN_0222D5C0 = 0x0222D5C0;
FUN_0222DAEC = 0x0222DAEC;
FUN_0222DD1C = 0x0222DD1C;
FUN_0222DD38 = 0x0222DD38;
FUN_0222E2BC = 0x0222E2BC;
FUN_0222E360 = 0x0222E360;
FUN_0222E3A0 = 0x0222E3A0;
FUN_0222E7E8 = 0x0222E7E8;
FUN_0222E874 = 0x0222E874;
FUN_0222ED34 = 0x0222ED34;
FUN_0222EDBC = 0x0222EDBC;
FUN_0222F440 = 0x0222F440;
FUN_0222F480 = 0x0222F480;
FUN_0222F7E0 = 0x0222F7E0;
FUN_0222F990 = 0x0222F990;
FUN_022300D4 = 0x022300D4;
FUN_022300DC = 0x022300DC;
FUN_022300E4 = 0x022300E4;
FUN_022300E8 = 0x022300E8;
FUN_022300F4 = 0x022300F4;
FUN_02230100 = 0x02230100;
FUN_0223010C = 0x0223010C;
FUN_02230118 = 0x02230118;
FUN_02230124 = 0x02230124;
FUN_02230F3C = 0x02230F3C;
FUN_02230F70 = 0x02230F70;
FUN_02230F80 = 0x02230F80;
FUN_02231344 = 0x02231344;
FUN_02231350 = 0x02231350;
FUN_0223135C = 0x0223135C;
FUN_02231368 = 0x02231368;
FUN_02231374 = 0x02231374;
FUN_02239944 = 0x02239944;
FUN_02239AAC = 0x02239AAC;
FUN_0223CACC = 0x0223CACC;
FUN_0223CB08 = 0x0223CB08;
FUN_0223CCDC = 0x0223CCDC;
FUN_0223CD7C = 0x0223CD7C;
FUN_0223D3D0 = 0x0223D3D0;
FUN_0223D638 = 0x0223D638;
FUN_0223D648 = 0x0223D648;
FUN_0223DFB4 = 0x0223DFB4;
FUN_0223E060 = 0x0223E060;
FUN_0223E118 = 0x0223E118;
FUN_0223E154 = 0x0223E154;
FUN_0223E1A4 = 0x0223E1A4;
FUN_0223E1E0 = 0x0223E1E0;
FUN_0223E2AC = 0x0223E2AC;
FUN_0223E4A8 = 0x0223E4A8;
FUN_0223E4D4 = 0x0223E4D4;
FUN_0223E554 = 0x0223E554;
FUN_0223E6B8 = 0x0223E6B8;
FUN_0223E734 = 0x0223E734;
FUN_0223E7FC = 0x0223E7FC;
FUN_0223EB8C = 0x0223EB8C;
FUN_0223EF7C = 0x0223EF7C;
FUN_0223F4D8 = 0x0223F4D8;
FUN_0223F4F4 = 0x0223F4F4;
FUN_0223F8D8 = 0x0223F8D8;
FUN_0223FCE8 = 0x0223FCE8;
FUN_02240790 = 0x02240790;
FUN_022407CC = 0x022407CC;
FUN_022407DC = 0x022407DC;
FUN_022407F8 = 0x022407F8;
FUN_02240834 = 0x02240834;
FUN_02240844 = 0x02240844;
FUN_0224089C = 0x0224089C;
FUN_022408FC = 0x022408FC;
FUN_022411F4 = 0x022411F4;
FUN_02241230 = 0x02241230;
FUN_02241914 = 0x02241914;
FUN_02242A38 = 0x02242A38;
FUN_02242BE0 = 0x02242BE0;
FUN_0224312C = 0x0224312C;
FUN_022432E4 = 0x022432E4;
FUN_0224339C = 0x0224339C;
FUN_022433A8 = 0x022433A8;
FUN_022433B0 = 0x022433B0;
FUN_022433B8 = 0x022433B8;
FUN_022433F8 = 0x022433F8;
FUN_02243408 = 0x02243408;
FUN_02243428 = 0x02243428;
FUN_02243448 = 0x02243448;
FUN_0224345C = 0x0224345C;
FUN_022434AC = 0x022434AC;
FUN_022434BC = 0x022434BC;
FUN_022434D0 = 0x022434D0;
FUN_02243694 = 0x02243694;
FUN_022436C8 = 0x022436C8;
FUN_022436E8 = 0x022436E8;
FUN_02243780 = 0x02243780;
FUN_02243838 = 0x02243838;
FUN_022438DC = 0x022438DC;
FUN_022438E0 = 0x022438E0;
FUN_022438FC = 0x022438FC;
FUN_02243920 = 0x02243920;
FUN_022439F8 = 0x022439F8;
FUN_02243AD8 = 0x02243AD8;
FUN_02243BA8 = 0x02243BA8;
FUN_02243C5C = 0x02243C5C;
FUN_02243D3C = 0x02243D3C;
FUN_02243DA0 = 0x02243DA0;
FUN_02243DB8 = 0x02243DB8;
FUN_02243DC0 = 0x02243DC0;
FUN_02243DC4 = 0x02243DC4;
FUN_02243DD8 = 0x02243DD8;
FUN_02243DE0 = 0x02243DE0;
FUN_02243E34 = 0x02243E34;
FUN_02243E74 = 0x02243E74;
FUN_02243F18 = 0x02243F18;
FUN_02243F50 = 0x02243F50;
FUN_02243F9C = 0x02243F9C;
FUN_02244210 = 0x02244210;
FUN_02244558 = 0x02244558;
FUN_02244660 = 0x02244660;
FUN_022446BC = 0x022446BC;
FUN_022446E0 = 0x022446E0;
FUN_022446FC = 0x022446FC;
FUN_02244758 = 0x02244758;
FUN_02244770 = 0x02244770;
FUN_02244824 = 0x02244824;
FUN_0224484C = 0x0224484C;
FUN_02244D1C = 0x02244D1C;
FUN_02244D20 = 0x02244D20;
FUN_02244D3C = 0x02244D3C;
FUN_02244D40 = 0x02244D40;
FUN_02244D58 = 0x02244D58;
FUN_02244D98 = 0x02244D98;
FUN_02244DA0 = 0x02244DA0;
FUN_02244DB0 = 0x02244DB0;
FUN_02244DBC = 0x02244DBC;
FUN_02244DC4 = 0x02244DC4;
FUN_02244EF8 = 0x02244EF8;
FUN_02244F18 = 0x02244F18;
FUN_02244F24 = 0x02244F24;
FUN_02244F2C = 0x02244F2C;
FUN_02245088 = 0x02245088;
FUN_02245114 = 0x02245114;
FUN_02245190 = 0x02245190;
FUN_02245198 = 0x02245198;
FUN_022451F0 = 0x022451F0;
FUN_0224525C = 0x0224525C;
FUN_022452A4 = 0x022452A4;
FUN_02245324 = 0x02245324;
FUN_02245340 = 0x02245340;
FUN_02245358 = 0x02245358;
FUN_0224566C = 0x0224566C;
FUN_022456E8 = 0x022456E8;
FUN_02245844 = 0x02245844;
FUN_02245910 = 0x02245910;
FUN_02245F1C = 0x02245F1C;
FUN_02245F4C = 0x02245F4C;
FUN_02245FA0 = 0x02245FA0;
FUN_022461A4 = 0x022461A4;
FUN_022461B8 = 0x022461B8;
FUN_0224666C = 0x0224666C;
FUN_022466A0 = 0x022466A0;
FUN_022466AC = 0x022466AC;
FUN_02246F1C = 0x02246F1C;
FUN_02247294 = 0x02247294;
FUN_022472AC = 0x022472AC;
FUN_02247544 = 0x02247544;
FUN_02247614 = 0x02247614;
FUN_02247728 = 0x02247728;
FUN_02247808 = 0x02247808;
FUN_02247970 = 0x02247970;
FUN_02247A34 = 0x02247A34;
FUN_022483BC = 0x022483BC;
FUN_022483E0 = 0x022483E0;
FUN_022483EC = 0x022483EC;
FUN_02248724 = 0x02248724;
FUN_0224884C = 0x0224884C;
FUN_022488CC = 0x022488CC;
FUN_022488EC = 0x022488EC;
FUN_022488F4 = 0x022488F4;
FUN_022488FC = 0x022488FC;
FUN_0224891C = 0x0224891C;
FUN_02248B54 = 0x02248B54;
FUN_02248B58 = 0x02248B58;
FUN_02248B5C = 0x02248B5C;
FUN_02248B60 = 0x02248B60;
FUN_02248B6C = 0x02248B6C;
FUN_02248CC0 = 0x02248CC0;
FUN_02248CD0 = 0x02248CD0;
FUN_02248DF8 = 0x02248DF8;
FUN_02248F70 = 0x02248F70;
FUN_02248FE0 = 0x02248FE0;
FUN_02249038 = 0x02249038;
FUN_022490A0 = 0x022490A0;
FUN_022491FC = 0x022491FC;
FUN_022494C8 = 0x022494C8;
FUN_02249508 = 0x02249508;
FUN_02249668 = 0x02249668;
FUN_022497E8 = 0x022497E8;
FUN_02249E6C = 0x02249E6C;
FUN_02249E78 = 0x02249E78;
FUN_02249E84 = 0x02249E84;
FUN_02249E90 = 0x02249E90;
FUN_0224A310 = 0x0224A310;
FUN_0224A528 = 0x0224A528;
FUN_0224A7C8 = 0x0224A7C8;
FUN_0224ABAC = 0x0224ABAC;
FUN_0224B124 = 0x0224B124;
FUN_0224B2C4 = 0x0224B2C4;
FUN_0224B568 = 0x0224B568;
FUN_0224B818 = 0x0224B818;
FUN_0224B86C = 0x0224B86C;
FUN_0224B9E0 = 0x0224B9E0;
FUN_0224BBEC = 0x0224BBEC;
FUN_0224BD90 = 0x0224BD90;
FUN_0224C038 = 0x0224C038;
FUN_0224C27C = 0x0224C27C;
FUN_0224C520 = 0x0224C520;
FUN_0224C678 = 0x0224C678;
FUN_0224C6E8 = 0x0224C6E8;
FUN_0224C6F4 = 0x0224C6F4;
FUN_0224C700 = 0x0224C700;
FUN_0224C8C8 = 0x0224C8C8;
FUN_0224CA2C = 0x0224CA2C;
FUN_0224CA54 = 0x0224CA54;
FUN_0224CA58 = 0x0224CA58;
FUN_0224CA88 = 0x0224CA88;
FUN_0224CA94 = 0x0224CA94;
FUN_0224CAA0 = 0x0224CAA0;
FUN_0224CAB4 = 0x0224CAB4;
FUN_0224CB30 = 0x0224CB30;
FUN_0224CBB0 = 0x0224CBB0;
FUN_0224CC24 = 0x0224CC24;
FUN_0224CECC = 0x0224CECC;
FUN_0224D14C = 0x0224D14C;
FUN_0224D2E0 = 0x0224D2E0;
FUN_0224D3E8 = 0x0224D3E8;
FUN_0224D70C = 0x0224D70C;
FUN_0224D76C = 0x0224D76C;
FUN_0224D79C = 0x0224D79C;
FUN_0224DCB8 = 0x0224DCB8;
FUN_0224DD94 = 0x0224DD94;
FUN_0224DDB8 = 0x0224DDB8;
FUN_0224E554 = 0x0224E554;
FUN_0224E764 = 0x0224E764;
FUN_0224E7C4 = 0x0224E7C4;
FUN_0224F12C = 0x0224F12C;
FUN_02252534 = 0x02252534;
FUN_02252538 = 0x02252538;
FUN_022567E0 = 0x022567E0;
// ???
SDK_MAIN_ARENA_LO = 0x0225FFA0;
// EWRAM
SDK_SECTION_ARENA_EX_START = 0x023E0000;
// DTCM
gUnk027FFC20 = 0x027FFC20;
+175
View File
@@ -0,0 +1,175 @@
# Makefile to build Pokemon Diamond image
.PHONY: clean tidy all default patch_mwasmarm
# Try to include devkitarm if installed
TOOLCHAIN := $(DEVKITARM)
ifneq (,$(wildcard $(TOOLCHAIN)/base_tools))
include $(TOOLCHAIN)/base_tools
endif
### Default target ###
default: all
# If you are using WSL, it is recommended you build with NOWINE=1.
WSLENV ?= no
ifeq ($(WSLENV),)
NOWINE = 1
else
NOWINE = 0
endif
ifeq ($(OS),Windows_NT)
EXE := .exe
WINE :=
else
EXE :=
WINE := wine
endif
ifeq ($(NOWINE),1)
WINE :=
endif
################ Target Executable and Sources ###############
BUILD_DIR := build
TARGET := arm9
ROM := $(BUILD_DIR)/$(TARGET).bin
ELF := $(BUILD_DIR)/$(TARGET).elf
LD_SCRIPT := arm9.lcf
# Directories containing source files
SRC_DIRS := src
ASM_DIRS := asm data files
C_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.c))
S_FILES := $(foreach dir,$(ASM_DIRS),$(wildcard $(dir)/*.s))
# Object files
O_FILES := $(foreach file,$(C_FILES),$(BUILD_DIR)/$(file:.c=.o)) \
$(foreach file,$(S_FILES),$(BUILD_DIR)/$(file:.s=.o)) \
##################### Compiler Options #######################
MWCCVERSION := 2.0/base
TOOLS_DIR = ../tools
CROSS := arm-none-eabi-
MWCCARM := $(TOOLS_DIR)/mwccarm/$(MWCCVERSION)/mwccarm.exe
# Argh... due to EABI version shenanigans, we can't use GNU LD to link together
# MWCC built objects and GNU built ones. mwldarm, however, doesn't care, so we
# have to use mwldarm for now.
# TODO: Is there a hack workaround to let us go back to GNU LD? Ideally, the
# only dependency should be MWCCARM.
MWLDARM := $(TOOLS_DIR)/mwccarm/$(MWCCVERSION)/mwldarm.exe
MWASMARM := $(TOOLS_DIR)/mwccarm/$(MWCCVERSION)/mwasmarm.exe
AS := $(WINE) $(MWASMARM)
CC := $(WINE) $(MWCCARM)
CPP := cpp -P
LD := $(WINE) $(MWLDARM)
AR := $(CROSS)ar
OBJDUMP := $(CROSS)objdump
OBJCOPY := $(CROSS)objcopy
# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
ASFLAGS = -proc arm5te -i ..
CFLAGS = -O4,p -proc v5te -thumb -fp soft -lang c99 -Cpp_exceptions off -ir ../include
LDFLAGS = -map -nodead -w off -proc v5te -interworking -map -symtab -m _start
####################### Other Tools #########################
# DS TOOLS
SHA1SUM = sha1sum
JSONPROC = $(TOOLS_DIR)/jsonproc/jsonproc
GFX = $(TOOLS_DIR)/nitrogfx/nitrogfx
MWASMARM_PATCHER = $(TOOLS_DIR)/mwasmarm_patcher/mwasmarm_patcher$(EXE)
TOOLDIRS = $(filter-out $(TOOLS_DIR)/mwccarm,$(wildcard $(TOOLS_DIR)/*))
TOOLBASE = $(TOOLDIRS:$(TOOLS_DIR)/%=%)
TOOLS = $(foreach tool,$(TOOLBASE),$(TOOLS_DIR)/$(tool)/$(tool)$(EXE))
######################### Targets ###########################
infoshell = $(foreach line, $(shell $1 | sed "s/ /__SPACE__/g"), $(info $(subst __SPACE__, ,$(line))))
# Build tools when building the rom
# Disable dependency scanning for clean/tidy/tools
ifeq (,$(filter-out all,$(MAKECMDGOALS)))
$(call infoshell, $(MAKE) tools patch_mwasmarm)
else
NODEP := 1
endif
.PHONY: all clean mostlyclean tidy tools $(TOOLDIRS) patch_mwasmarm
MAKEFLAGS += --no-print-directory
all: $(ROM)
# @$(SHA1SUM) -c $(TARGET).sha1
clean: mostlyclean
make -C $(TOOLS_DIR)/mwasmarm_patcher clean
mostlyclean: tidy
find . \( -iname '*.1bpp' -o -iname '*.4bpp' -o -iname '*.8bpp' -o -iname '*.gbapal' -o -iname '*.lz' \) -exec $(RM) {} +
tidy:
$(RM) -r $(BUILD_DIR)
tools: $(TOOLDIRS)
$(TOOLDIRS):
@$(MAKE) -C $@
$(MWASMARM): patch_mwasmarm
patch_mwasmarm:
$(MWASMARM_PATCHER) $(MWASMARM)
ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS))
$(BUILD_DIR)/%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
$(BUILD_DIR)/%.o: %.s
$(AS) $(ASFLAGS) $< -o $@
$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SCRIPT) undefined_syms.txt
$(CPP) $(VERSION_CFLAGS) -MMD -MP -MT $@ -MF $@.d -I include/ -I . -DBUILD_DIR=$(BUILD_DIR) -o $@ $<
$(ELF): $(O_FILES) $(BUILD_DIR)/$(LD_SCRIPT)
$(LD) $(LDFLAGS) $(BUILD_DIR)/$(LD_SCRIPT) -o $(ELF) $(O_FILES)
$(ROM): $(ELF)
$(OBJCOPY) -O binary --gap-fill=0xFF $< $@
# Make sure build directory exists before compiling anything
DUMMY != mkdir -p $(ALL_DIRS)
%.4bpp: %.png
$(GFX) $< $@
%.gbapal: %.png
$(GFX) $< $@
%.gbapal: %.pal
$(GFX) $< $@
%.lz: %
$(GFX) $< $@
%.png: ;
%.pal: ;
$(BUILD_DIR)/data/icon.o: graphics/icon.4bpp graphics/icon.gbapal
### Debug Print ###
print-% : ; $(info $* is a $(flavor $*) variable set to [$($*)]) @true
+84
View File
@@ -0,0 +1,84 @@
MEMORY {
.itcm (RWX) : ORIGIN=0x01FF8000, LENGTH=0
.text (RX) : ORIGIN=0x02000000, LENGTH=0
.data (R) : ORIGIN=0x20EC710, LENGTH=0
.autoload (R) : ORIGIN=0x02107700, LENGTH=0
.bss (RWX) : ORIGIN=0x02106FA0, LENGTH=0
.ewram (RWX) : ORIGIN=0x023E0000, LENGTH=0
.dtcm (RW) : ORIGIN=0x027E0000, LENGTH=0
.overlay (RX) : ORIGIN=0, LENGTH=0
}
SECTIONS {
#include "undefined_syms.txt"
.text : AT (0x0) {
secure.o (.text)
crt0.o (.text)
main.o (.text)
FUN_02000DF4.o (.text)
unk_02000E0C.o (.text)
string_util.o (.text)
unk_020023C0.o (.text)
filesystem.o (.text)
unk_02006864.o (.text)
script.o (.text)
unk_02038C78.o (.text)
scrcmd.o (.text)
unk_02046030.o (.text)
unk_0208AC14.o (.text)
unk_020AF030.o (.text)
/* SDK */
GX_arm9.o (.text)
OS_arm9.o (.text)
MI_arm9.o (.text)
SND_arm9.o (.text)
PXI_arm9.o (.text)
FS_arm9.o (.text)
DGT_arm9.o (.text)
CP_arm9.o (.text)
SPI_arm9.o (.text)
PM_arm9.o (.text)
RTC_arm9.o (.text)
CARD_arm9.o (.text)
WM_arm9.o (.text)
CTRDG_arm9.o (.text)
MATH_arm9.o (.text)
STD_arm9.o (.text)
} > .text
.data : AT (0xEC710) {
rom2.o (.data)
string_util.o (.data)
rom2_2.o (.data)
} > .data
SDK_AUTOLOAD_START = .;
SDK_STATIC_BSS_START = .;
SDK_STATIC_BSS_END = . + 0xd0540;
.itcm : AT (0x106FA0)
{
SDK_AUTOLOAD_ITCM_START = .;
arm9_itcm.o (.itcm)
SDK_AUTOLOAD_ITCM_END = .;
. = 0x01FF8720;
SDK_SECTION_ARENA_ITCM_START = .;
} > .itcm
.autoload : AT (0x107700) {
SDK_AUTOLOAD_LIST.o (.data)
unk_10b724.o (.text)
} > .autoload
.overlay : AT (0x107800) {
arm9overlay.o (.text)
} > .overlay
.dtcm : AT (0x1076A0) {
SDK_AUTOLOAD_DTCM_START = .;
OS_arm9.o (.dtcm)
SDK_AUTOLOAD_DTCM_END = .;
SDK_SECTION_ARENA_DTCM_START = 0x027E0080;
} > .dtcm
}
@@ -1,13 +1,14 @@
.include "asm/macros.inc"
.include "global.inc"
.section .data
.global SDK_AUTOLOAD_LIST
SDK_AUTOLOAD_LIST: ; 0x02107700
.word 0x01FF8000
.word SDK_AUTOLOAD_ITCM_START
.word 0x00000700
.word 0x00000000
.word 0x027e0000
.word SDK_AUTOLOAD_DTCM_START
.word 0x00000060
.word 0x00000020
View File
+1
View File
@@ -0,0 +1 @@
.include "asm/macros/function.inc"
+24
View File
@@ -0,0 +1,24 @@
.macro arm_func_start name
.balign 4, 0
.global \name
.arm
.endm
.macro arm_func_end name
.size \name, .-\name
.endm
.macro thumb_func_start name
.balign 4, 0
.global \name
.thumb
.endm
.macro non_word_aligned_thumb_func_start name
.global \name
.thumb
.endm
.macro thumb_func_end name
.size \name, .-\name
.endm
View File
View File
View File
View File
+3521
View File
File diff suppressed because it is too large Load Diff
View File
View File
+506
View File
@@ -0,0 +1,506 @@
SDK_SYS_STACKSIZE = 0x00000000;
CONST_34 = 0x00000034;
CONST_3F = 0x0000003F;
SDK_IRQ_STACKSIZE = 0x00000400;
// .data
// OS
OSi_IrqCallbackInfoIndex = 0x02106818;
// DGT
Unk_0210683C = 0x0210683C;
Unk_02106840 = 0x02106840;
Unk_02106900 = 0x02106900;
Unk_02106A00 = 0x02106A00;
Unk_02106A04 = 0x02106A04;
// .bss
gBacklightTop = 0x02106FA0;
gBacklightTop_2 = 0x02106FA0;
gUnknown2106FB8 = 0x02106FB8;
gUnknown21C48B8 = 0x021C48B8;
gUnk021C4918 = 0x021C4918;
OSi_IrqCallbackInfo = 0x021D341C;
isInitialized = 0x021D347C;
OSi_StackForDestructor = 0x021D3480;
OSi_RescheduleCount = 0x021D3484;
OSi_ThreadIdCount = 0x021D3488;
OSi_SystemCallbackInSwitchThread = 0x021D348C;
OSi_CurrentThreadPtr = 0x021D3490;
OSi_IsThreadInitialized = 0x021D3494;
OSi_ThreadInfo = 0x021D3498;
OSi_IdleThread = 0x021D34A8;
OSi_LauncherThread = 0x021D3568;
OSi_IdleThreadStack = 0x021D3628;
OSi_Initialized = 0x021D36F0;
OSi_MainExArenaEnabled = 0x021D36F4;
OSi_HeapInfo = 0x021D36F8;
OSi_UserExceptionHandler = 0x021D371C;
OSi_UserExceptionHandlerArg = 0x21D3720;
OSi_DebuggerHandler = 0x021D3724;
OSi_ExContext = 0x021D3728;
OSi_TimerReserved = 0x021D37A8;
OSi_UseTick = 0x021D37AC;
OSi_NeedResetTimer = 0x021D37B0;
OSi_TickCounter = 0x021D37B4;
OSi_UseAlarm = 0x021D37BC;
OSi_AlarmQueue = 0x021D37C0;
OSi_UseVAlarm = 0x021D37C8;
OSi_PreviousVCount = 0x021D37CC;
OSi_VFrameCount = 0x021D37D0;
OSi_VAlarmQueue = 0x021D37D4;
OSi_IsInitReset = 0x021D37DC;
OSi_IsResetOccurred = 0x021D37E0;
OSi_vramExclusive = 0x021D37E4;
OSi_vramLockId = 0x021D37E8;
cardi_common = 0x021D55C0;
// Overlay
FUN_021D74E0 = 0x021D74E0;
FUN_021D76AC = 0x021D76AC;
gUnk021D76C8 = 0x021D76C8;
FUN_021D77C4 = 0x021D77C4;
FUN_021D7800 = 0x021D7800;
FUN_021D78FC = 0x021D78FC;
FUN_021D79B4 = 0x021D79B4;
FUN_021D7CA4 = 0x021D7CA4;
FUN_021D7F8C = 0x021D7F8C;
FUN_021D8018 = 0x021D8018;
FUN_021D8164 = 0x021D8164;
FUN_021D82BC = 0x021D82BC;
FUN_021D8320 = 0x021D8320;
FUN_021D836C = 0x021D836C;
FUN_021D83A8 = 0x021D83A8;
FUN_021D83C0 = 0x021D83C0;
FUN_021D844C = 0x021D844C;
FUN_021D8494 = 0x021D8494;
FUN_021D85FC = 0x021D85FC;
FUN_021D8624 = 0x021D8624;
FUN_021D865C = 0x021D865C;
FUN_021D8758 = 0x021D8758;
FUN_021D8820 = 0x021D8820;
FUN_021D88E4 = 0x021D88E4;
FUN_021D89CC = 0x021D89CC;
FUN_021D8B64 = 0x021D8B64;
FUN_021D8C24 = 0x021D8C24;
FUN_021D917C = 0x021D917C;
FUN_021D959C = 0x021D959C;
FUN_021D967C = 0x021D967C;
FUN_021D96F4 = 0x021D96F4;
FUN_021D9708 = 0x021D9708;
FUN_021D971C = 0x021D971C;
FUN_021D9820 = 0x021D9820;
FUN_021D99F8 = 0x021D99F8;
FUN_021DA464 = 0x021DA464;
FUN_021DA4EC = 0x021DA4EC;
FUN_021DA54C = 0x021DA54C;
FUN_021DA58C = 0x021DA58C;
FUN_021DA5B8 = 0x021DA5B8;
FUN_021DA5C8 = 0x021DA5C8;
FUN_021DA5D0 = 0x021DA5D0;
FUN_021DA5D8 = 0x021DA5D8;
FUN_021DA7B4 = 0x021DA7B4;
FUN_021DAAA4 = 0x021DAAA4;
FUN_021DAC70 = 0x021DAC70;
FUN_021DAE40 = 0x021DAE40;
FUN_021DAED4 = 0x021DAED4;
FUN_021DAF28 = 0x021DAF28;
FUN_021DAF78 = 0x021DAF78;
FUN_021DAF98 = 0x021DAF98;
FUN_021DB030 = 0x021DB030;
FUN_021DB7E8 = 0x021DB7E8;
FUN_021DB858 = 0x021DB858;
gUnk021DBE18 = 0x021DBE18;
FUN_021DC174 = 0x021DC174;
FUN_021DD6F0 = 0x021DD6F0;
FUN_021DD718 = 0x021DD718;
FUN_021DDB08 = 0x021DDB08;
FUN_021E1374 = 0x021E1374;
FUN_021E1858 = 0x021E1858;
FUN_021E1994 = 0x021E1994;
FUN_021E1BF8 = 0x021E1BF8;
FUN_021E1C4C = 0x021E1C4C;
FUN_021E1C54 = 0x021E1C54;
FUN_021E1ECC = 0x021E1ECC;
FUN_021E1F34 = 0x021E1F34;
FUN_021E1F58 = 0x021E1F58;
FUN_021E1F60 = 0x021E1F60;
FUN_021E2464 = 0x021E2464;
FUN_021E2608 = 0x021E2608;
FUN_021E26CC = 0x021E26CC;
FUN_021E27E8 = 0x021E27E8;
FUN_021E288C = 0x021E288C;
FUN_021E28A0 = 0x021E28A0;
FUN_021E2950 = 0x021E2950;
FUN_021E29B4 = 0x021E29B4;
FUN_021E29C8 = 0x021E29C8;
FUN_021E2A70 = 0x021E2A70;
FUN_021E2AD4 = 0x021E2AD4;
FUN_021E2B80 = 0x021E2B80;
FUN_021E2B9C = 0x021E2B9C;
FUN_021E2BB8 = 0x021E2BB8;
FUN_021E2BD0 = 0x021E2BD0;
FUN_021E2C24 = 0x021E2C24;
FUN_021E2C58 = 0x021E2C58;
FUN_021E2CBC = 0x021E2CBC;
FUN_021E32F0 = 0x021E32F0;
FUN_021E331C = 0x021E331C;
FUN_021E3424 = 0x021E3424;
FUN_021E3444 = 0x021E3444;
FUN_021E495C = 0x021E495C;
FUN_021E4C54 = 0x021E4C54;
FUN_021E4C60 = 0x021E4C60;
FUN_021E4DE4 = 0x021E4DE4;
FUN_021E5614 = 0x021E5614;
FUN_021E57D4 = 0x021E57D4;
FUN_021E5970 = 0x021E5970;
FUN_021E5B30 = 0x021E5B30;
FUN_021E5FD8 = 0x021E5FD8;
FUN_021E5FE0 = 0x021E5FE0;
FUN_021E6410 = 0x021E6410;
FUN_021E643C = 0x021E643C;
FUN_021E6990 = 0x021E6990;
FUN_021E69BC = 0x021E69BC;
FUN_021E6BF4 = 0x021E6BF4;
FUN_021E7030 = 0x021E7030;
FUN_021E70F0 = 0x021E70F0;
FUN_021E7138 = 0x021E7138;
FUN_021E7184 = 0x021E7184;
FUN_021E71E8 = 0x021E71E8;
FUN_021E7750 = 0x021E7750;
FUN_021E799C = 0x021E799C;
FUN_021E7AC0 = 0x021E7AC0;
FUN_021E7EA0 = 0x021E7EA0;
FUN_021E7EB0 = 0x021E7EB0;
FUN_021E7EC4 = 0x021E7EC4;
FUN_021E7EC8 = 0x021E7EC8;
FUN_021E7ED0 = 0x021E7ED0;
FUN_021E7ED8 = 0x021E7ED8;
FUN_021E7FBC = 0x021E7FBC;
FUN_021E8128 = 0x021E8128;
FUN_021E8130 = 0x021E8130;
FUN_021E8140 = 0x021E8140;
FUN_021E8144 = 0x021E8144;
FUN_021E8148 = 0x021E8148;
FUN_021E8158 = 0x021E8158;
FUN_021E81BC = 0x021E81BC;
FUN_021E84F4 = 0x021E84F4;
FUN_021E856C = 0x021E856C;
FUN_021E8588 = 0x021E8588;
FUN_021E85E4 = 0x021E85E4;
FUN_021E85FC = 0x021E85FC;
FUN_021EAE90 = 0x021EAE90;
FUN_021EB044 = 0x021EB044;
FUN_021EC57C = 0x021EC57C;
FUN_021EC71C = 0x021EC71C;
FUN_021EC854 = 0x021EC854;
FUN_021EC864 = 0x021EC864;
FUN_021ECD64 = 0x021ECD64;
FUN_021ECF14 = 0x021ECF14;
FUN_021ED0CC = 0x021ED0CC;
FUN_021ED49C = 0x021ED49C;
FUN_021ED4E0 = 0x021ED4E0;
FUN_021ED52C = 0x021ED52C;
FUN_021ED5C4 = 0x021ED5C4;
FUN_021ED5EC = 0x021ED5EC;
FUN_021ED644 = 0x021ED644;
FUN_021ED940 = 0x021ED940;
FUN_021EDA48 = 0x021EDA48;
FUN_021EDBC8 = 0x021EDBC8;
FUN_021EF5E0 = 0x021EF5E0;
FUN_021EF604 = 0x021EF604;
FUN_021EF620 = 0x021EF620;
FUN_021EF654 = 0x021EF654;
FUN_021EF824 = 0x021EF824;
FUN_021EF844 = 0x021EF844;
FUN_021EF8C8 = 0x021EF8C8;
FUN_021EF8DC = 0x021EF8DC;
FUN_021EFA9C = 0x021EFA9C;
FUN_021F02C4 = 0x021F02C4;
FUN_021F1D8C = 0x021F1D8C;
FUN_021F1DC8 = 0x021F1DC8;
FUN_021F1DFC = 0x021F1DFC;
FUN_021F1EC0 = 0x021F1EC0;
FUN_021F1F78 = 0x021F1F78;
FUN_021F2094 = 0x021F2094;
FUN_021F20D8 = 0x021F20D8;
FUN_021F20F8 = 0x021F20F8;
FUN_021F2AF4 = 0x021F2AF4;
FUN_021F2E0C = 0x021F2E0C;
FUN_021F2E28 = 0x021F2E28;
FUN_021F2F48 = 0x021F2F48;
FUN_021F2F6C = 0x021F2F6C;
FUN_021F3A18 = 0x021F3A18;
FUN_021F3AB4 = 0x021F3AB4;
FUN_021F3B4C = 0x021F3B4C;
FUN_021F3B7C = 0x021F3B7C;
FUN_021F3DA4 = 0x021F3DA4;
FUN_021F44D8 = 0x021F44D8;
FUN_021F4520 = 0x021F4520;
FUN_021F4568 = 0x021F4568;
FUN_021F4594 = 0x021F4594;
FUN_021F45E8 = 0x021F45E8;
FUN_021F4608 = 0x021F4608;
FUN_021F4BD0 = 0x021F4BD0;
FUN_021F4C88 = 0x021F4C88;
FUN_021F4D80 = 0x021F4D80;
FUN_021F4DC8 = 0x021F4DC8;
FUN_021F4E7C = 0x021F4E7C;
FUN_021F57EC = 0x021F57EC;
FUN_021F5C44 = 0x021F5C44;
FUN_021F61DC = 0x021F61DC;
FUN_021F61E8 = 0x021F61E8;
FUN_02211E60 = 0x02211E60;
FUN_0222D5C0 = 0x0222D5C0;
FUN_0222DAEC = 0x0222DAEC;
FUN_0222DD1C = 0x0222DD1C;
FUN_0222DD38 = 0x0222DD38;
FUN_0222E2BC = 0x0222E2BC;
FUN_0222E360 = 0x0222E360;
FUN_0222E3A0 = 0x0222E3A0;
FUN_0222E7E8 = 0x0222E7E8;
FUN_0222E874 = 0x0222E874;
FUN_0222ED34 = 0x0222ED34;
FUN_0222EDBC = 0x0222EDBC;
FUN_0222F440 = 0x0222F440;
FUN_0222F480 = 0x0222F480;
FUN_0222F7E0 = 0x0222F7E0;
FUN_0222F990 = 0x0222F990;
FUN_022300D4 = 0x022300D4;
FUN_022300DC = 0x022300DC;
FUN_022300E4 = 0x022300E4;
FUN_022300E8 = 0x022300E8;
FUN_022300F4 = 0x022300F4;
FUN_02230100 = 0x02230100;
FUN_0223010C = 0x0223010C;
FUN_02230118 = 0x02230118;
FUN_02230124 = 0x02230124;
FUN_02230F3C = 0x02230F3C;
FUN_02230F70 = 0x02230F70;
FUN_02230F80 = 0x02230F80;
FUN_02231344 = 0x02231344;
FUN_02231350 = 0x02231350;
FUN_0223135C = 0x0223135C;
FUN_02231368 = 0x02231368;
FUN_02231374 = 0x02231374;
FUN_02239944 = 0x02239944;
FUN_02239AAC = 0x02239AAC;
FUN_0223CACC = 0x0223CACC;
FUN_0223CB08 = 0x0223CB08;
FUN_0223CCDC = 0x0223CCDC;
FUN_0223CD7C = 0x0223CD7C;
FUN_0223D3D0 = 0x0223D3D0;
FUN_0223D638 = 0x0223D638;
FUN_0223D648 = 0x0223D648;
FUN_0223DFB4 = 0x0223DFB4;
FUN_0223E060 = 0x0223E060;
FUN_0223E118 = 0x0223E118;
FUN_0223E154 = 0x0223E154;
FUN_0223E1A4 = 0x0223E1A4;
FUN_0223E1E0 = 0x0223E1E0;
FUN_0223E2AC = 0x0223E2AC;
FUN_0223E4A8 = 0x0223E4A8;
FUN_0223E4D4 = 0x0223E4D4;
FUN_0223E554 = 0x0223E554;
FUN_0223E6B8 = 0x0223E6B8;
FUN_0223E734 = 0x0223E734;
FUN_0223E7FC = 0x0223E7FC;
FUN_0223EB8C = 0x0223EB8C;
FUN_0223EF7C = 0x0223EF7C;
FUN_0223F4D8 = 0x0223F4D8;
FUN_0223F4F4 = 0x0223F4F4;
FUN_0223F8D8 = 0x0223F8D8;
FUN_0223FCE8 = 0x0223FCE8;
FUN_02240790 = 0x02240790;
FUN_022407CC = 0x022407CC;
FUN_022407DC = 0x022407DC;
FUN_022407F8 = 0x022407F8;
FUN_02240834 = 0x02240834;
FUN_02240844 = 0x02240844;
FUN_0224089C = 0x0224089C;
FUN_022408FC = 0x022408FC;
FUN_022411F4 = 0x022411F4;
FUN_02241230 = 0x02241230;
FUN_02241914 = 0x02241914;
FUN_02242A38 = 0x02242A38;
FUN_02242BE0 = 0x02242BE0;
FUN_0224312C = 0x0224312C;
FUN_022432E4 = 0x022432E4;
FUN_0224339C = 0x0224339C;
FUN_022433A8 = 0x022433A8;
FUN_022433B0 = 0x022433B0;
FUN_022433B8 = 0x022433B8;
FUN_022433F8 = 0x022433F8;
FUN_02243408 = 0x02243408;
FUN_02243428 = 0x02243428;
FUN_02243448 = 0x02243448;
FUN_0224345C = 0x0224345C;
FUN_022434AC = 0x022434AC;
FUN_022434BC = 0x022434BC;
FUN_022434D0 = 0x022434D0;
FUN_02243694 = 0x02243694;
FUN_022436C8 = 0x022436C8;
FUN_022436E8 = 0x022436E8;
FUN_02243780 = 0x02243780;
FUN_02243838 = 0x02243838;
FUN_022438DC = 0x022438DC;
FUN_022438E0 = 0x022438E0;
FUN_022438FC = 0x022438FC;
FUN_02243920 = 0x02243920;
FUN_022439F8 = 0x022439F8;
FUN_02243AD8 = 0x02243AD8;
FUN_02243BA8 = 0x02243BA8;
FUN_02243C5C = 0x02243C5C;
FUN_02243D3C = 0x02243D3C;
FUN_02243DA0 = 0x02243DA0;
FUN_02243DB8 = 0x02243DB8;
FUN_02243DC0 = 0x02243DC0;
FUN_02243DC4 = 0x02243DC4;
FUN_02243DD8 = 0x02243DD8;
FUN_02243DE0 = 0x02243DE0;
FUN_02243E34 = 0x02243E34;
FUN_02243E74 = 0x02243E74;
FUN_02243F18 = 0x02243F18;
FUN_02243F50 = 0x02243F50;
FUN_02243F9C = 0x02243F9C;
FUN_02244210 = 0x02244210;
FUN_02244558 = 0x02244558;
FUN_02244660 = 0x02244660;
FUN_022446BC = 0x022446BC;
FUN_022446E0 = 0x022446E0;
FUN_022446FC = 0x022446FC;
FUN_02244758 = 0x02244758;
FUN_02244770 = 0x02244770;
FUN_02244824 = 0x02244824;
FUN_0224484C = 0x0224484C;
FUN_02244D1C = 0x02244D1C;
FUN_02244D20 = 0x02244D20;
FUN_02244D3C = 0x02244D3C;
FUN_02244D40 = 0x02244D40;
FUN_02244D58 = 0x02244D58;
FUN_02244D98 = 0x02244D98;
FUN_02244DA0 = 0x02244DA0;
FUN_02244DB0 = 0x02244DB0;
FUN_02244DBC = 0x02244DBC;
FUN_02244DC4 = 0x02244DC4;
FUN_02244EF8 = 0x02244EF8;
FUN_02244F18 = 0x02244F18;
FUN_02244F24 = 0x02244F24;
FUN_02244F2C = 0x02244F2C;
FUN_02245088 = 0x02245088;
FUN_02245114 = 0x02245114;
FUN_02245190 = 0x02245190;
FUN_02245198 = 0x02245198;
FUN_022451F0 = 0x022451F0;
FUN_0224525C = 0x0224525C;
FUN_022452A4 = 0x022452A4;
FUN_02245324 = 0x02245324;
FUN_02245340 = 0x02245340;
FUN_02245358 = 0x02245358;
FUN_0224566C = 0x0224566C;
FUN_022456E8 = 0x022456E8;
FUN_02245844 = 0x02245844;
FUN_02245910 = 0x02245910;
FUN_02245F1C = 0x02245F1C;
FUN_02245F4C = 0x02245F4C;
FUN_02245FA0 = 0x02245FA0;
FUN_022461A4 = 0x022461A4;
FUN_022461B8 = 0x022461B8;
FUN_0224666C = 0x0224666C;
FUN_022466A0 = 0x022466A0;
FUN_022466AC = 0x022466AC;
FUN_02246F1C = 0x02246F1C;
FUN_02247294 = 0x02247294;
FUN_022472AC = 0x022472AC;
FUN_02247544 = 0x02247544;
FUN_02247614 = 0x02247614;
FUN_02247728 = 0x02247728;
FUN_02247808 = 0x02247808;
FUN_02247970 = 0x02247970;
FUN_02247A34 = 0x02247A34;
FUN_022483BC = 0x022483BC;
FUN_022483E0 = 0x022483E0;
FUN_022483EC = 0x022483EC;
FUN_02248724 = 0x02248724;
FUN_0224884C = 0x0224884C;
FUN_022488CC = 0x022488CC;
FUN_022488EC = 0x022488EC;
FUN_022488F4 = 0x022488F4;
FUN_022488FC = 0x022488FC;
FUN_0224891C = 0x0224891C;
FUN_02248B54 = 0x02248B54;
FUN_02248B58 = 0x02248B58;
FUN_02248B5C = 0x02248B5C;
FUN_02248B60 = 0x02248B60;
FUN_02248B6C = 0x02248B6C;
FUN_02248CC0 = 0x02248CC0;
FUN_02248CD0 = 0x02248CD0;
FUN_02248DF8 = 0x02248DF8;
FUN_02248F70 = 0x02248F70;
FUN_02248FE0 = 0x02248FE0;
FUN_02249038 = 0x02249038;
FUN_022490A0 = 0x022490A0;
FUN_022491FC = 0x022491FC;
FUN_022494C8 = 0x022494C8;
FUN_02249508 = 0x02249508;
FUN_02249668 = 0x02249668;
FUN_022497E8 = 0x022497E8;
FUN_02249E6C = 0x02249E6C;
FUN_02249E78 = 0x02249E78;
FUN_02249E84 = 0x02249E84;
FUN_02249E90 = 0x02249E90;
FUN_0224A310 = 0x0224A310;
FUN_0224A528 = 0x0224A528;
FUN_0224A7C8 = 0x0224A7C8;
FUN_0224ABAC = 0x0224ABAC;
FUN_0224B124 = 0x0224B124;
FUN_0224B2C4 = 0x0224B2C4;
FUN_0224B568 = 0x0224B568;
FUN_0224B818 = 0x0224B818;
FUN_0224B86C = 0x0224B86C;
FUN_0224B9E0 = 0x0224B9E0;
FUN_0224BBEC = 0x0224BBEC;
FUN_0224BD90 = 0x0224BD90;
FUN_0224C038 = 0x0224C038;
FUN_0224C27C = 0x0224C27C;
FUN_0224C520 = 0x0224C520;
FUN_0224C678 = 0x0224C678;
FUN_0224C6E8 = 0x0224C6E8;
FUN_0224C6F4 = 0x0224C6F4;
FUN_0224C700 = 0x0224C700;
FUN_0224C8C8 = 0x0224C8C8;
FUN_0224CA2C = 0x0224CA2C;
FUN_0224CA54 = 0x0224CA54;
FUN_0224CA58 = 0x0224CA58;
FUN_0224CA88 = 0x0224CA88;
FUN_0224CA94 = 0x0224CA94;
FUN_0224CAA0 = 0x0224CAA0;
FUN_0224CAB4 = 0x0224CAB4;
FUN_0224CB30 = 0x0224CB30;
FUN_0224CBB0 = 0x0224CBB0;
FUN_0224CC24 = 0x0224CC24;
FUN_0224CECC = 0x0224CECC;
FUN_0224D14C = 0x0224D14C;
FUN_0224D2E0 = 0x0224D2E0;
FUN_0224D3E8 = 0x0224D3E8;
FUN_0224D70C = 0x0224D70C;
FUN_0224D76C = 0x0224D76C;
FUN_0224D79C = 0x0224D79C;
FUN_0224DCB8 = 0x0224DCB8;
FUN_0224DD94 = 0x0224DD94;
FUN_0224DDB8 = 0x0224DDB8;
FUN_0224E554 = 0x0224E554;
FUN_0224E764 = 0x0224E764;
FUN_0224E7C4 = 0x0224E7C4;
FUN_0224F12C = 0x0224F12C;
FUN_02252534 = 0x02252534;
FUN_02252538 = 0x02252538;
FUN_022567E0 = 0x022567E0;
// ???
SDK_MAIN_ARENA_LO = 0x0225FFA0;
// EWRAM
SDK_SECTION_ARENA_EX_START = 0x023E0000;
// DTCM
gUnk027FFC20 = 0x027FFC20;
+8 -74
View File
@@ -1,13 +1,8 @@
/* TEST */
MEMORY {
header (RWX) : ORIGIN=0, LENGTH=0
arm9.text (RWX) : ORIGIN=0x02000000, LENGTH=0
arm9.data (RWX) : ORIGIN=0x020EC710, LENGTH=0
arm9.itcm (RWX) : ORIGIN=0x01FF8000, LENGTH=0x8000
arm9.dtcm (RWX) : ORIGIN=0x027E0000, LENGTH=0x2000
arm9.autoload (RWX) : ORIGIN=0x02107700, LENGTH=0
arm9overlay (RWX) : ORIGIN=0, LENGTH=0
arm7 (RWX) : ORIGIN=0x2380000, LENGTH=0
arm9 (RWX) : ORIGIN=0x02000000, LENGTH=0
arm7 (RWX) : ORIGIN=0x02380000, LENGTH=0
filenametable (RWX) : ORIGIN=0, LENGTH=0
fileallocationtable (RWX) : ORIGIN=0, LENGTH=0
icon_title (RWX) : ORIGIN=0, LENGTH=0
@@ -377,72 +372,10 @@ SECTIONS {
} > header
.arm9 : AT (0x4000) {
secure.o (.text)
crt0.o (.text)
main.o (.text)
FUN_02000DF4.o (.text)
unk_02000E0C.o (.text)
string_util.o (.text)
unk_020023C0.o (.text)
filesystem.o (.text)
unk_02006864.o (.text)
script.o (.text)
unk_02038C78.o (.text)
scrcmd.o (.text)
unk_02046030.o (.text)
unk_0208AC14.o (.text)
unk_020AF030.o (.text)
/* SDK */
GX_arm9.o (.text)
OS_arm9.o (.text)
MI_arm9.o (.text)
SND_arm9.o (.text)
PXI_arm9.o (.text)
FS_arm9.o (.text)
DGT_arm9.o (.text)
CP_arm9.o (.text)
SPI_arm9.o (.text)
PM_arm9.o (.text)
RTC_arm9.o (.text)
CARD_arm9.o (.text)
WM_arm9.o (.text)
CTRDG_arm9.o (.text)
MATH_arm9.o (.text)
STD_arm9.o (.text)
} > arm9.text
.arm9.data : AT (0xF0710) {
rom2.o (.data)
string_util.o (.data)
rom2_2.o (.data)
} > arm9.data
SDK_AUTOLOAD_START = .;
SDK_STATIC_BSS_START = .;
SDK_STATIC_BSS_END = . + 0xd0540;
.arm9.itcm : AT (0x10AFA0)
{
arm9_itcm.o (.itcm)
. = 0x01FF8720;
SDK_SECTION_ARENA_ITCM_START = .;
} > arm9.itcm
.arm9.dtcm : AT (0x10B6A0) {
SDK_AUTOLOAD_DTCM_START = .;
OS_arm9.o (.dtcm)
. = 0x027E0080;
SDK_SECTION_ARENA_DTCM_START = .;
} > arm9.dtcm
.arm9.autoload : AT (0x10B700) {
SDK_AUTOLOAD_LIST.o (.data)
unk_10b724.o (.text)
} > arm9.autoload
.arm9overlay : AT (0x10B800) {
arm9overlay.o (.text)
} > arm9overlay
_start = .;
_start_AutoloadDoneCallback = . + 0xA74;
INCLUDE arm9.bin
} > arm9
.FILE_10C400 : AT (0x10C400) {
FILE_10C400.o (.text) /* 0x10C400 */
@@ -707,7 +640,8 @@ SECTIONS {
} > rom3.FILE_30C600
.arm7 : AT(0x30D000) {
arm7_rom.o(.text)
ARM7AutoLoad = 0x02380158;
INCLUDE arm7.bin
} > arm7
.filenametable : AT(0x336400) {