Advmame.sh - 720p - ee_s905 check

Why is the check for ee_s905 needed here?

            if [ -f /ee_s905 ]; then
                echo "device_video_modeline 1280x720-60 91.517 1280 1440 1531 1691 720 810 812 902 +hsync +vsync" >> $CONFIG_DIR/advmame.rc
            fi

I use the s922x chip so this is gonna not work if I drop advmame too 720p. Can we just have:

-            if [ -f /ee_s905 ]; then
                echo "device_video_modeline 1280x720-60 91.517 1280 1440 1531 1691 720 810 812 902 +hsync +vsync" >> $CONFIG_DIR/advmame.rc
 -           fi

with the ee_s905 check removed? Why is it there?

It’s an old change to make the older s905 devices always use 720p as it gives (or gave, can’t really remember now) better performance. I don’t think that 720p will give any more performance with the S922x, But I have not personally tried it.

Feel free to move it from there.

Hey, also how do you get the values for 480p ? That would be a nice addition, as you know I’m not sure there is much performance gain but I’d like to try and see if there is a difference.

Not quite sure actually, I think I copied those values from Retropie… a long time ago. Maybe in the advancemame menu ?

It’s cool I found values off of net. I’ll add it and test and see how it goes.

device_video_modeline standard_720x480 15.3427 720 792 864 976 480 486 493 524 -hsync -vsync interlace

ref:
http://forum.arcadecontrols.com/index.php?topic=70233.0

Here is the changes, did you want me to make a PR?
One issue is /usr/bin/advmame.sh is used and not ~/.config/emuelec/bin from emuelecRunEmu.sh.

#!/bin/sh

# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2019-present Shanti Gilbert (https://github.com/shantigilbert)

. /etc/profile

CONFIG_DIR="/storage/.advance"
export DISPLAY=:0

if [ ! -d "$CONFIG_DIR" ]; then
 mkdir -p $CONFIG_DIR
 cp -rf /usr/share/advance/* $CONFIG_DIR/
fi

if [[ "$1" = *"roms/arcade"* ]]; then 
sed -i "s|/roms/mame|/roms/arcade|g" $CONFIG_DIR/advmame.rc
 else
sed -i "s|/roms/arcade|/roms/mame|g" $CONFIG_DIR/advmame.rc
fi 

if [ "$EE_DEVICE" != "OdroidGoAdvance" ] && [ "$EE_DEVICE" != "GameForce" ]; then
    unset DISPLAY
    MODE=`cat /sys/class/display/mode`;
    sed -i '/device_video_modeline/d' $CONFIG_DIR/advmame.rc

    case "$MODE" in
        "480p"*)
            echo "device_video_modeline 720x480 15.246 720 762 834 968 480 484 491 525 +hsync +vsync" >> $CONFIG_DIR/advmame.rc
        ;;
        "720p"*)
            echo "device_video_modeline 1280x720-60 91.517 1280 1440 1531 1691 720 810 812 902 +hsync +vsync" >> $CONFIG_DIR/advmame.rc
        ;;
        "1080p"*)
            echo "device_video_modeline 1920x1080_60.00 153.234 1920 1968 2121 2168 1080 1127 1130 1178 +hsync +vsync" >> $CONFIG_DIR/advmame.rc
        ;;
        "1280x1024p60hz"*)
            echo "device_video_modeline 1280x1024_60.00 108.88 1280 1360 1496 1712 1024 1025 1028 1060 +hsync +vsync" >> $CONFIG_DIR/advmame.rc
        ;;
        "1024x768p60hz"*)
            echo "device_video_modeline 1024x768_60.00 64.11 1024 1080 1184 1344 768 769 772 795 +hsync +vsync" >> $CONFIG_DIR/advmame.rc
        ;;
        "640x480p60hz"*)
            echo "device_video_modeline 640x480_60.00 23.86 640 656 720 800 480 481 484 497 +hsync +vsync" >> $CONFIG_DIR/advmame.rc
        ;;
    esac
fi

if [ "$EE_DEVICE" != "GameForce" ]; then
AUTOGP=$(get_ee_setting advmame_auto_gamepad)
[[ "${AUTOGP}" != "0" ]] && /usr/bin/set_advmame_joy.sh
fi

ARG=$(echo basename $1 | sed 's/\.[^.]*$//')
ARG="$(echo $1 | sed 's=.*/==;s/\.[^.]*$//')"         
SDL_AUDIODRIVER=alsa /usr/bin/advmame $ARG -quiet

oh yeah and I just noticed, when the native video gets changed via my new feature so should the resolution in advmame and retroarch.

edit:
fixed more correct 480p values.

See Pull Request: