diff options
-rw-r--r-- | arm9/Makefile | 6 | ||||
-rw-r--r-- | arm9/arm9.lsf | 1 | ||||
-rw-r--r-- | arm9/modules/63/asm/mod63_021DB450_asm.s (renamed from arm9/modules/63/asm/mod63_021DB450.s) | 21 | ||||
-rw-r--r-- | arm9/modules/63/include/mod63_021DB450.h | 8 | ||||
-rw-r--r-- | arm9/modules/63/src/mod63_021DB450.c | 13 |
5 files changed, 27 insertions, 22 deletions
diff --git a/arm9/Makefile b/arm9/Makefile index 42228747..d537fbd7 100644 --- a/arm9/Makefile +++ b/arm9/Makefile @@ -53,6 +53,8 @@ LD_TEMPLATE := ARM9-TS.lcf.template SRC_DIRS := src lib lib/src $(sort $(wildcard modules/*/src)) ASM_DIRS := asm data files $(sort $(wildcard modules/*/asm)) LIBASM_DIRS := lib/syscall +INCLUDE_RECURSIVE_DIRS := ../include-mw lib/include +INCLUDE_DIRS := ../include $(sort $(wildcard modules/*/include)) C_FILES := $(foreach dir,$(SRC_DIRS),$(sort $(wildcard $(dir)/*.c))) CXX_FILES := $(foreach dir,$(SRC_DIRS),$(sort $(wildcard $(dir)/*.cpp))) @@ -102,8 +104,8 @@ OBJCOPY := $(CROSS)objcopy # ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o ASFLAGS = -proc arm5te -i ../include -i .. -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -CFLAGS = -O4,p -gccext,on -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i ../include -ir ../include-mw -ir lib/include -interworking -DFS_IMPLEMENT -enum int -W all -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -CXXFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off -i ../include -ir ../include-mw -ir lib/include -interworking -DFS_IMPLEMENT -enum int -W all -D$(GAME_VERSION) -D$(GAME_LANGUAGE) +CFLAGS = -O4,p -gccext,on -proc arm946e -fp soft -lang c99 -Cpp_exceptions off $(foreach dir,$(INCLUDE_DIRS),-i $(dir)) $(foreach dir,$(INCLUDE_RECURSIVE_DIRS),-ir $(dir)) -interworking -DFS_IMPLEMENT -enum int -W all -D$(GAME_VERSION) -D$(GAME_LANGUAGE) +CXXFLAGS = -O4,p -proc arm946e -fp soft -lang c99 -Cpp_exceptions off $(foreach dir,$(INCLUDE_DIRS),-i $(dir)) $(foreach dir,$(INCLUDE_RECURSIVE_DIRS),-ir $(dir)) -interworking -DFS_IMPLEMENT -enum int -W all -D$(GAME_VERSION) -D$(GAME_LANGUAGE) LDFLAGS = -nodead -w off -proc v5te -interworking -map closure,unused -symtab sort -m _start LIBS := -Llib -lsyscall ARFLAGS = rcS diff --git a/arm9/arm9.lsf b/arm9/arm9.lsf index 27d530ed..225d62cf 100644 --- a/arm9/arm9.lsf +++ b/arm9/arm9.lsf @@ -946,6 +946,7 @@ Overlay MODULE_63 Object mod63_021DA640.o Object mod63_021DAE5C.o Object mod63_021DB450.o + Object mod63_021DB450_asm.o } Overlay MODULE_64 diff --git a/arm9/modules/63/asm/mod63_021DB450.s b/arm9/modules/63/asm/mod63_021DB450_asm.s index d93aa5ac..044b2799 100644 --- a/arm9/modules/63/asm/mod63_021DB450.s +++ b/arm9/modules/63/asm/mod63_021DB450_asm.s @@ -1,27 +1,8 @@ .include "asm/macros.inc" .include "global.inc" .section .text - .balign 4, 0 - thumb_func_start MOD63_021DB450 -MOD63_021DB450: ; 0x021DB450 - push {r4, lr} - ldr r3, _021DB470 ; =UNK_021064B8 - mov r2, #0 - ldr r3, [r3] - blx r3 - add r4, r0, #0 - bl FUN_0201327C - cmp r4, #0 - bne _021DB468 - bl ErrorHandling -_021DB468: - lsl r0, r4, #0x10 - lsr r0, r0, #0xd - pop {r4, pc} - nop -_021DB470: .word UNK_021064B8 - thumb_func_end MOD63_021DB450 + .extern MOD63_021DB450 thumb_func_start MOD63_021DB474 MOD63_021DB474: ; 0x021DB474 diff --git a/arm9/modules/63/include/mod63_021DB450.h b/arm9/modules/63/include/mod63_021DB450.h new file mode 100644 index 00000000..df4c6c9e --- /dev/null +++ b/arm9/modules/63/include/mod63_021DB450.h @@ -0,0 +1,8 @@ +#ifndef POKEDIAMOND_MOD63_021DB450_H +#define POKEDIAMOND_MOD63_021DB450_H + +#include "global.h" + +u32 MOD63_021DB450(u32 param0, u32 param1); + +#endif //POKEDIAMOND_MOD63_021DB450_H diff --git a/arm9/modules/63/src/mod63_021DB450.c b/arm9/modules/63/src/mod63_021DB450.c new file mode 100644 index 00000000..d2ce9ef4 --- /dev/null +++ b/arm9/modules/63/src/mod63_021DB450.c @@ -0,0 +1,13 @@ +#include "global.h" +#include "mod63_021DB450.h" + +extern u32 (*UNK_021064B8)(u32 param0, u32 param1, u32 param2); +extern void FUN_0201327C(u32 param0); + +THUMB_FUNC u32 MOD63_021DB450(u32 param0, u32 param1) +{ + u32 res0 = (UNK_021064B8)(param0, param1, 0); + FUN_0201327C(res0); + GF_ASSERT(res0); + return (u32)((u16)res0 * 8); +} |