-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
110 lines (94 loc) · 3.47 KB
/
Copy pathbuild
File metadata and controls
110 lines (94 loc) · 3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env bash
#
# run this script from the devkitPro msys2 shell
#
# https://github.com/raicool
#
# arguments:
# clean: delete CMakeFiles folder
# nobuild: do not run cmake generation or make
# copy: copies bin/plugin.3gx to citra (environment var CITRA_DATA must be set to citra's data folder)
# run-headless: runs mariokart7 from citra.exe (environment var CITRA must be set to citra.exe's path)
# run-qt: runs mariokart7 from citra-qt.exe (environment var CITRA_QT must be set to citra-qt.exe's path)
make_ret=0
Reset='\033[0m' # Text Reset
Black='\033[0;30m' # Black
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Blue='\033[0;34m' # Blue
Purple='\033[0;35m' # Purple
Cyan='\033[0;36m' # Cyan
White='\033[0;37m' # White
if [[ "$*" = *"clean"* ]]; then
rm -rf CMakeFiles
rm -rf bin
fi
mkdir -p bin/cache
cd bin/cache
if [[ "$*" != *"nobuild"* ]]; then
${DEVKITPRO}/msys2/usr/bin/cmake.exe\
-DCMAKE_TOOLCHAIN_FILE:PATH=${DEVKITPRO}/cmake/3DS.cmake\
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=../\
-DCMAKE_BINARY_DIR=../\
-DCMAKE_MAKE_PROGRAM=${DEVKITPRO}/msys2/usr/bin/make.exe\
-DCMAKE_C_COMPILER:PATH=${DEVKITARM}/bin/arm-none-eabi-gcc.exe\
-DCMAKE_CXX_COMPILER:PATH=${DEVKITARM}/bin/arm-none-eabi-c++.exe\
-DCMAKE_ASM_COMPILER:PATH=${DEVKITARM}/bin/arm-none-eabi-gcc.exe\
../../CMakeLists.txt
make
make_ret=$?
fi
cd ../../
if [ $make_ret -ne 0 ]; then
echo -e "${Red}Last build failed.${Reset}"
exit
fi
# Create .3gx from built elf file
if [ $make_ret -eq 0 ]; then
echo -e "${Blue}Building 3gx...${Reset}"
${DEVKITPRO}/tools/bin/3gxtool.exe -s bin/ctr-plugin.elf settings.plgInfo bin/ctr-plugin.3gx
fi
if [[ "$*" = *"copy"* ]]; then
#copy plugin to citra's luma plugin path
if [[ -z "${CITRA_DATA}" ]]; then
echo -e "${Cyan}Please specify a citra appdata path, otherwise define the environment variable CITRA_DATA with the necessary path\033[0m"
read ctrdata
cp -rf bin/ctr-plugin.3gx $ctrdata/sdmc/luma/plugins/0004000000030800/
else
cp -rf bin/ctr-plugin.3gx ${CITRA_DATA}/sdmc/luma/plugins/0004000000030800/
fi
fi
if [[ "$*" = *"run-headless"* ]]; then
echo -e "${Blue}Launching citra...${Reset}"
# run citra.exe with mk7
#
# in order for the plugin to actually run from citra.exe, you must set plugin-loader to true in ${CITRA_DATA}/config/sdl2-config.ini
#
# [System]
# plugin_loader = true
#
if [[ -z "${CITRA}" ]]; then
echo -e "${Cyan}Please specify a citra.exe path, otherwise define the environment variable CITRA with the necessary path${Reset}"
read ctr
else
ctr=${CITRA}
fi
[ -z "$ctr" ] && exit
$ctr "${CITRA_DATA}/sdmc/Nintendo 3DS/00000000000000000000000000000000/00000000000000000000000000000000/title/00040000/00030800/content/00000000.app"
fi
if [[ "$*" = *"run-qt"* ]]; then
echo -e "${Blue}Launching citra-qt...${Reset}"
# run citra-qt.exe with mk7
#
# Luma3GX plugin loading must be enabled in the settings in order for the plugin to load
#
if [[ -z "${CITRA_QT}" ]]; then
echo -e "${Cyan}Please specify a citra.exe path, otherwise define the environment variable CITRA_QT with the necessary path${Reset}"
read ctr
else
ctr=${CITRA_QT}
fi
[ -z "$ctr" ] && exit
$ctr "${CITRA_DATA}/sdmc/Nintendo 3DS/00000000000000000000000000000000/00000000000000000000000000000000/title/00040000/00030800/content/00000000.app"
fi