Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE: Update gpSP (now GBA default, has netplay) #1721

Merged
merged 6 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion static/build/.tmp_update/config/netplay_cores.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Rom_Folder_Name;Core_Filename;Core_Config_Folder;CPUspeed;
CPS1;fbalpha2012_cps1_libretro.so;
FC;fceumm_libretro.so;
GB;tgbdual_libretro.so;
GBA;none;
GBA;gpsp_libretro.so;
GBC;tgbdual_libretro.so;
MD;picodrive_libretro.so;
NDS;none;
Expand Down
33 changes: 18 additions & 15 deletions static/build/.tmp_update/script/game_list_options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ recentlist=/mnt/SDCARD/Roms/recentlist.json
recentlist_hidden=/mnt/SDCARD/Roms/recentlist-hidden.json
recentlist_temp=/tmp/recentlist-temp.json

UI_TITLE="OPTIONS"
UI_TITLE="GLO"

mkdir -p $radir/cores/cache

Expand Down Expand Up @@ -91,12 +91,12 @@ main() {
else
rompath=$(echo "$cmd" | awk '{ st = index($0,"\" \""); print substr($0,st+3,length($0)-st-3) }')

export cookie_rom_path="$rompath"

if echo "$rompath" | grep -q ":"; then
rompath=$(echo "$rompath" | awk '{st = index($0,":"); print substr($0,st+1)}')
fi

export cookie_rom_path="$rompath"

if check_is_game "$rompath"; then
romtype=$ROM_TYPE_GAME
fi
Expand Down Expand Up @@ -231,7 +231,6 @@ main() {
exit 1
}


check_is_game() {
echo "$1" | grep -q "retroarch" || echo "$1" | grep -q "/../../Roms/"
}
Expand Down Expand Up @@ -261,19 +260,19 @@ add_script_files() {

if [ "$scriptlabel" == "" ]; then
scriptlabel=$(basename "$entry" .sh)
elif [ "$scriptlabel" == "DynamicLabel" ]; then
# We run the script with "DynamicLabel" in third parameter to generate the name
"$entry" "$rompath" "$emupath" "DynamicLabel" "$emulabel" "$retroarch_core" "$romdirname" "$romext"
scriptlabel=$(cat /tmp/DynamicLabel.tmp)
rm /tmp/DynamicLabel.tmp
elif [ "$scriptlabel" == "DynamicLabel" ]; then
# We run the script with "DynamicLabel" in third parameter to generate the name
"$entry" "$rompath" "$emupath" "DynamicLabel" "$emulabel" "$retroarch_core" "$romdirname" "$romext"
scriptlabel=$(cat /tmp/DynamicLabel.tmp)
rm /tmp/DynamicLabel.tmp
fi

scriptlabel=$(echo "$scriptlabel" | sed "s/%LIST%/$emulabel/g")
if [ "$scriptlabel" != "none" ]; then
echo "adding romscript: $scriptlabel"
add_menu_option run_script "$scriptlabel" "$entry"
fi

if [ "$scriptlabel" != "none" ]; then
echo "adding romscript: $scriptlabel"
add_menu_option run_script "$scriptlabel" "$entry"
fi
done
fi
}
Expand Down Expand Up @@ -312,7 +311,11 @@ get_core_info() {
retroarch_core=$(get_info_value "$romcfg" core)
fi

default_core=$(cat "$launch_path" | grep ".retroarch/cores/" | awk '{st = index($0,".retroarch/cores/"); s = substr($0,st+17); st2 = index(s,".so"); print substr(s,0,st2-1)}' | xargs)
if grep -q "default_core=" "$launch_path"; then
default_core="$(cat "$launch_path" | grep "default_core=" | head -1 | awk '{split($0,a,"="); print a[2]}' | xargs)_libretro"
else
default_core=$(cat "$launch_path" | grep ".retroarch/cores/" | awk '{st = index($0,".retroarch/cores/"); s = substr($0,st+17); st2 = index(s,".so"); print substr(s,0,st2-1)}' | xargs)
fi

if [ "$retroarch_core" == "" ]; then
retroarch_core="$default_core"
Expand Down
4 changes: 2 additions & 2 deletions static/build/RetroArch/.retroarch/cores/gpsp_libretro.info
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ systemname = "Game Boy Advance"
systemid = "game_boy_advance"

# Libretro Features
database = "Nintendo - Game Boy Advance|Nintendo - Game Boy Advance (e-Cards)"
database = "Nintendo - Game Boy Advance"
supports_no_game = "false"
savestate = "true"
savestate_features = "serialized"
savestate_features = "deterministic"
cheats = "false"
input_descriptors = "true"
memory_descriptors = "false"
Expand Down
Binary file modified static/build/RetroArch/.retroarch/cores/gpsp_libretro.so
100644 → 100755
Binary file not shown.
48 changes: 48 additions & 0 deletions static/packages/Emu/Nintendo - GBA (gpSP)/Emu/GBA/launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh
echo $0 $*
progdir=$(dirname "$0")
homedir=$(dirname "$1")
savedir=/mnt/SDCARD/Saves/CurrentProfile/saves
statedir=/mnt/SDCARD/Saves/CurrentProfile/states

# extract rom name without extension
romname=$(basename "$1" | sed 's/\.[^.]*$//')
romcfgpath="$homedir/.game_config/$romname.cfg"

gpsp_state="$statedir/gpSP/$romname.state.auto"
mgba_state="$statedir/mGBA/$romname.state.auto"

gpsp_save="$savedir/gpSP/$romname.srm"
mgba_save="$savedir/mGBA/$romname.srm"

default_core=gpsp

# check if gpSP save states exist
if [ ! -f "$gpsp_state" ] && [ ! -f "$gpsp_save" ]; then
if [ -f "$mgba_save" ]; then
LD_PRELOAD=/mnt/SDCARD/miyoo/lib/libpadsp.so /mnt/SDCARD/.tmp_update/bin/prompt -r \
-t "GBA CORE CHANGED" \
-m "Default GBA core is now gpSP.\nYou have an mGBA save file\nfor this game." \
"Transfer save to gpSP" \
"Keep playing with mGBA"

retcode=$?

if [ $retcode -eq 0 ]; then
cp "$mgba_save" "$savedir/gpSP"
else
default_core=mgba
fi
elif [ -f "$mgba_state" ]; then
default_core=mgba
fi
fi

# if core is mgba, create a config file
if [ "$default_core" = "mgba" ]; then
mkdir -p "$homedir/.game_config"
echo "core = \"mgba_libretro\"" > "$romcfgpath"
fi

cd /mnt/SDCARD/RetroArch
HOME=/mnt/SDCARD/RetroArch ./retroarch -v -L .retroarch/cores/${default_core}_libretro.so "$1"
39 changes: 0 additions & 39 deletions static/packages/Emu/Nintendo - GBA (mGBA)/Emu/GBA/launch.sh

This file was deleted.

12 changes: 0 additions & 12 deletions static/packages/RApp/Nintendo - GBA (gpSP)/RApp/gpsp/config.json

This file was deleted.

This file was deleted.

Empty file.
4 changes: 2 additions & 2 deletions website/docs/06-multiplayer-netplay/01-standardnetplay.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Each game you'll create will be available over internet and your local network,

2. Press <kbd>Y</kbd> to open GLO

3. Choose `Netplay` -> `Host` -> `Standard Netplay (use current wifi)`
3. Choose `Netplay` -> `Host a session...` -> `Standard Netplay (use current wifi)`

Your Onion netplay session is now ready to be joined from your local home network or even on the other side of the world.

Expand All @@ -46,7 +46,7 @@ Your Onion netplay session is now ready to be joined from your local home networ

2. Press <kbd>Y</kbd> to open GLO

3. Choose `Netplay` -> `Join` -> `Standard Netplay (use current wifi)`
3. Choose `Netplay` -> `Join a session...` -> `Standard Netplay (use current wifi)`

4. Press Menu + Select to display the retroarch menu, go into Netplay and then click on :
- `Refresh Netplay Host List` -> to display hosted games over internet
Expand Down
4 changes: 2 additions & 2 deletions website/docs/06-multiplayer-netplay/02-easynetplay.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ You'll currently find the quick join feature in GLO. GLO can be opened by browsi

2. Press <kbd>Y</kbd> to open GLO

3. Choose `Netplay` -> `Host` -> `Easy Netplay (Play anywhere, local only)`
3. Choose `Netplay` -> `Host a session...` -> `Easy Netplay (Play anywhere, local only)`

Onion should now take over and setup a session on the built in personal hotspot.

Expand All @@ -50,7 +50,7 @@ To join a host, it's a little easier. Currently you'll start the hotspot client

2. Press <kbd>Y</kbd> to open GLO

3. Choose `Netplay` -> `Join` -> `Easy Netplay (Play anywhere, local only)`
3. Choose `Netplay` -> `Join a session...` -> `Easy Netplay (Play anywhere, local only)`

Onion will now take over and join the hotspot, pull the information from the host and connect!

Expand Down
4 changes: 2 additions & 2 deletions website/docs/06-multiplayer-netplay/03-easynetplay-pokemon.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Setting up the host is as easy as:

2. Press <kbd>Y</kbd> to open GLO

3. Choose `Netplay` -> `Host` -> `Easy Netplay - Pokemon Trade/Battle`
3. Choose `Netplay` -> `Host a session...` -> `Easy Netplay - Pokemon Trade/Battle`

Onion will now take over and setup a session on the built in personal hotspot.

Expand All @@ -76,7 +76,7 @@ As with the host, getting connected as a client is just as simple:

2. Press <kbd>Y</kbd> to open GLO

3. Choose `Netplay` -> `Join` -> `Easy Netplay - Pokemon Trade/Battle`
3. Choose `Netplay` -> `Join a session...` -> `Easy Netplay - Pokemon Trade/Battle`

Onion will now take over and join the hotspot, pull the information from the host and connect!

Expand Down
Loading