@@ -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 dos2unix
22
22
}
23
23
24
24
function sources_jzintv() {
@@ -28,6 +28,12 @@ function sources_jzintv() {
28
28
mv jzintv-[0-9]* jzintv
29
29
cd jzintv/src
30
30
31
+ if isPlatform " rpi" ; then
32
+ dos2unix $( find " $md_data " -iname " *.patch" -exec grep -h " ^+++" {} \+ | cut -f2- -d ' /' | uniq | xargs)
33
+ applyPatch " $md_data /01_rpi_hide_cursor_sdl2.patch"
34
+ applyPatch " $md_data /01_rpi_pillar_boxing_black_background_sdl2.patch"
35
+ fi
36
+
31
37
# Add source release date information to build
32
38
mv buildcfg/90-svn.mak buildcfg/90-svn.mak.txt
33
39
echo " SVN_REV := $( echo $md_repo_url | grep -o -P ' [\d]{8}' ) " > buildcfg/90-src_releasedate.mak
@@ -44,8 +50,13 @@ function build_jzintv() {
44
50
mkdir -p jzintv/bin
45
51
cd jzintv/src
46
52
53
+ if isPlatform " rpi" ; then
54
+ local -r extra=' EXTRA=-DPLAT_LINUX_RPI'
55
+ else
56
+ local -r extra=' '
57
+ fi
47
58
make clean
48
- DISTCC_HOSTS=" " make
59
+ DISTCC_HOSTS=" " make $extra
49
60
50
61
md_ret_require=" $md_build /jzintv/bin/jzintv"
51
62
}
@@ -63,15 +74,53 @@ function install_jzintv() {
63
74
function configure_jzintv() {
64
75
mkRomDir " intellivision"
65
76
66
- local options=(
67
- --displaysize=" %XRES%x%YRES%"
68
- --quiet
69
- --rom-path=" $biosdir "
70
- --voice=1
71
- )
77
+ local -r start_script=" $md_inst /jzintv_launcher.sh"
78
+ cat > " $start_script " << _EOF_
79
+ #! /usr/bin/env bash
80
+
81
+ # \$ 1: width of display
82
+ # \$ 2: height of display
83
+ # \$ 3: --ecs=1, optional
84
+ # \$ 4,5,6...: more optional parameters
85
+ # last parameter: %ROM%
86
+
87
+ jzintv_bin="$md_inst /bin/jzintv"
88
+
89
+ # regular case: w>=h (rotation 90/270 not supported by jzintv)
90
+ disp_w=\$ 1; shift
91
+ disp_h=\$ 1; shift
92
+
93
+ ratio="4/3"
94
+ do_pillarboxing='\$ (python3 -c "print(\$ disp_w / \$ disp_h >= \$ ratio)")'
95
+ if [[ "\$ do_pillarboxing" == "True" ]] ; then
96
+ # le/ri padding
97
+ intv_w=\$ (python3 -c "print(round(\$ disp_h * \$ ratio))")
98
+ intv_h=\$ disp_h
99
+ else
100
+ # top/btm padding (letterboxing; e.g., on 5:4 displays)
101
+ intv_w=\$ disp_w
102
+ intv_h=\$ (python3 -c "print(round(\$ disp_w / (\$ ratio)))")
103
+ fi
104
+
105
+ # set --gfx-verbose instead of --quiet for verbose output
106
+ options=(
107
+ -f1 # fullscreen
108
+ --quiet
109
+ # --gfx-verbose
110
+ --displaysize="\$ {intv_w}x\$ {intv_h}"
111
+ --rom-path="$biosdir "
112
+ --voice=1
113
+ )
114
+
115
+ echo "Launching: \$ jzintv_bin \$ {options[@]} \"\$ @\"" >> /dev/shm/runcommand.log
116
+ pushd "$romdir /intellivision" > /dev/null
117
+ \$ jzintv_bin \$ {options[@]} "\$ @"
118
+ popd
119
+ _EOF_
120
+ chown $user :$user " $start_script "
121
+ chmod u+x " $start_script "
72
122
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%"
123
+ addEmulator 1 " $md_id " " intellivision" " '$start_script ' %XRES% %YRES% %ROM%"
124
+ addEmulator 0 " $md_id -ecs" " intellivision" " '$start_script ' %XRES% %YRES% --ecs=1 %ROM%"
76
125
addSystem " intellivision"
77
126
}
0 commit comments