@@ -229,6 +229,7 @@ function build_mupen64plus() {
229
229
}
230
230
231
231
function install_mupen64plus() {
232
+ local source
232
233
for source in * ; do
233
234
if [[ -f " $source /projects/unix/Makefile" ]]; then
234
235
# optflags is needed due to the fact the core seems to rebuild 2 files and relink during install stage most likely due to a buggy makefile
@@ -316,11 +317,20 @@ function configure_mupen64plus() {
316
317
local config=" $md_conf_root /n64/mupen64plus.cfg"
317
318
local cmd=" $md_inst /bin/mupen64plus --configdir $md_conf_root /n64 --datadir $md_conf_root /n64"
318
319
320
+ # extract the previously saved GLideN64 config version
321
+ local gliden64_ver=$( < " $md_inst /share/mupen64plus/GLideN64_config_version.ini" )
322
+
319
323
# if the user has an existing mupen64plus config we back it up, generate a new configuration
320
324
# copy that to rp-dist and put the original config back again. We then make any ini changes
321
325
# on the rp-dist file. This preserves any user configs from modification and allows us to have
322
326
# a default config for reference
323
327
if [[ -f " $config " ]]; then
328
+ # make sure we always update configVersion for GLideN64 in the existing config
329
+ if grep -q " configVersion" " $config " ; then
330
+ iniConfig " = " " " " $config "
331
+ iniSet " configVersion" " $gliden64_ver "
332
+ fi
333
+
324
334
mv " $config " " $config .user"
325
335
su " $user " -c " $cmd "
326
336
mv " $config " " $config .rp-dist"
@@ -330,29 +340,35 @@ function configure_mupen64plus() {
330
340
su " $user " -c " $cmd "
331
341
fi
332
342
343
+ iniConfig " = " " " " $config "
333
344
# RPI main/GLideN64 settings
334
345
if isPlatform " rpi" ; then
335
- iniConfig " = " " " " $config "
336
346
# VSync is mandatory for good performance on KMS
337
347
if isPlatform " kms" ; then
338
348
if ! grep -q " \[Video-General\]" " $config " ; then
339
349
echo " [Video-General]" >> " $config "
340
350
fi
341
351
iniSet " VerticalSync" " True"
342
352
fi
343
- # Create GlideN64 section in .cfg
344
- if ! grep -q " \[Video-GLideN64\]" " $config " ; then
345
- echo " [Video-GLideN64]" >> " $config "
346
- fi
347
- # Settings version. Don't touch it.
348
- iniSet " configVersion" " 29"
353
+ fi
354
+
355
+ # Create GlideN64 section in .cfg
356
+ if ! grep -q " \[Video-GLideN64\]" " $config " ; then
357
+ echo " [Video-GLideN64]" >> " $config "
358
+ fi
359
+ # Settings version
360
+ iniSet " configVersion" " $gliden64_ver "
361
+ # Use native res
362
+ iniSet " UseNativeResolutionFactor" " 1"
363
+ # Enable legacy blending
364
+ iniSet " EnableLegacyBlending" " True"
365
+ # Use high resolution texture packs if available.
366
+ iniSet " txHiresEnable" " True"
367
+
368
+ if isPlatform " rpi" ; then
349
369
# Bilinear filtering mode (0=N64 3point, 1=standard)
350
370
iniSet " bilinearMode" " 1"
351
371
iniSet " EnableFBEmulation" " True"
352
- # Use native res
353
- iniSet " UseNativeResolutionFactor" " 1"
354
- # Enable legacy blending
355
- iniSet " EnableLegacyBlending" " True"
356
372
# Enable Threaded GL calls
357
373
iniSet " ThreadedVideo" " True"
358
374
# Swap frame buffers On buffer update (most performant)
@@ -361,32 +377,41 @@ function configure_mupen64plus() {
361
377
iniSet " EnableHybridFilter" " False"
362
378
# Use fast but less accurate shaders. Can help with low-end GPUs.
363
379
iniSet " EnableInaccurateTextureCoordinates" " True"
380
+ fi
364
381
365
- if isPlatform " videocore" ; then
366
- # Disable gles2n64 autores feature and use dispmanx upscaling
367
- iniConfig " =" " " " $md_conf_root /n64/gles2n64.conf"
368
- iniSet " auto resolution" " 0"
382
+ # Create Video-Rice section in .cfg
383
+ if ! grep -q " \[Video-Rice\]" " $config " ; then
384
+ echo " [Video-Rice]" >> " $config "
385
+ fi
386
+ iniSet " LoadHiResTextures" " True"
369
387
388
+ if isPlatform " rpi" && isPlatform " mesa" ; then
389
+ # Fix flickering and black screen issues with rice video plugin
390
+ iniSet " ScreenUpdateSetting" " 7"
391
+ fi
392
+
393
+ # gles2n64.conf
394
+ if isPlatform " videocore" ; then
395
+ # Disable gles2n64 autores feature and use dispmanx upscaling
396
+ iniConfig " =" " " " $md_conf_root /n64/gles2n64.conf"
397
+ iniSet " auto resolution" " 0"
398
+ fi
399
+
400
+ addAutoConf mupen64plus_audio 0
401
+ addAutoConf mupen64plus_compatibility_check 0
402
+ addAutoConf mupen64plus_hotkeys 1
403
+ addAutoConf mupen64plus_texture_packs 1
404
+
405
+ # force autoconf.ini values for rpi
406
+ if isPlatform " rpi" ; then
407
+ if isPlatform " videocore" ; then
370
408
setAutoConf mupen64plus_audio 1
371
409
setAutoConf mupen64plus_compatibility_check 1
372
- elif isPlatform " mesa" ; then
373
- # Create Video-Rice section in .cfg
374
- if ! grep -q " \[Video-Rice\]" " $config " ; then
375
- echo " [Video-Rice]" >> " $config "
376
- fi
377
- # Fix flickering and black screen issues with rice video plugin
378
- iniSet " ScreenUpdateSetting" " 7"
379
-
410
+ else
380
411
setAutoConf mupen64plus_audio 0
381
412
setAutoConf mupen64plus_compatibility_check 0
382
413
fi
383
- else
384
- addAutoConf mupen64plus_audio 0
385
- addAutoConf mupen64plus_compatibility_check 0
386
414
fi
387
415
388
- addAutoConf mupen64plus_hotkeys 1
389
- addAutoConf mupen64plus_texture_packs 1
390
-
391
416
chown -R $user :$user " $md_conf_root /n64"
392
417
}
0 commit comments