Skip to content

Commit

Permalink
(WiiU) Package Salamander as .wuhb along with RA assets
Browse files Browse the repository at this point in the history
These assets are shared to the cores after core switch. Reading them out of a .wuhb is an Aroma-exclusive feature that makes core loading times dramatically better.

Branding assets provided by @Ploggy, originally by cucholix afaik.

Co-developed-by: Maschell <[email protected]>
  • Loading branch information
ashquarky committed Jun 10, 2024
1 parent 22dafed commit 4405bc4
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 315 deletions.
129 changes: 24 additions & 105 deletions dist-scripts/wiiu-cores.sh
Original file line number Diff line number Diff line change
@@ -1,141 +1,60 @@
#!/bin/sh

# usage:
# copy core libs (*_libretro_wiiu.a), info files (https://github.com/libretro/libretro-super/tree/master/dist/info)
# and icons (https://github.com/libretro/retroarch-assets/tree/master/pkg/wiiu) to this directory then run
# the script. the output will be in retroarch/pkg/wiiu
# copy core libs (*_libretro_wiiu.a) and assets (https://buildbot.libretro.com/assets/frontend/assets.zip) to this
# directory then run the script. the output will be in retroarch/pkg/wiiu

. ../version.all

platform=wiiu
EXT=a

mkdir -p ../pkg/wiiu/retroarch/cores/info
cp *.info ../pkg/wiiu/retroarch/cores/info/
mkdir -p ../pkg/wiiu/rpx/retroarch/cores/info
cp *.info ../pkg/wiiu/rpx/retroarch/cores/info/
retroarch_dir=../pkg/wiiu/retroarch
apps_dir=../pkg/wiiu/wiiu/apps
mkdir -p $retroarch_dir/cores $apps_dir

echo "-- Building launcher (Salamander) --"
make -C ../ -f Makefile.${platform} SALAMANDER_BUILD=1 clean || exit 1
make -C ../ -f Makefile.${platform} SALAMANDER_BUILD=1 BUILD_HBL_ELF=1 BUILD_RPX=1 -j3 || exit 1
make -C ../ -f Makefile.${platform} SALAMANDER_BUILD=1 -j$(nproc) || exit 1

mkdir -p ../pkg/wiiu/wiiu/apps/retroarch
mv -f ../retroarch_wiiu_salamander.elf ../pkg/wiiu/wiiu/apps/retroarch/retroarch.elf
cp -f ../pkg/wiiu/meta.xml ../pkg/wiiu/wiiu/apps/retroarch/meta.xml
cp -f ../pkg/wiiu/icon.png ../pkg/wiiu/wiiu/apps/retroarch/icon.png
mkdir -p ../pkg/wiiu/rpx/wiiu/apps/retroarch
mv -f ../retroarch_wiiu_salamander.rpx ../pkg/wiiu/rpx/wiiu/apps/retroarch/retroarch.rpx
rm -f ../retroarch_wiiu_salamander.rpx.elf
cp -f ../pkg/wiiu/meta.xml ../pkg/wiiu/rpx/wiiu/apps/retroarch/meta.xml
cp -f ../pkg/wiiu/icon.png ../pkg/wiiu/rpx/wiiu/apps/retroarch/icon.png
if [ -e assets.zip ]; then
# This is named "build" because we're building the assets, but it's also got a broad rule in the gitignore
mkdir -p build/assets
unzip -o assets.zip -d build/assets

make -C ../ -f Makefile.${platform} clean || exit 1
wuhbtool ../retroarch_wiiu_salamander.rpx $apps_dir/retroarch.wuhb \
--name="RetroArch" \
--short-name="RetroArch" \
--author="libretro" \
--icon=../pkg/wiiu/booticon.png \
--tv-image=../pkg/wiiu/bootTvTex.tga \
--drc-image=../pkg/wiiu/bootDrcTex.tga \
--content=build/ || exit 1

lookup()
{
cat | grep "$1 = " | sed "s/$1 = \"//" | sed s/\"//
}
rm -rf build
fi

gen_meta_xml()
{
info="$1"_libretro.info
if [ -e $info ] ; then
display_name=`cat $info | lookup "display_name"`
corename=`cat $info | lookup "corename"`
authors=`cat $info | lookup "authors" | sed s/\|/\ -\ /g`
systemname=`cat $info | lookup "systemname"`
license=`cat $info | lookup "license"`
date=`date +%Y%m%d%H%M%S`
build_hash=`git rev-parse --short HEAD 2>/dev/null`
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' > "$1"_meta.xml
echo '<app version="1">' >> "$1"_meta.xml
echo ' <name>'$corename'</name>' >> "$1"_meta.xml
echo ' <coder>'$authors'</coder>' >> "$1"_meta.xml
echo ' <version>'$PACKAGE_VERSION' r'$build_hash'</version>' >> "$1"_meta.xml
echo ' <release_date>'$date'</release_date>' >> "$1"_meta.xml
echo ' <short_description>RetroArch</short_description>' >> "$1"_meta.xml
echo -e ' <long_description>'$display_name'\n\nSystem: '$systemname'\nLicense: '$license'</long_description>' >> "$1"_meta.xml
echo ' <category>emu</category>' >> "$1"_meta.xml
echo ' <url>https://github.com/libretro</url>' >> "$1"_meta.xml
echo '</app>' >> "$1"_meta.xml
fi
}
make -C ../ -f Makefile.${platform} clean || exit 1

for f in `ls -v *_${platform}.${EXT}`; do
name=`echo "$f" | sed "s/\(_libretro_${platform}\|\).${EXT}$//"`
whole_archive=
build_hbl_elf=1
build_rpx=1

if [ $name = "nxengine" ] ; then
echo "Applying whole archive linking..."
whole_archive="WHOLE_ARCHIVE_LINK=1"
fi

if [ $name = "mame2003" ] ; then
build_hbl_elf=0
fi

if [ $name = "fbalpha2012" ] ; then
build_hbl_elf=0
fi

if [ $name = "mame2003_midway" ] ; then
build_rpx=0
fi
if [ $name = "fbalpha2012_cps1" ] ; then
build_rpx=0
fi
if [ $name = "fbalpha2012_cps2" ] ; then
build_rpx=0
fi
if [ $name = "fbalpha2012_cps3" ] ; then
build_rpx=0
fi
if [ $name = "fbalpha2012_neogeo" ] ; then
build_rpx=0
fi

echo "-- Building core: $name --"
cp -f "$f" ../libretro_${platform}.${EXT}
echo NAME: $name

# Compile core
make -C ../ -f Makefile.${platform} LIBRETRO=$name BUILD_HBL_ELF=$build_hbl_elf BUILD_RPX=$build_rpx $whole_archive -j3 || exit 1
gen_meta_xml $name
make -C ../ -f Makefile.${platform} LIBRETRO=$name $whole_archive -j$(nproc) || exit 1

if [ -e ../retroarch_wiiu.elf ] ; then
cp ../retroarch_wiiu.elf ../pkg/wiiu/retroarch/cores/${name}_libretro.elf
mkdir -p ../pkg/wiiu/wiiu/apps/${name}_libretro
mv -f ../retroarch_wiiu.elf ../pkg/wiiu/wiiu/apps/${name}_libretro/${name}_libretro.elf
if [ -e ${name}_meta.xml ] ; then
cp -f ${name}_meta.xml ../pkg/wiiu/wiiu/apps/${name}_libretro/meta.xml
else
cp -f ../pkg/wiiu/meta.xml ../pkg/wiiu/wiiu/apps/${name}_libretro/meta.xml
fi
if [ -e $name.png ] ; then
cp -f $name.png ../pkg/wiiu/wiiu/apps/${name}_libretro/icon.png
else
cp -f ../pkg/wiiu/icon.png ../pkg/wiiu/wiiu/apps/${name}_libretro/icon.png
fi
fi
if [ -e ../retroarch_wiiu.rpx ] ; then
cp ../retroarch_wiiu.rpx ../pkg/wiiu/rpx/retroarch/cores/${name}_libretro.rpx
mkdir -p ../pkg/wiiu/rpx/wiiu/apps/${name}_libretro
mv -f ../retroarch_wiiu.rpx ../pkg/wiiu/rpx/wiiu/apps/${name}_libretro/${name}_libretro.rpx
rm -f ../retroarch_wiiu.rpx.elf
if [ -e ${name}_meta.xml ] ; then
cp -f ${name}_meta.xml ../pkg/wiiu/rpx/wiiu/apps/${name}_libretro/meta.xml
else
cp -f ../pkg/wiiu/meta.xml ../pkg/wiiu/rpx/wiiu/apps/${name}_libretro/meta.xml
fi
if [ -e $name.png ] ; then
cp -f $name.png ../pkg/wiiu/rpx/wiiu/apps/${name}_libretro/icon.png
else
cp -f ../pkg/wiiu/icon.png ../pkg/wiiu/rpx/wiiu/apps/${name}_libretro/icon.png
fi
cp ../retroarch_wiiu.rpx $retroarch_dir/cores/${name}_libretro.rpx
fi
rm -rf ${name}_meta.xml

done

# Additional build step
194 changes: 0 additions & 194 deletions dist-scripts/wiiu-new-cores.sh

This file was deleted.

4 changes: 2 additions & 2 deletions dist-scripts/wiiu-rpx-upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ fi

filesToUpload()
{
find . -type f \( -name "*.rpx" -o -name "*.xml" -o -name "*.png" -o -name "*.info" \)
find . -type f \( -name "*.rpx" -o -name "*.wuhb" -o -name "*.info" \)
}

cd ../pkg/wiiu/rpx
cd ../pkg/wiiu

# First, delete any previous *.remote files from previous uploads.
find . -name '*.remote' | xargs rm -f {}
Expand Down
Loading

0 comments on commit 4405bc4

Please sign in to comment.