Author Topic: How do I add PCSX2 to Attract Mode  (Read 1468 times)

Sea Monkey

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: How do I add PCSX2 to Attract Mode
« Reply #15 on: March 14, 2020, 08:20:58 AM »
here

Compiling of psisotool failed in Mint 19.3, but if I could get the script to simply use the .gz filename as the folder name for the config, that would be fine.  That was actually my initial plan anyhow.

https://pastebin.com/i28yjYx4
« Last Edit: March 14, 2020, 08:24:03 AM by Sea Monkey »

Sea Monkey

  • Jr. Member
  • **
  • Posts: 10
    • View Profile
Re: How do I add PCSX2 to Attract Mode
« Reply #16 on: March 14, 2020, 07:51:28 PM »
Here's what I cobbled together.  attract must be launched via terminal to work correctly with this script.

Code: [Select]
#!/bin/bash
## This script makes it possible to use individual per game configuration files for PCSX2.
## Make sure your default PCSX2_ui.ini has Slot1_Filename set to default.ps2.
## This script only seems to work correctly with Attract Mode when attract is launched via terminal.
## Works with PCSX2 1.5.0.
## Credit to parasven for the RetroPie script that was the basis for this.

pcsx2_ini="$HOME/.config/PCSX2/PCSX2-reg.ini"
game_configpath="$HOME/.config/PCSX2/game_configs"
memcardpath="$HOME/.config/PCSX2/memcards"
pcsx2_config_default="$HOME/.config/PCSX2/inis"
fullfilename=$1
filename=$(basename "$fullfilename")
title_id="${filename%.*}"
memcard="$title_id.ps2"

## If no parameter was passed, set default path and exit.
if [[ ! $1 ]]
then
        ## Exchange the configpath
        sed -i s@"^SettingsFolder=.*"@"SettingsFolder=\"$pcsx2_config_default\""@g "$pcsx2_ini"
        exit
fi

## When the config folder does not exist, create it and copy over the default inis from the default ini folder.
if [[ ! -e "$game_configpath/$title_id"  ]]
then
        ## Create folder based on the filename of the game.
        mkdir -p "$game_configpath/$title_id/"
        ## Copy over the default inis from default directory for a start.
        cp -a "$pcsx2_config_default"/*.ini "$game_configpath/$title_id/"
fi

## If game-specific memory card does not exist, then create it using blank default.
if [[ ! -e "$memcardpath/$memcard"  ]]
then
        ## Copy default memcard
        cp "$memcardpath"/default.ps2 "$memcardpath/$memcard"
fi

echo "memcard = $memcard"

# Load relevant memory card.
sed -i "s|default.ps2|$memcard|g" "$game_configpath/$title_id/"PCSX2_ui.ini

# Launch PCSX2 using the relevant config folder.
/usr/games/PCSX2 --fullscreen --fullboot --cfgpath="$game_configpath/$title_id" "$1" &

# Close PCSX2 when Attract Mode's 'Exit Emulator' hotkey is pressed. 
cleanup() {
        echo "Caugh Signal ... terminating PCSX2."
        pkill PCSX2
        exit
}
trap cleanup INT TERM
read var
cleanup
« Last Edit: March 20, 2020, 07:21:06 PM by Sea Monkey »

markoattract

  • Full Member
  • ***
  • Posts: 30
    • View Profile
Re: How do I add PCSX2 to Attract Mode
« Reply #17 on: April 24, 2020, 05:54:42 PM »
Hello all guys !!

I having some troubles running PS2 games on Attract Mode using PCSX2 .
I just know how to create a shortcuts for a ps2 game with PER-GAME config. then i did modify the ps2.ini emulators like this :

Code: [Select]
executable           cmd
args                 /c "[romfilename]"
rompath              S:\Emulazione\ROMS\PS2Shortcuts\
romext               .lnk
system               Sony Playstation 2
artwork    flyer           
artwork    snap     

the game start, but when i press esc button, Attract mode maximize again , but PCSX2 doesn't quit and if i choose another game i will have two instances of PCSX2 ...

THEN ,

I have tried a frontend for PCSX2 called SPECTABIS, that allow to launch games with own configs . This Frontend also allows to create a BATCH file or  a shortcut to launch a config. So i have modified again the emulator ini , but now , i have only one instance of the game, but the focus remain on Attract mode and the game runs in back ground ...

do you have any idea how to solve ??

Thank you for your answer ... Cheers :D