@@ -18,7 +18,7 @@ rp_module_section="opt"
18
18
rp_module_flags=" sdl2"
19
19
20
20
function depends_jzintv() {
21
- getDepends libsdl2-dev libreadline-dev
21
+ getDepends libsdl2-dev libreadline-dev flip
22
22
}
23
23
24
24
function sources_jzintv() {
@@ -27,6 +27,14 @@ function sources_jzintv() {
27
27
# jzintv-YYYYMMDD/ --> jzintv/
28
28
mv jzintv-[0-9]* jzintv
29
29
cd jzintv/src
30
+ # archive files have CRLF linendings, patch has CR only
31
+ find . -type f \( -iname " *.c" -o -iname " *.h" \) -exec flip -u {} \+
32
+
33
+ if isPlatform " rpi" ; then
34
+ # https://retropie.org.uk/forum/topic/32433/jzintv-has-black-border-or-full-screen-color
35
+ applyPatch " $md_data /01_rpi_hide_cursor_sdl2.patch"
36
+ applyPatch " $md_data /01_rpi_pillar_boxing_black_background_sdl2.patch"
37
+ fi
30
38
31
39
# Add source release date information to build
32
40
mv buildcfg/90-svn.mak buildcfg/90-svn.mak.txt
@@ -44,8 +52,9 @@ function build_jzintv() {
44
52
mkdir -p jzintv/bin
45
53
cd jzintv/src
46
54
55
+ isPlatform " rpi" && local extra=' EXTRA=-DPLAT_LINUX_RPI'
47
56
make clean
48
- DISTCC_HOSTS=" " make
57
+ DISTCC_HOSTS=" " make $extra
49
58
50
59
md_ret_require=" $md_build /jzintv/bin/jzintv"
51
60
}
@@ -61,17 +70,60 @@ function install_jzintv() {
61
70
}
62
71
63
72
function configure_jzintv() {
64
- mkRomDir " intellivision"
73
+ local -r system=" intellivision"
74
+ mkRomDir $system
65
75
66
- local options=(
67
- --displaysize=" %XRES%x%YRES%"
68
- --quiet
69
- --rom-path=" $biosdir "
70
- --voice=1
71
- )
76
+ local start_script=" $md_inst /jzintv_launcher.sh"
77
+ cat > " $start_script " << _EOF_
78
+ #! /usr/bin/env bash
79
+
80
+ # \$ 1: width of display
81
+ # \$ 2: height of display
82
+ # \$ 3: --ecs=1, optional
83
+ # \$ 4,5,6...: more optional parameters
84
+ # last parameter: %ROM%
85
+
86
+ jzintv_bin="$md_inst /bin/jzintv"
87
+
88
+ disp_w=\$ 1; shift
89
+ disp_h=\$ 1; shift
90
+
91
+ min=\$ (( \$ disp_w < \$ disp_h ? \$ disp_w : \$ disp_h ))
92
+ if [[ \$ min = \$ disp_h ]] ; then
93
+ intv_w=\$ (echo \$ min | awk '{ printf "%0.f\n", \$ 0 * 1.3333 + .5 }')
94
+ intv_h=\$ min
95
+ else
96
+ # 90/270 rotated displays
97
+ intv_w=\$ min
98
+ intv_h=\$ (echo \$ min | awk '{ printf "%0.f\n", \$ 0 / 1.3333 }')
99
+ fi
100
+
101
+ # set --gfx-verbose instead of --quiet for verbose output
102
+ options=(
103
+ -f1 # fullscreen
104
+ --quiet
105
+ # --gfx-verbose
106
+ --displaysize="\$ {intv_w}x\$ {intv_h}"
107
+ --rom-path="$biosdir "
108
+ --voice=1
109
+ )
110
+
111
+ # ingest additional options
112
+ while [[ \$ # -gt 1 ]] ; do
113
+ options+=(\$ 1); shift
114
+ done
115
+
116
+ rom=\$ 1
117
+ echo "Launching: \$ jzintv_bin \$ {options[*]} \"\$ rom\"" >> /dev/shm/runcommand.log
118
+
119
+ pushd "$romdir /$system " > /dev/null
120
+ \$ jzintv_bin \$ {options[*]} "\$ rom"
121
+ popd
122
+ _EOF_
123
+ chown $user :$user " $start_script "
124
+ chmod u+x " $start_script "
72
125
73
- addEmulator 1 " $md_id " " intellivision" " $md_inst /bin/jzintv ${options[*]} %ROM%"
74
- options+=(--ecs=1)
75
- addEmulator 0 " ${md_id} -ecs" " intellivision" " $md_inst /bin/jzintv ${options[*]} %ROM%"
76
- addSystem " intellivision"
126
+ addEmulator 1 " $md_id " " $system " " bash '$start_script ' %XRES% %YRES% %ROM%"
127
+ addEmulator 0 " $md_id -ecs" " $system " " bash '$start_script ' %XRES% %YRES% --ecs=1 %ROM%"
128
+ addSystem " $system "
77
129
}
0 commit comments