Does attract mode load the romlist after return from game? If so, you could use a plugin that will modify the romlist during to game transition, all in squirrel.
yeah i do that but with a shell script, here is the script
first you need to add this code in your theme, remember to register it like a callback function
function on_transition( ttype, var, ttime )
{
switch ( ttype )
{
case Transition.ToGame:
fe.plugin_command_bg( "/home/pi/.attract/runcommand-lastplayed.sh", "\"" + fe.game_info(Info.Name) + ";" + fe.game_info(Info.Title) + ";" + fe.game_info(Info.Emulator) + "\"" );
break;
}
and here the shell script
#!/usr/bin/env bash
# get the args
args="$1"
IFS=';' read -r -a array <<< "$args"
filename="/home/pi/.attract/romlists/Last Played Games.txt"
NUMOFLINES=$(wc -l < "$filename")
$(grep -q "${array[0]};${array[1]};${array[2]};;;;;;;;;;;;;;" "$filename")
if [ $? -eq 1 ]; then
if [ $NUMOFLINES -lt 11 ]; then
sed -i -e '$a\'"${array[0]};${array[1]};${array[2]};;;;;;;;;;;;;;" "$filename"
else
sed -i '2d' "$filename"
sed -i -e '$a\'"${array[0]};${array[1]};${array[2]};;;;;;;;;;;;;;" "$filename"
fi
fi
you can modify this line
if [ $NUMOFLINES -lt 11 ]; then
with any number you want if you want the last 20, put 21, because you need always 1 line in your romlist, the sed command doesnt work in empty files.