summaryrefslogtreecommitdiff
path: root/arm7
diff options
context:
space:
mode:
Diffstat (limited to 'arm7')
-rw-r--r--arm7/Makefile18
-rw-r--r--arm7/arm7.lcf49
-rw-r--r--arm7/arm7.lsf28
-rw-r--r--arm7/arm7.sha12
-rw-r--r--arm7/asm/crt0.s8
-rw-r--r--arm7/asm/dtcm2.s24
-rw-r--r--arm7/asm/dtcm_bss.s470
-rw-r--r--arm7/asm/ext.s61
-rw-r--r--arm7/asm/itcm.s16
-rw-r--r--arm7/global.inc12
-rw-r--r--arm7/undefined_syms.txt186
11 files changed, 566 insertions, 308 deletions
diff --git a/arm7/Makefile b/arm7/Makefile
index c2e69fe2..cdbb27d7 100644
--- a/arm7/Makefile
+++ b/arm7/Makefile
@@ -39,9 +39,11 @@ BUILD_DIR := build
TARGET := arm7
-ROM := $(BUILD_DIR)/$(TARGET).bin
+ROM := $(BUILD_DIR)/$(TARGET).sbin
ELF := $(BUILD_DIR)/$(TARGET).elf
-LD_SCRIPT := arm7.lcf
+LD_SCRIPT := $(TARGET).lcf
+LD_SPEC := $(TARGET).lsf
+LD_TEMPLATE := ARM7-TS.lcf.template
# Directories containing source files
SRC_DIRS := src
@@ -69,6 +71,7 @@ MWCCARM := $(TOOLS_DIR)/mwccarm/$(MWCCVERSION)/mwccarm.exe
# only dependency should be MWCCARM.
MWLDARM := $(TOOLS_DIR)/mwccarm/$(MWCCVERSION)/mwldarm.exe
MWASMARM := $(TOOLS_DIR)/mwccarm/$(MWCCVERSION)/mwasmarm.exe
+MAKELSF := $(WINE) $(TOOLS_DIR)/bin/makelcf.exe
AS := $(WINE) $(MWASMARM)
CC := $(WINE) $(MWCCARM)
@@ -91,7 +94,7 @@ JSONPROC = $(TOOLS_DIR)/jsonproc/jsonproc
GFX = $(TOOLS_DIR)/nitrogfx/nitrogfx
MWASMARM_PATCHER = $(TOOLS_DIR)/mwasmarm_patcher/mwasmarm_patcher$(EXE) -q
-TOOLDIRS = $(filter-out $(TOOLS_DIR)/mwccarm,$(wildcard $(TOOLS_DIR)/*))
+TOOLDIRS = $(filter-out $(TOOLS_DIR)/mwccarm $(TOOLS_DIR)/bin,$(wildcard $(TOOLS_DIR)/*))
TOOLBASE = $(TOOLDIRS:$(TOOLS_DIR)/%=%)
TOOLS = $(foreach tool,$(TOOLBASE),$(TOOLS_DIR)/$(tool)/$(tool)$(EXE))
@@ -141,15 +144,12 @@ $(BUILD_DIR)/%.o: %.c
$(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 $@ $<
+$(BUILD_DIR)/$(LD_SCRIPT): $(LD_SPEC) $(LD_TEMPLATE)
+ $(MAKELSF) $< $(LD_TEMPLATE) $@
-$(ELF): $(O_FILES) $(BUILD_DIR)/$(LD_SCRIPT)
+$(ROM): $(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)
diff --git a/arm7/arm7.lcf b/arm7/arm7.lcf
deleted file mode 100644
index 0a861ce6..00000000
--- a/arm7/arm7.lcf
+++ /dev/null
@@ -1,49 +0,0 @@
-MEMORY {
- .text (RX) : ORIGIN=0x02380000, LENGTH=0
- .sbss (RWX) : ORIGIN=AFTER(.text), LENGTH=0
- .itcm (RWX) : ORIGIN=0x027E0000, LENGTH=0
- .dtcm (RWX) : ORIGIN=0x037F8000, LENGTH=0
- .dtcm.bss (RWX) : ORIGIN=0x0380770C, LENGTH=0
- .ewram (RW) : ORIGIN=0x06000000, LENGTH=0
- .autoload (R) : ORIGIN=0x023A92F8, LENGTH=0
-}
-
-SECTIONS {
-#include "undefined_syms.txt"
- .text : AT (0x0) {
- crt0.o (.text)
- } > .text
-
- .sbss : {
- SDK_STATIC_BSS_START = .;
- SDK_STATIC_BSS_END = .;
- } > .sbss
-
- SDK_AUTOLOAD_START = .;
- .itcm : AT (0x1b0) {
- itcm.o (.text)
- } > .itcm
-
- .dtcm : AT (0x28C) {
- dtcm.o (.text)
- libsyscall.o (.text)
- dtcm2.o (.text)
- dtcm_data.o (.data)
- } > .dtcm
-
- .ewram : AT (0xF998) {
- ext.o (.text)
- } > .ewram
-
- .autoload : AT (0x292F8) {
- WRITEW SDK_AUTOLOAD_ITCM_START;
- WRITEW SDK_AUTOLOAD_ITCM_SIZE;
- WRITEW SDK_AUTOLOAD_ITCM_BSS_SIZE;
- WRITEW SDK_AUTOLOAD_DTCM_START;
- WRITEW SDK_AUTOLOAD_DTCM_SIZE;
- WRITEW SDK_AUTOLOAD_DTCM_BSS_SIZE;
- WRITEW SDK_AUTOLOAD_EXT_START;
- WRITEW SDK_AUTOLOAD_EXT_SIZE;
- WRITEW SDK_AUTOLOAD_EXT_BSS_SIZE;
- } > .autoload
-}
diff --git a/arm7/arm7.lsf b/arm7/arm7.lsf
new file mode 100644
index 00000000..9ab7cc9a
--- /dev/null
+++ b/arm7/arm7.lsf
@@ -0,0 +1,28 @@
+
+Static arm7
+{
+ Address 0x02380000
+ StackSize 1024 512
+}
+
+Autoload MAIN
+{
+ Address 0x027E0000
+ Object itcm.o
+}
+
+Autoload WRAM
+{
+ Address 0x037F8000
+ Object dtcm.o
+ Object libsyscall.o
+ Object dtcm2.o
+ Object dtcm_data.o
+ Object dtcm_bss.o
+}
+
+Autoload EXT
+{
+ Address 0x06000000
+ Object ext.o
+}
diff --git a/arm7/arm7.sha1 b/arm7/arm7.sha1
index e3bf79ef..e9afff54 100644
--- a/arm7/arm7.sha1
+++ b/arm7/arm7.sha1
@@ -1 +1 @@
-39aacbf97ae65b17783057aeed06b80049b18dee build/arm7.bin
+39aacbf97ae65b17783057aeed06b80049b18dee build/arm7.sbin
diff --git a/arm7/asm/crt0.s b/arm7/asm/crt0.s
index d25a70dd..4e671676 100644
--- a/arm7/asm/crt0.s
+++ b/arm7/asm/crt0.s
@@ -1,6 +1,6 @@
.include "asm/macros.inc"
.include "global.inc"
- .global ARM7AutoLoad
+ .global _start_AutoloadDoneCallback
.section .text
arm_func_start _start
@@ -102,9 +102,9 @@ _02380140:
bcc _02380140
beq _02380110
_02380150:
- b ARM7AutoLoad
+ b _start_AutoloadDoneCallback
_2380154: .word _2380198
-ARM7AutoLoad:
+_start_AutoloadDoneCallback:
bx lr
arm_func_end FUN_2380100
@@ -135,5 +135,3 @@ _2380198:
.word SDK_AUTOLOAD_START
.word SDK_STATIC_BSS_START
.word SDK_STATIC_BSS_END
-
- .balign 16, 0
diff --git a/arm7/asm/dtcm2.s b/arm7/asm/dtcm2.s
index 40b14c39..9f70a313 100644
--- a/arm7/asm/dtcm2.s
+++ b/arm7/asm/dtcm2.s
@@ -6284,28 +6284,28 @@ _03806664: .word _0380A3F0
arm_func_start FUN_03806668
FUN_03806668: ;@ 0x03806668
- ldr pc, _0380666C ;@ =_06006978
-_0380666C: .word _06006978
+ ldr pc, _0380666C ;@ =FUN_06006978
+_0380666C: .word FUN_06006978
arm_func_start FUN_03806670
FUN_03806670: ;@ 0x03806670
- ldr pc, _03806674 ;@ =_060009A4
-_03806674: .word _060009A4
+ ldr pc, _03806674 ;@ =FUN_060009A4
+_03806674: .word FUN_060009A4
arm_func_start FUN_03806678
FUN_03806678: ;@ 0x03806678
- ldr pc, _0380667C ;@ =_06000204
-_0380667C: .word _06000204
+ ldr pc, _0380667C ;@ =FUN_06000204
+_0380667C: .word FUN_06000204
arm_func_start FUN_03806680
FUN_03806680: ;@ 0x03806680
- ldr pc, _03806684 ;@ =_06008CC4
-_03806684: .word _06008CC4
+ ldr pc, _03806684 ;@ =FUN_06008CC4
+_03806684: .word FUN_06008CC4
arm_func_start FUN_03806688
FUN_03806688: ;@ 0x03806688
- ldr pc, _0380668C ;@ =_060001F8
-_0380668C: .word _060001F8
+ ldr pc, _0380668C ;@ =FUN_060001F8
+_0380668C: .word FUN_060001F8
arm_func_start FUN_03806690
FUN_03806690: ;@ 0x03806690
@@ -6613,8 +6613,8 @@ _03806A8C: .word _0380A4A4
arm_func_start FUN_03806A90
FUN_03806A90: ;@ 0x03806A90
- ldr pc, _03806A94 ;@ =_06000798
-_03806A94: .word _06000798
+ ldr pc, _03806A94 ;@ =FUN_06000798
+_03806A94: .word FUN_06000798
arm_func_start FUN_03806A98
FUN_03806A98: ;@ 0x03806A98
diff --git a/arm7/asm/dtcm_bss.s b/arm7/asm/dtcm_bss.s
new file mode 100644
index 00000000..4cc9fe9f
--- /dev/null
+++ b/arm7/asm/dtcm_bss.s
@@ -0,0 +1,470 @@
+ .include "asm/macros.inc"
+ .include "global.inc"
+ .section .bss
+ .global _0380770C
+_0380770C: ;0x0380770C
+ .space 0x03807714 - 0x0380770C
+
+ .global _03807714
+_03807714: ;0x03807714
+ .space 0x03807718 - 0x03807714
+
+ .global _03807718
+_03807718: ;0x03807718
+ .space 0x0380771C - 0x03807718
+
+ .global _0380771C
+_0380771C: ;0x0380771C
+ .space 0x03807744 - 0x0380771C
+
+ .global _03807744
+_03807744: ;0x03807744
+ .space 0x03807748 - 0x03807744
+
+ .global _03807748
+_03807748: ;0x03807748
+ .space 0x0380774C - 0x03807748
+
+ .global _0380774C
+_0380774C: ;0x0380774C
+ .space 0x03807774 - 0x0380774C
+
+ .global _03807774
+_03807774: ;0x03807774
+ .space 0x03807780 - 0x03807774
+
+ .global _03807780
+_03807780: ;0x03807780
+ .space 0x03807784 - 0x03807780
+
+ .global _03807784
+_03807784: ;0x03807784
+ .space 0x03807788 - 0x03807784
+
+ .global _03807788
+_03807788: ;0x03807788
+ .space 0x0380778C - 0x03807788
+
+ .global _0380778C
+_0380778C: ;0x0380778C
+ .space 0x03807790 - 0x0380778C
+
+ .global _03807790
+_03807790: ;0x03807790
+ .space 0x03807794 - 0x03807790
+
+ .global _03807794
+_03807794: ;0x03807794
+ .space 0x03807798 - 0x03807794
+
+ .global _03807798
+_03807798: ;0x03807798
+ .space 0x0380779C - 0x03807798
+
+ .global _0380779C
+_0380779C: ;0x0380779C
+ .space 0x038077A0 - 0x0380779C
+
+ .global _038077A0
+_038077A0: ;0x038077A0
+ .space 0x038077AC - 0x038077A0
+
+ .global _038077AC
+_038077AC: ;0x038077AC
+ .space 0x03807850 - 0x038077AC
+
+ .global _03807850
+_03807850: ;0x03807850
+ .space 0x038078F4 - 0x03807850
+
+ .global _038078F4
+_038078F4: ;0x038078F4
+ .space 0x038078F8 - 0x038078F4
+
+ .global _038078F8
+_038078F8: ;0x038078F8
+ .space 0x0380791C - 0x038078F8
+
+ .global _0380791C
+_0380791C: ;0x0380791C
+ .space 0x03807920 - 0x0380791C
+
+ .global _03807920
+_03807920: ;0x03807920
+ .space 0x03807924 - 0x03807920
+
+ .global _03807924
+_03807924: ;0x03807924
+ .space 0x03807928 - 0x03807924
+
+ .global _03807928
+_03807928: ;0x03807928
+ .space 0x03807930 - 0x03807928
+
+ .global _03807930
+_03807930: ;0x03807930
+ .space 0x03807934 - 0x03807930
+
+ .global _03807934
+_03807934: ;0x03807934
+ .space 0x0380793C - 0x03807934
+
+ .global _0380793C
+_0380793C: ;0x0380793C
+ .space 0x03807940 - 0x0380793C
+
+ .global _03807940
+_03807940: ;0x03807940
+ .space 0x03807944 - 0x03807940
+
+ .global _03807944
+_03807944: ;0x03807944
+ .space 0x03807948 - 0x03807944
+
+ .global _03807948
+_03807948: ;0x03807948
+ .space 0x03807950 - 0x03807948
+
+ .global _03807950
+_03807950: ;0x03807950
+ .space 0x03807954 - 0x03807950
+
+ .global _03807954
+_03807954: ;0x03807954
+ .space 0x03807958 - 0x03807954
+
+ .global _03807958
+_03807958: ;0x03807958
+ .space 0x0380795C - 0x03807958
+
+ .global _0380795C
+_0380795C: ;0x0380795C
+ .space 0x038079DC - 0x0380795C
+
+ .global _038079DC
+_038079DC: ;0x038079DC
+ .space 0x038079E0 - 0x038079DC
+
+ .global _038079E0
+_038079E0: ;0x038079E0
+ .space 0x03807A0C - 0x038079E0
+
+ .global _03807A0C
+_03807A0C: ;0x03807A0C
+ .space 0x03807A10 - 0x03807A0C
+
+ .global _03807A10
+_03807A10: ;0x03807A10
+ .space 0x03807A20 - 0x03807A10
+
+ .global _03807A20
+_03807A20: ;0x03807A20
+ .space 0x03807A30 - 0x03807A20
+
+ .global _03807A30
+_03807A30: ;0x03807A30
+ .space 0x03807A34 - 0x03807A30
+
+ .global _03807A34
+_03807A34: ;0x03807A34
+ .space 0x03807A54 - 0x03807A34
+
+ .global _03807A54
+_03807A54: ;0x03807A54
+ .space 0x03807A74 - 0x03807A54
+
+ .global _03807A74
+_03807A74: ;0x03807A74
+ .space 0x03807AA0 - 0x03807A74
+
+ .global _03807AA0
+_03807AA0: ;0x03807AA0
+ .space 0x03807F44 - 0x03807AA0
+
+ .global _03807F44
+_03807F44: ;0x03807F44
+ .space 0x03807F48 - 0x03807F44
+
+ .global _03807F48
+_03807F48: ;0x03807F48
+ .space 0x03807F4C - 0x03807F48
+
+ .global _03807F4C
+_03807F4C: ;0x03807F4C
+ .space 0x03807F50 - 0x03807F4C
+
+ .global _03807F50
+_03807F50: ;0x03807F50
+ .space 0x03807F58 - 0x03807F50
+
+ .global _03807F58
+_03807F58: ;0x03807F58
+ .space 0x03807F68 - 0x03807F58
+
+ .global _03807F68
+_03807F68: ;0x03807F68
+ .space 0x03807F6C - 0x03807F68
+
+ .global _03807F6C
+_03807F6C: ;0x03807F6C
+ .space 0x038084AC - 0x03807F6C
+
+ .global _038084AC
+_038084AC: ;0x038084AC
+ .space 0x038086EC - 0x038084AC
+
+ .global _038086EC
+_038086EC: ;0x038086EC
+ .space 0x03808EEC - 0x038086EC
+
+ .global _03808EEC
+_03808EEC: ;0x03808EEC
+ .space 0x038090EC - 0x03808EEC
+
+ .global _038090EC
+_038090EC: ;0x038090EC
+ .space 0x0380910C - 0x038090EC
+
+ .global _0380910C
+_0380910C: ;0x0380910C
+ .space 0x0380912C - 0x0380910C
+
+ .global _0380912C
+_0380912C: ;0x0380912C
+ .space 0x03809140 - 0x0380912C
+
+ .global _03809140
+_03809140: ;0x03809140
+ .space 0x03809188 - 0x03809140
+
+ .global _03809188
+_03809188: ;0x03809188
+ .space 0x03809760 - 0x03809188
+
+ .global _03809760
+_03809760: ;0x03809760
+ .space 0x03809764 - 0x03809760
+
+ .global _03809764
+_03809764: ;0x03809764
+ .space 0x03809774 - 0x03809764
+
+ .global _03809774
+_03809774: ;0x03809774
+ .space 0x03809780 - 0x03809774
+
+ .global _03809780
+_03809780: ;0x03809780
+ .space 0x038099A0 - 0x03809780
+
+ .global _038099A0
+_038099A0: ;0x038099A0
+ .space 0x038099A4 - 0x038099A0
+
+ .global _038099A4
+_038099A4: ;0x038099A4
+ .space 0x038099A8 - 0x038099A4
+
+ .global _038099A8
+_038099A8: ;0x038099A8
+ .space 0x038099AC - 0x038099A8
+
+ .global _038099AC
+_038099AC: ;0x038099AC
+ .space 0x038099B0 - 0x038099AC
+
+ .global _038099B0
+_038099B0: ;0x038099B0
+ .space 0x038099B8 - 0x038099B0
+
+ .global _038099B8
+_038099B8: ;0x038099B8
+ .space 0x03809C5C - 0x038099B8
+
+ .global _03809C5C
+_03809C5C: ;0x03809C5C
+ .space 0x03809C7C - 0x03809C5C
+
+ .global _03809C7C
+_03809C7C: ;0x03809C7C
+ .space 0x03809CBC - 0x03809C7C
+
+ .global _03809CBC
+_03809CBC: ;0x03809CBC
+ .space 0x03809CC0 - 0x03809CBC
+
+ .global _03809CC0
+_03809CC0: ;0x03809CC0
+ .space 0x03809E40 - 0x03809CC0
+
+ .global _03809E40
+_03809E40: ;0x03809E40
+ .space 0x03809E4C - 0x03809E40
+
+ .global _03809E4C
+_03809E4C: ;0x03809E4C
+ .space 0x03809E50 - 0x03809E4C
+
+ .global _03809E50
+_03809E50: ;0x03809E50
+ .space 0x03809E54 - 0x03809E50
+
+ .global _03809E54
+_03809E54: ;0x03809E54
+ .space 0x03809E80 - 0x03809E54
+
+ .global _03809E80
+_03809E80: ;0x03809E80
+ .space 0x03809F28 - 0x03809E80
+
+ .global _03809F28
+_03809F28: ;0x03809F28
+ .space 0x03809F2C - 0x03809F28
+
+ .global _03809F2C
+_03809F2C: ;0x03809F2C
+ .space 0x03809F30 - 0x03809F2C
+
+ .global _03809F30
+_03809F30: ;0x03809F30
+ .space 0x03809F34 - 0x03809F30
+
+ .global _03809F34
+_03809F34: ;0x03809F34
+ .space 0x03809F38 - 0x03809F34
+
+ .global _03809F38
+_03809F38: ;0x03809F38
+ .space 0x03809F64 - 0x03809F38
+
+ .global _03809F64
+_03809F64: ;0x03809F64
+ .space 0x03809F68 - 0x03809F64
+
+ .global _03809F68
+_03809F68: ;0x03809F68
+ .space 0x03809F6C - 0x03809F68
+
+ .global _03809F6C
+_03809F6C: ;0x03809F6C
+ .space 0x03809FA8 - 0x03809F6C
+
+ .global _03809FA8
+_03809FA8: ;0x03809FA8
+ .space 0x03809FB8 - 0x03809FA8
+
+ .global _03809FB8
+_03809FB8: ;0x03809FB8
+ .space 0x03809FBC - 0x03809FB8
+
+ .global _03809FBC
+_03809FBC: ;0x03809FBC
+ .space 0x03809FC0 - 0x03809FBC
+
+ .global _03809FC0
+_03809FC0: ;0x03809FC0
+ .space 0x03809FC4 - 0x03809FC0
+
+ .global _03809FC4
+_03809FC4: ;0x03809FC4
+ .space 0x03809FC8 - 0x03809FC4
+
+ .global _03809FC8
+_03809FC8: ;0x03809FC8
+ .space 0x03809FCC - 0x03809FC8
+
+ .global _03809FCC
+_03809FCC: ;0x03809FCC
+ .space 0x03809FD0 - 0x03809FCC
+
+ .global _03809FD0
+_03809FD0: ;0x03809FD0
+ .space 0x03809FD4 - 0x03809FD0
+
+ .global _03809FD4
+_03809FD4: ;0x03809FD4
+ .space 0x03809FEC - 0x03809FD4
+
+ .global _03809FEC
+_03809FEC: ;0x03809FEC
+ .space 0x0380A018 - 0x03809FEC
+
+ .global _0380A018
+_0380A018: ;0x0380A018
+ .space 0x0380A038 - 0x0380A018
+
+ .global _0380A038
+_0380A038: ;0x0380A038
+ .space 0x0380A03C - 0x0380A038
+
+ .global _0380A03C
+_0380A03C: ;0x0380A03C
+ .space 0x0380A05C - 0x0380A03C
+
+ .global _0380A05C
+_0380A05C: ;0x0380A05C
+ .space 0x0380A06C - 0x0380A05C
+
+ .global _0380A06C
+_0380A06C: ;0x0380A06C
+ .space 0x0380A13C - 0x0380A06C
+
+ .global _0380A13C
+_0380A13C: ;0x0380A13C
+ .space 0x0380A210 - 0x0380A13C
+
+ .global _0380A210
+_0380A210: ;0x0380A210
+ .space 0x0380A3F0 - 0x0380A210
+
+ .global _0380A3F0
+_0380A3F0: ;0x0380A3F0
+ .space 0x0380A3F4 - 0x0380A3F0
+
+ .global _0380A3F4
+_0380A3F4: ;0x0380A3F4
+ .space 0x0380A3F8 - 0x0380A3F4
+
+ .global _0380A3F8
+_0380A3F8: ;0x0380A3F8
+ .space 0x0380A3FC - 0x0380A3F8
+
+ .global _0380A3FC
+_0380A3FC: ;0x0380A3FC
+ .space 0x0380A400 - 0x0380A3FC
+
+ .global _0380A400
+_0380A400: ;0x0380A400
+ .space 0x0380A4A4 - 0x0380A400
+
+ .global _0380A4A4
+_0380A4A4: ;0x0380A4A4
+ .space 0x0380AA64 - 0x0380A4A4
+
+ .global _0380AA64
+_0380AA64: ;0x0380AA64
+ .space 0x0380B064 - 0x0380AA64
+
+ .global _0380B064
+_0380B064: ;0x0380B064
+ .space 0x0380B764 - 0x0380B064
+
+ .global _0380B764
+_0380B764: ;0x0380B764
+ .space 0x0380B808 - 0x0380B764
+
+ .global _0380B808
+_0380B808: ;0x0380B808
+ .space 0x0380B8AC - 0x0380B808
+
+ .global _0380B8AC
+_0380B8AC: ;0x0380B8AC
+ .space 0x0380B8D8 - 0x0380B8AC
+
+ .global _0380B8D8
+_0380B8D8: ;0x0380B8D8
+ .space 0x0380B904 - 0x0380B8D8
+
+ .global _0380B904
+_0380B904: ;0x0380B904
+ .space 0x0380B92C - 0x0380B904
diff --git a/arm7/asm/ext.s b/arm7/asm/ext.s
index 070645ea..2cb1a3a5 100644
--- a/arm7/asm/ext.s
+++ b/arm7/asm/ext.s
@@ -3,18 +3,6 @@
.section .text
.balign 4, 0
- ; This file's BSS
- ; Linking of BSS is a work in progress
- .extern _06019980
- .extern _06019988
- .extern _060199A8
- .extern _060199B8
- .extern _060199D8
- .extern _060199E8
- .extern _06019A08
- .extern _0601AA88
- .extern _0601AEB4
-
arm_func_start FUN_06000000
FUN_06000000: ; 0x06000000
ldr r1, _0600002C ; =_0601A960
@@ -29589,23 +29577,32 @@ _06019958:
.word 0x00040001
.word 0x00000008
-; .section .bss
-; .balign 16, 0
-; _06019980:
-; .space 8
-; _06019988:
-; .space 32
-; _060199A8:
-; .space 16
-; _060199B8:
-; .space 32
-; _060199D8:
-; .space 16
-; _060199E8:
-; .space 32
-; _06019A08:
-; .space 16
-; _0601AA88:
-; .space 1068
-; _0601AEB4:
-; .space 92
+ .section .bss
+ .balign 16, 0
+ .global _06019960
+_06019960:
+ .space 32
+_06019980:
+ .space 8
+_06019988:
+ .space 32
+_060199A8:
+ .space 16
+_060199B8:
+ .space 32
+_060199D8:
+ .space 16
+_060199E8:
+ .space 32
+_06019A08:
+ .space 0xF58
+ .global _0601A960
+_0601A960:
+ .space 0x128
+_0601AA88:
+ .space 0x400
+ .global _0601AE88
+_0601AE88:
+ .space 0x2C
+_0601AEB4:
+ .space 60
diff --git a/arm7/asm/itcm.s b/arm7/asm/itcm.s
index 6f2996be..32f4cf3d 100644
--- a/arm7/asm/itcm.s
+++ b/arm7/asm/itcm.s
@@ -6,9 +6,9 @@
arm_func_start FUN_027E0000
FUN_027E0000: ; 0x027E0000 load at 0x023801B0
stmdb sp!, {r4, r5, r6, lr}
- ldr r6, [pc, #180] ; 0x270
- ldr r3, [pc, #180] ; 0x274
- ldr r0, [pc, #180] ; 0x278
+ ldr r6, _027E00C0 ; =0x023801B0
+ ldr r3, _027E00C4 ; =0x023A92F8
+ ldr r0, _027E00C8 ; =0x023A931C
b _027E00B0
_027E0014:
mov r2, r3
@@ -19,19 +19,19 @@ _027E0014:
ldr r1, [r2]
cmp r1, #100663296 ; 0x6000000
bne _027E00AC
- ldr r3, [pc, #144] ; 0x27c
- ldr r0, [pc, #144] ; 0x280
+ ldr r3, _027E00CC ; =0x027E00DC
+ ldr r0, _027E00D0 ; =0x0380A3F4
str r3, [r0]
add r2, r5, r4
- ldr r0, [pc, #136] ; 0x284
+ ldr r0, _027E00D4 ; =0x0380A3FC
str r2, [r0]
- ldr r1, [pc, #132] ; 0x288
+ ldr r1, _027E00D8 ; =0x027FAFCC
add r0, r3, r2
cmp r1, r0
beq _027E0060
bl FUN_037FB1F0
_027E0060:
- ldr r0, [pc, #104] ; 0x280
+ ldr r0, _027E00D0 ; =0x0380A3F4
ldr r3, [r0]
mov r2, #0
mov r1, r5, lsr #2
diff --git a/arm7/global.inc b/arm7/global.inc
index f3405bf1..9debfbf3 100644
--- a/arm7/global.inc
+++ b/arm7/global.inc
@@ -297,12 +297,12 @@
.extern _0380B064
; .ext
-.extern _060001F8
-.extern _06000204
-.extern _06000798
-.extern _060009A4
-.extern _06006978
-.extern _06008CC4
+.extern FUN_060001F8
+.extern FUN_06000204
+.extern FUN_06000798
+.extern FUN_060009A4
+.extern FUN_06006978
+.extern FUN_06008CC4
.extern _06019960
.extern _0601A960
.extern _0601AE88
diff --git a/arm7/undefined_syms.txt b/arm7/undefined_syms.txt
deleted file mode 100644
index c364f417..00000000
--- a/arm7/undefined_syms.txt
+++ /dev/null
@@ -1,186 +0,0 @@
-
-// ???
-// DTCM
-// EWRAM
-SDK_AUTOLOAD_ITCM_BSS_SIZE = 0x00000000;
-SDK_SYS_STACKSIZE = 0x00000000;
-CONST_34 = 0x00000034;
-CONST_3F = 0x0000003F;
-SDK_AUTOLOAD_ITCM_SIZE = 0x000000DC;
-SDK_IRQ_STACKSIZE = 0x00000400;
-SDK_AUTOLOAD_EXT_BSS_SIZE = 0x00001590;
-SDK_AUTOLOAD_DTCM_BSS_SIZE = 0x00004220;
-SDK_AUTOLOAD_DTCM_SIZE = 0x0000F70C;
-SDK_AUTOLOAD_EXT_SIZE = 0x00019960;
-SDK_MAIN_ARENA_LO = 0x0225FFA0;
-SDK_AUTOLOAD_LIST = 0x023A92F8;
-SDK_SECTION_ARENA_EX_START = 0x023E0000;
-SDK_AUTOLOAD_ITCM_START = 0x027E0000;
-gUnk027FFC20 = 0x027FFC20;
-SDK_AUTOLOAD_DTCM_START = 0x037F8000;
-FUN_037F90B8 = 0x037F90B8;
-FUN_037F9B68 = 0x037F9B68;
-FUN_037FB300 = 0x037FB300;
-FUN_037FB318 = 0x037FB318;
-SVC_SoftReset = 0x038010D4;
-SVC_WaitByLoop = 0x038010D8;
-SVC_WaitIntr = 0x038010DC;
-FUN_038010E6 = 0x038010E6;
-SVC_Halt = 0x038010F2;
-SVC_Stop = 0x038010F6;
-SVC_SoundBias = 0x038010FA;
-SVC_SoundBiasSet = 0x038010FE;
-SVC_SoundBiasReset = 0x03801106;
-SVC_Div = 0x0380110E;
-SVC_DivRem = 0x03801112;
-SVC_CpuSet = 0x03801118;
-SVC_CpuFastSet = 0x0380111C;
-SVC_Sqrt = 0x03801120;
-SVC_GetCRC16 = 0x03801124;
-SVC_IsDebugger = 0x03801128;
-SVC_BitUnPack = 0x0380112C;
-SVC_LZ77UnCompWram = 0x03801130;
-SVC_LZ77UnCompVramWithReadCB = 0x03801134;
-SVC_HuffUnCompWithReadCB = 0x03801138;
-SVC_RLUnCompWram = 0x0380113C;
-SVC_RLUnCompVramWithReadCB = 0x03801140;
-SVC_GetSineTable = 0x03801144;
-SVC_GetPitchTable = 0x03801148;
-SVC_GetVolumeTable = 0x0380114C;
-_0380770C = 0x0380770C;
-_03807714 = 0x03807714;
-_03807718 = 0x03807718;
-_0380771C = 0x0380771C;
-_03807744 = 0x03807744;
-_03807748 = 0x03807748;
-_0380774C = 0x0380774C;
-_03807774 = 0x03807774;
-_03807780 = 0x03807780;
-_03807784 = 0x03807784;
-_03807788 = 0x03807788;
-_0380778C = 0x0380778C;
-_03807790 = 0x03807790;
-_03807794 = 0x03807794;
-_03807798 = 0x03807798;
-_0380779C = 0x0380779C;
-_038077A0 = 0x038077A0;
-_038077AC = 0x038077AC;
-_03807850 = 0x03807850;
-_038078F4 = 0x038078F4;
-_038078F8 = 0x038078F8;
-_0380791C = 0x0380791C;
-_03807920 = 0x03807920;
-_03807924 = 0x03807924;
-_03807928 = 0x03807928;
-_03807930 = 0x03807930;
-_03807934 = 0x03807934;
-_0380793C = 0x0380793C;
-_03807940 = 0x03807940;
-_03807944 = 0x03807944;
-_03807948 = 0x03807948;
-_03807950 = 0x03807950;
-_03807954 = 0x03807954;
-_03807958 = 0x03807958;
-_0380795C = 0x0380795C;
-_038079DC = 0x038079DC;
-_038079E0 = 0x038079E0;
-_03807A0C = 0x03807A0C;
-_03807A10 = 0x03807A10;
-_03807A20 = 0x03807A20;
-_03807A30 = 0x03807A30;
-_03807A34 = 0x03807A34;
-_03807A54 = 0x03807A54;
-_03807A74 = 0x03807A74;
-_03807AA0 = 0x03807AA0;
-_03807F44 = 0x03807F44;
-_03807F48 = 0x03807F48;
-_03807F4C = 0x03807F4C;
-_03807F50 = 0x03807F50;
-_03807F58 = 0x03807F58;
-_03807F68 = 0x03807F68;
-_03807F6C = 0x03807F6C;
-_038084AC = 0x038084AC;
-_038086EC = 0x038086EC;
-_03808EEC = 0x03808EEC;
-_038090EC = 0x038090EC;
-_0380910C = 0x0380910C;
-_0380912C = 0x0380912C;
-_03809140 = 0x03809140;
-_03809188 = 0x03809188;
-_03809760 = 0x03809760;
-_03809764 = 0x03809764;
-_03809774 = 0x03809774;
-_03809780 = 0x03809780;
-_038099A0 = 0x038099A0;
-_038099A4 = 0x038099A4;
-_038099A8 = 0x038099A8;
-_038099AC = 0x038099AC;
-_038099B0 = 0x038099B0;
-_038099B8 = 0x038099B8;
-_03809C5C = 0x03809C5C;
-_03809C7C = 0x03809C7C;
-_03809CBC = 0x03809CBC;
-_03809CC0 = 0x03809CC0;
-_03809E40 = 0x03809E40;
-_03809E4C = 0x03809E4C;
-_03809E50 = 0x03809E50;
-_03809E54 = 0x03809E54;
-_03809E80 = 0x03809E80;
-_03809F28 = 0x03809F28;
-_03809F2C = 0x03809F2C;
-_03809F30 = 0x03809F30;
-_03809F34 = 0x03809F34;
-_03809F38 = 0x03809F38;
-_03809F64 = 0x03809F64;
-_03809F68 = 0x03809F68;
-_03809F6C = 0x03809F6C;
-_03809FA8 = 0x03809FA8;
-_03809FB8 = 0x03809FB8;
-_03809FBC = 0x03809FBC;
-_03809FC0 = 0x03809FC0;
-_03809FC4 = 0x03809FC4;
-_03809FC8 = 0x03809FC8;
-_03809FCC = 0x03809FCC;
-_03809FD0 = 0x03809FD0;
-_03809FD4 = 0x03809FD4;
-_03809FEC = 0x03809FEC;
-_0380A018 = 0x0380A018;
-_0380A038 = 0x0380A038;
-_0380A03C = 0x0380A03C;
-_0380A05C = 0x0380A05C;
-_0380A06C = 0x0380A06C;
-_0380A13C = 0x0380A13C;
-_0380A210 = 0x0380A210;
-_0380A3F0 = 0x0380A3F0;
-_0380A3F4 = 0x0380A3F4;
-_0380A3F8 = 0x0380A3F8;
-_0380A3FC = 0x0380A3FC;
-_0380A400 = 0x0380A400;
-_0380A4A4 = 0x0380A4A4;
-_0380AA64 = 0x0380AA64;
-_0380B064 = 0x0380B064;
-_0380B764 = 0x0380B764;
-_0380B808 = 0x0380B808;
-_0380B8AC = 0x0380B8AC;
-_0380B8D8 = 0x0380B8D8;
-_0380B904 = 0x0380B904;
-SDK_AUTOLOAD_EXT_START = 0x06000000;
-_060001F8 = 0x060001F8;
-_06000204 = 0x06000204;
-_06000798 = 0x06000798;
-_060009A4 = 0x060009A4;
-_06006978 = 0x06006978;
-_06008CC4 = 0x06008CC4;
-_06019960 = 0x06019960;
-_06019980 = 0x06019980;
-_06019988 = 0x06019988;
-_060199A8 = 0x060199A8;
-_060199B8 = 0x060199B8;
-_060199D8 = 0x060199D8;
-_060199E8 = 0x060199E8;
-_06019A08 = 0x06019A08;
-_0601A960 = 0x0601A960;
-_0601AA88 = 0x0601AA88;
-_0601AE88 = 0x0601AE88;
-_0601AEB4 = 0x0601AEB4;
-SDK_AUTOLOAD_LIST_END = SDK_AUTOLOAD_LIST + 0x24;