-
Notifications
You must be signed in to change notification settings - Fork 2
/
.bashrc.extern
96 lines (72 loc) · 2.23 KB
/
.bashrc.extern
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
function pwk {
curl -s "${1}" | git am -3
}
function sensors {
local node="/sys/class/thermal/thermal_zone0"
if [ -e $node ]; then
local type=$(cat $node/type)
local temp=$(cat $node/temp)
local degree=$(echo "scale=2; ${temp} / 1000" | bc)
echo "${type}: ${degree} degree (celsius)"
fi
}
function kmake {
local numthreads=5
if [ -n "${1}" ]; then
make "${1}"
fi
make -j $numthreads
}
# Run a git fsck on all repositories in the home directory.
function git_fsck_all {
find "${HOME}" -type d -name .git | while read gitdir; do
echo "info: git fsck in \"${gitdir}\""
GIT_DIR="${gitdir}" git fsck
done
}
function exynos_test {
local modetest="${HOME}"/sourcecode/video/drm/tests/modetest/modetest
local retroarch="${HOME}"/local/bin/retroarch # "${HOME}"/sourcecode/emu/rarch/RetroArch/retroarch
local libpath="${HOME}"/sourcecode/video/drm/exynos/.libs:"${HOME}"/local/lib # "${HOME}"/local/lib
local config content isretro usegdb
isretro=0
usegdb=0
case "${1}" in
"--vp" )
$modetest -M exynos -s 23@21:1920x1080@AR24 -P 21:640x480+128+128@NV12 -P 21:640x480+1024+128@RG16 ;;
"--drm" )
$modetest -M exynos -s 23@21:1920x1080@XR24 -P 21:640x480+1024+128@RG16 ;;
"--retro" )
isretro=1 ;;
* )
echo "Usage: ${FUNCNAME} --vp|--drm|--retro"
return 1
esac
[[ $isretro -ne 1 ]] && return 0
while true; do
shift
[[ -z "${1}" ]] && break
case "${1}" in
"--psx" )
config="${HOME}"/local/pcsx.libretro
content="${HOME}"/emulation/psx/cdimages/Parasite.Eve.US.NTSC.Disc1.img ;;
"--snes" )
config="${HOME}"/local/snes9x.libretro
content="${HOME}"/emulation/snes/roms/"Seiken Densetsu 3 (English) (Translated).sfc" ;;
"--gdb" )
usegdb=1 ;;
* )
echo "Usage: ${FUNCNAME} --retro --psx|--snes [--gdb]"
return 2
esac
done
if [[ -z "${config}" ]] || [[ -z "${content}" ]]; then
echo "error: missing config or content for RetroArch test"
return 3
fi
if [ $usegdb -eq 1 ]; then
LD_LIBRARY_PATH=$libpath gdb --args "${retroarch}" -v -c "${config}" "${content}"
else
LD_LIBRARY_PATH=$libpath "${retroarch}" -v -c "${config}" "${content}"
fi
}