Skip to content

Commit

Permalink
Merge pull request #518 from red031000/master
Browse files Browse the repository at this point in the history
complete scrcmd
  • Loading branch information
red031000 authored Jun 30, 2023
2 parents 33f535a + a1c421f commit fd55544
Show file tree
Hide file tree
Showing 94 changed files with 1,212 additions and 2,188 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ OBJCOPY := $(CROSS)objcopy

# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
MWASFLAGS = -proc arm5te
MWCFLAGS = -O4,p -gccext,on -proc arm946e -msgstyle gcc -gccinc -ipa file -fp soft -lang c99 -Cpp_exceptions off -i include -ir include-mw -ir arm9/lib/libc/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -interworking -DFS_IMPLEMENT -enum int -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error
MWCFLAGS = -O4,p -gccext,on -proc arm946e -msgstyle gcc -gccinc -ipa file -fp soft -lang c99 -Cpp_exceptions off -inline on,noauto -i include -ir include-mw -ir arm9/lib/MSL_C/include -ir arm9/lib/libnns/include -ir arm9/lib/NitroSDK/include -interworking -DFS_IMPLEMENT -enum int -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error
MWLDFLAGS = -map -nodead -w off -proc v5te -interworking -map -symtab -m _start -msgstyle gcc

####################### Other Tools #########################
Expand Down Expand Up @@ -132,7 +132,7 @@ TOOLS = $(foreach tool,$(TOOLBASE),$(TOOLS_DIR)/$(tool)/$(tool)$(EXE))
TOOLS: tools

export LM_LICENSE_FILE := $(TOOLS_DIR)/mwccarm/license.dat
export MWCIncludes := arm9/lib/libc/include arm9/lib/NitroSDK/include arm9/lib/libnns/include
export MWCIncludes := arm9/lib/MSL_C/include arm9/lib/NitroSDK/include arm9/lib/libnns/include
export MWLibraries := arm9/lib

######################### Targets ###########################
Expand Down Expand Up @@ -199,7 +199,7 @@ patch_mwasmarm: tools/mwasmarm_patcher
ALL_DIRS := $(BUILD_DIR)

ifeq (,$(NODEP))
$(BUILD_DIR)/%.o: dep = $(shell $(SCANINC) -I include -I include-mw -I arm9/lib/libc/include -I arm9/lib/libnns/include -I arm9/lib/NitroSDK/include $(filter $*.c,$(C_FILES)) $(filter $*.cpp,$(CXX_FILES)) $(filter $*.s,$(S_FILES)))
$(BUILD_DIR)/%.o: dep = $(shell $(SCANINC) -I include -I include-mw -I arm9/lib/MSL_C/include -I arm9/lib/libnns/include -I arm9/lib/NitroSDK/include $(filter $*.c,$(C_FILES)) $(filter $*.cpp,$(CXX_FILES)) $(filter $*.s,$(S_FILES)))
else
$(BUILD_DIR)/%.o: dep :=
endif
Expand Down
2 changes: 1 addition & 1 deletion arm7/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ OBJCOPY := $(CROSS)objcopy

# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm7_thumb.s -o arm7.o
MWASFLAGS = -proc arm4t -i ..
MWCFLAGS = -O4,s -proc arm7tdmi -msgstyle gcc -gccinc -fp soft -lang c99 -Cpp_exceptions off -i ../include -ir ../include-mw -ir lib/include -interworking -DFS_IMPLEMENT -enum int -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error
MWCFLAGS = -O4,s -proc arm7tdmi -msgstyle gcc -gccinc -fp soft -lang c99 -Cpp_exceptions off -inline on,noauto -i ../include -ir ../include-mw -ir lib/include -interworking -DFS_IMPLEMENT -enum int -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error
MWLDFLAGS = -map -nodead -w off -proc v4t -interworking -map -symtab -m _start -msgstyle gcc

####################### Other Tools #########################
Expand Down
2 changes: 1 addition & 1 deletion arm9/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ file(GLOB_RECURSE SOURCES "*.c" "*.cpp" "*.s")
file(GLOB OVERLAY_INC overlays/*/include)

add_executable(DP_Arm9 ${SOURCES})
target_include_directories(DP_Arm9 PRIVATE ../include ../include-mw lib/NitroSDK/include lib/libc/include lib/libnns/include ${OVERLAY_INC} ../files)
target_include_directories(DP_Arm9 PRIVATE ../include ../include-mw lib/NitroSDK/include lib/MSL_C/include lib/libnns/include ${OVERLAY_INC} ../files)
target_compile_definitions(DP_Arm9 PUBLIC __CLION_IDE__)
18 changes: 9 additions & 9 deletions arm9/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ LD_TEMPLATE := ARM9-TS.lcf.template
# Directories containing source files

# sorting wildcards required for versions of make >= 3.8.2 and < 4.3 for consistent builds
SRC_DIRS := src lib lib/libnns/src lib/NitroSDK/src lib/libc/src $(sort $(wildcard overlays/*/src))
SRC_DIRS := src lib lib/libnns/src lib/NitroSDK/src lib/MSL_C/src $(sort $(wildcard overlays/*/src))
ASM_DIRS := asm data files $(sort $(wildcard overlays/*/asm))
LIBASM_DIRS := lib/syscall
INCLUDE_RECURSIVE_DIRS := ../include-mw lib/libc/include lib/libnns/include lib/NitroSDK/include
INCLUDE_RECURSIVE_DIRS := ../include-mw lib/MSL_C/include lib/libnns/include lib/NitroSDK/include
INCLUDE_DIRS := ../include $(sort $(wildcard overlays/*/include)) ../files

C_FILES := $(foreach dir,$(SRC_DIRS),$(sort $(wildcard $(dir)/*.c)))
Expand Down Expand Up @@ -117,8 +117,8 @@ ASM_PROCESSOR := $(ASM_PROCESSOR_DIR)/compile.sh

# ./tools/mwccarm/2.0/base/mwasmarm.exe -proc arm5te asm/arm9_thumb.s -o arm9.o
MWASFLAGS = -proc arm5te -i ../include -i .. -D$(GAME_VERSION) -D$(GAME_LANGUAGE)
MWCFLAGS = -O4,p -gccext,on -proc arm946e -msgstyle gcc -gccinc -ipa file -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 -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error
MWCXXFLAGS = -O4,p -proc arm946e -msgstyle gcc -gccinc -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 -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error
MWCFLAGS = -O4,p -gccext,on -proc arm946e -msgstyle gcc -gccinc -ipa file -fp soft -lang c99 -Cpp_exceptions off -inline on,noauto $(foreach dir,$(INCLUDE_DIRS),-i $(dir)) $(foreach dir,$(INCLUDE_RECURSIVE_DIRS),-ir $(dir)) -interworking -DFS_IMPLEMENT -enum int -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error
MWCXXFLAGS = -O4,p -proc arm946e -msgstyle gcc -gccinc -fp soft -lang c99 -Cpp_exceptions off -inline on,noauto $(foreach dir,$(INCLUDE_DIRS),-i $(dir)) $(foreach dir,$(INCLUDE_RECURSIVE_DIRS),-ir $(dir)) -interworking -DFS_IMPLEMENT -enum int -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error
MWLDFLAGS = -w off -proc v5te -interworking -map closure,unused -symtab sort -m _start -msgstyle gcc
LIBS := -Llib -lsyscall
ARFLAGS = rcS
Expand Down Expand Up @@ -149,7 +149,7 @@ TOOLS = $(foreach tool,$(TOOLBASE),$(TOOLS_DIR)/$(tool)/$(tool)$(EXE))
TOOLS: tools

export LM_LICENSE_FILE := $(TOOLS_DIR)/mwccarm/license.dat
export MWCIncludes := $(CURDIR)/lib/libc/include $(CURDIR)/lib/NitroSDK/include $(CURDIR)/lib/libnns/include
export MWCIncludes := $(CURDIR)/lib/MSL_C/include $(CURDIR)/lib/NitroSDK/include $(CURDIR)/lib/libnns/include
export MWLibraries := $(CURDIR)/lib

######################### Targets ###########################
Expand Down Expand Up @@ -204,16 +204,16 @@ ALL_DIRS := $(BUILD_DIR) $(addprefix $(BUILD_DIR)/,$(SRC_DIRS) $(ASM_DIRS) $(LIB

# TODO: Move out to lib/Makefile
$(BUILD_DIR)/lib/%.o: MWCCVERSION = 1.2/sp2p3
$(BUILD_DIR)/lib/%.o: MWCFLAGS = -O4,p -gccext,on -proc arm946e -msgstyle gcc -gccinc -fp soft -lang c99 -Cpp_exceptions off -i ../include -ir ../include-mw -ir lib/libc/include -ir lib/libnns/include -ir lib/NitroSDK/include -interworking -DFS_IMPLEMENT -enum int -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error
$(BUILD_DIR)/lib/%.o: MWCFLAGS = -O4,p -gccext,on -proc arm946e -msgstyle gcc -gccinc -fp soft -lang c99 -Cpp_exceptions off -inline on,noauto -i ../include -ir ../include-mw -ir lib/MSL_C/include -ir lib/libnns/include -ir lib/NitroSDK/include -interworking -DFS_IMPLEMENT -enum int -D$(GAME_VERSION) -D$(GAME_LANGUAGE) -W all -W pedantic -W noimpl_signedunsigned -W noimplicitconv -W nounusedarg -W nomissingreturn -W error

$(BUILD_DIR)/lib/libnns/%.o: MWCCVERSION = 1.2/sp3
$(BUILD_DIR)/lib/libc/%.o: MWCCVERSION = 2.0/sp1
$(BUILD_DIR)/lib/libc/%.o: MWCFLAGS += -ipa file
$(BUILD_DIR)/lib/MSL_C/%.o: MWCCVERSION = 2.0/sp1
$(BUILD_DIR)/lib/MSL_C/%.o: MWCFLAGS += -ipa file

####################### Everything Else ######################

ifeq (,$(NODEP))
$(BUILD_DIR)/%.o: dep = $(shell $(SCANINC) -I ../include -I ../include-mw -I lib/libc/include -I lib/libnns/include -I lib/NitroSDK/include $(filter $*.c,$(C_FILES)) $(filter $*.cpp,$(CXX_FILES)) $(filter $*.s,$(S_FILES)) $(filter $*.s,$(LIBS_FILES)))
$(BUILD_DIR)/%.o: dep = $(shell $(SCANINC) -I ../include -I ../include-mw -I lib/MSL_C/include -I lib/libnns/include -I lib/NitroSDK/include $(filter $*.c,$(C_FILES)) $(filter $*.cpp,$(CXX_FILES)) $(filter $*.s,$(S_FILES)) $(filter $*.s,$(LIBS_FILES)))
else
$(BUILD_DIR)/%.o: dep :=
endif
Expand Down
7 changes: 3 additions & 4 deletions arm9/arm9.lsf
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Static arm9
Object unk_02022504.o
Object save.o
Object save_arrays.o
Object sav_system_info.o
Object save_system_info.o
Object player_data.o
Object unk_02023AC4.o
Object daycare.o
Expand Down Expand Up @@ -157,7 +157,6 @@ Static arm9
Object script.o
Object unk_02038C78.o
Object scrcmd.o
Object scrcmd_asm.o
Object scrcmd_mart.o
Object scrcmd_3.o
Object scrcmd_names.o
Expand Down Expand Up @@ -551,7 +550,7 @@ Static arm9
Object MSL_ARM_critical_regions_NITRO.o
Object MSL_ARM_math.o
Object MSL_Common_ansi_files.o
Object MSL_Common_arith.o
Object arith.o
Object MSL_Common_assert.o
Object MSL_Common_buffer_io.o
Object MSL_Common_ctype.o
Expand All @@ -565,7 +564,7 @@ Static arm9
Object MSL_Common_mem_funcs.o
Object MSL_Common_printf.o
Object MSL_Common_qsort.o
Object MSL_Common_rand.o
Object rand.o
Object MSL_Common_scanf.o
Object MSL_Common_signal.o
Object MSL_Common_string.o
Expand Down
Loading

0 comments on commit fd55544

Please sign in to comment.