Help With Pnd And Runme.sh


tuki_cat

Member
Joined
Jan 7, 2011
Messages
241
Hi all, (I have also posted this on the openpandora boards in the development section but I'm now not sure that is an appropriate place)

I've been using my limited skills to help out with UAE4ALL. I want to include a directory, let's call it "blank disks" that has 10 or 20 blank adf's thay can be used for saved games.

At the moment I am creating a PND from this - http://www.mediafire.com/?493gbp571l59af1

I'm amending the pxml and adding a slighty different runme.sh (thanks for the help ED)

If I was to include the directory "blank disks" in the above UAE4ALL for all folder (which i would then make a PND from), could I then amend the runme.sh script so that it copies the "blank disks" directory and its contents into the pandora/appdata/uae4all directory when you first run the PND? I'm struggling to amend the runme.sh script to do this, but then being reasonably new to this I'm not even sure if it is possible!

Does anyone know how the script might look to do this, or be able to point me somewhere that can help? I have tried standard Linux command lines for copying directories but clearly I'm missing something. I'm pretty sure it needs to be in the second part of runme.sh script "# copy default config over if it doesn't exist".

Any help is gratefully received :)

My runme.sh is here

#!/bin/sh

# show a warning if kickroms is missing
if [ ! -e ./kick.rom ]; then
files=$(ls ./kickstarts/* | wc -l )
if [ "$files" = "0" ]; then
zenity --warning --text="You have not yet installed a kickstart rom. Please check the setup guide for more information."
exit 1
fi
fi

# copy default config over if it doesn't exist
if [ ! -e ./conf/uaeconfig.conf ]; then
mkdir conf
cp defconf/uaeconfig.conf conf/
mkdir screenshots
mkdir scripts
fi

# Ask for mouse once
if [ ! -e ./mouse ]; then
if zenity --question --title="Mouse Mode" --text="Do you want move the mouse with the RIGHT or LEFT nub?" --ok-label="Left" --cancel-label="Right"; then
echo left > ./mouse
else
echo right > ./mouse
fi
fi

# Change mouse mode
curmodel=$(cat /proc/pandora/nub0/mode)
curmoder=$(cat /proc/pandora/nub1/mode)
mouse=$(cat ./mouse)

if [ "$mouse" = "left" ]; then
echo mouse > /proc/pandora/nub0/mode
echo mbuttons > /proc/pandora/nub1/mode
else
echo mouse > /proc/pandora/nub1/mode
echo mbuttons > /proc/pandora/nub0/mode
fi

# create autosave directory if it doesn't exist
if [ ! -e /saves/2E323333.ads ]; then
mkdir saves
cp defsaves/* saves/
fi



core=$(zenity --list --text "Select M68K core and refresh rate:" --radiolist --column " " --column "M68K core" FALSE "Cyclone 50Hz" TRUE "FAME/C 50Hz" FALSE "UAE 50Hz" FALSE "Cyclone 60Hz" FALSE "FAME/C 60Hz" FALSE "UAE 60Hz");

if [ "$core" = "" ]; then
echo aborted
fi

res=$(zenity --list --text "Select resolution:" --radiolist --column " " --column "Resolution" FALSE "320x205 => 750x480" FALSE "320x216 => 712x480" TRUE "320x240 DOUBLED PIXELS" FALSE "320x240 => 640x480" FALSE "320x256 => 600x480" FALSE "320x262 => 588x480" FALSE "320x205 => 800x480" FALSE "320x205 => 640x480");

if [ "$res" = "" ]; then
echo aborted
fi

xset s off

export SDL_VIDEODRIVER=omapdss

export SDL_OMAP_LAYER_SIZE=640x480

if [ "$res" = "320x205 => 750x480" ]; then
export SDL_OMAP_LAYER_SIZE=750x480
fi
if [ "$res" = "320x216 => 712x480" ]; then
export SDL_OMAP_LAYER_SIZE=712x480
fi
if [ "$res" = "320x256 => 600x480" ]; then
export SDL_OMAP_LAYER_SIZE=600x480
fi
if [ "$res" = "320x262 => 588x480" ]; then
export SDL_OMAP_LAYER_SIZE=588x480
fi
if [ "$res" = "320x205 => 800x480" ]; then
export SDL_OMAP_LAYER_SIZE=800x480
fi

export SDL_OMAP_VSYNC=1

echo 2 > /proc/pandora/game_button_mode # gamepad mode

if [ "$core" = "Cyclone 50Hz" ]; then
sudo /usr/pandora/scripts/op_lcdrate.sh 50
if [ "$res" = "320x205 => 750x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 205
fi
if [ "$res" = "320x216 => 712x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 216
fi
if [ "$res" = "320x240 DOUBLED PIXELS" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone
fi
if [ "$res" = "320x240 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 240
fi
if [ "$res" = "320x256 => 600x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 256
fi
if [ "$res" = "320x262 => 588x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 262
fi
if [ "$res" = "320x205 => 800x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 205
fi
if [ "$res" = "320x205 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 205
fi
fi
if [ "$core" = "Cyclone 60Hz" ]; then
sudo /usr/pandora/scripts/op_lcdrate.sh 60
if [ "$res" = "320x205 => 750x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 205
fi
if [ "$res" = "320x216 => 712x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 216
fi
if [ "$res" = "320x240 DOUBLED PIXELS" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone
fi
if [ "$res" = "320x240 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 240
fi
if [ "$res" = "320x256 => 600x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 256
fi
if [ "$res" = "320x262 => 588x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 262
fi
if [ "$res" = "320x205 => 800x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 205
fi
if [ "$res" = "320x205 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_cyclone 205
fi
fi
if [ "$core" = "FAME/C 50Hz" ]; then
sudo /usr/pandora/scripts/op_lcdrate.sh 50
if [ "$res" = "320x205 => 750x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 205
fi
if [ "$res" = "320x216 => 712x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 216
fi
if [ "$res" = "320x240 DOUBLED PIXELS" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame
fi
if [ "$res" = "320x240 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 240
fi
if [ "$res" = "320x256 => 600x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 256
fi
if [ "$res" = "320x262 => 588x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 262
fi
if [ "$res" = "320x205 => 800x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 205
fi
if [ "$res" = "320x205 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 205
fi
fi
if [ "$core" = "FAME/C 60Hz" ]; then
sudo /usr/pandora/scripts/op_lcdrate.sh 60
if [ "$res" = "320x205 => 750x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 205
fi
if [ "$res" = "320x216 => 712x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 216
fi
if [ "$res" = "320x240 DOUBLED PIXELS" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame
fi
if [ "$res" = "320x240 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 240
fi
if [ "$res" = "320x256 => 600x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 256
fi
if [ "$res" = "320x262 => 588x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 262
fi
if [ "$res" = "320x205 => 800x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 205
fi
if [ "$res" = "320x205 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_fame 205
fi
fi
if [ "$core" = "UAE 50Hz" ]; then
sudo /usr/pandora/scripts/op_lcdrate.sh 50
if [ "$res" = "320x205 => 750x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 205
fi
if [ "$res" = "320x216 => 712x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 216
fi
if [ "$res" = "320x240 DOUBLED PIXELS" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore
fi
if [ "$res" = "320x240 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 240
fi
if [ "$res" = "320x256 => 600x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 256
fi
if [ "$res" = "320x262 => 588x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 262
fi
if [ "$res" = "320x205 => 800x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 205
fi
if [ "$res" = "320x205 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 205
fi
fi
if [ "$core" = "UAE 60Hz" ]; then
sudo /usr/pandora/scripts/op_lcdrate.sh 60
if [ "$res" = "320x205 => 750x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 205
fi
if [ "$res" = "320x216 => 712x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 216
fi
if [ "$res" = "320x240 DOUBLED PIXELS" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore
fi
if [ "$res" = "320x240 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 240
fi
if [ "$res" = "320x256 => 600x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 256
fi
if [ "$res" = "320x262 => 588x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 262
fi
if [ "$res" = "320x205 => 800x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 205
fi
if [ "$res" = "320x205 => 640x480" ]; then
LD_PRELOAD=./libSDL-1.2.so.0 ./uae4all_uaecore 205
fi
fi

echo 1 > /proc/pandora/game_button_mode # keyboard mode
sudo /usr/pandora/scripts/op_lcdrate.sh 60 # Back to 60Hz
echo $curmodel > /proc/pandora/nub0/mode # Left Nub back to normal
echo $curmoder > /proc/pandora/nub1/mode # Right Nub back to normal
 
Check the hatari pnd where I do similar stuff.

Couple things..

If you add a dir with floppies in it "./savegame_disks" in your pnd-file, then savegame_disks dir will be available to the app (UAE) withotu copying; if its in the pnd, it shows up to the app.

Thereis an aufs bug/oddity that can get in the way sometimes though, so maybe you need to do the copying like you say (therres a bug when writing into a dir that hasn't been created in the local filesystem, but is in the mounted union filesystem).

You can use a -f test to test for file exiostance sometimes.

So, something like..

if [ ! -f savedisks_dir ]; then
mkdir savedisks_dir
cp savedisks_dir_in_pind/*adf ./savedisks_dir
fi

./uae

Would do.

That would, on first run, create the savedisks_dir (that shows up in appdata), and then copy the adfs there. PRoblem might be that the original savedisks_dir_in_pnd would still also show up, since app could see it. So instead, do it like..

In the pnd

./runtime <- put all the stuff in there, UAE, data, etc, but not the 'meta' stuff, the stuff you don't want UAE to see; like the runme script, the adf files.

Then it becomes runme.sh:

if [ ! -f savedisks_dir ]: then
mkdir ./savedisks_dir
cp ./savedisks_dir_in_pnd/*adf ./savedisks_dir
fi

cd runtime
./uae

Tada!

jeff
 
skeezix said:
Check the hatari pnd where I do similar stuff.

Couple things..

If you add a dir with floppies in it "./savegame_disks" in your pnd-file, then savegame_disks dir will be available to the app (UAE) withotu copying; if its in the pnd, it shows up to the app.

Thereis an aufs bug/oddity that can get in the way sometimes though, so maybe you need to do the copying like you say (therres a bug when writing into a dir that hasn't been created in the local filesystem, but is in the mounted union filesystem).

You can use a -f test to test for file exiostance sometimes.

So, something like..

if [ ! -f savedisks_dir ]; then
mkdir savedisks_dir
cp savedisks_dir_in_pind/*adf ./savedisks_dir
fi

./uae

Would do.

That would, on first run, create the savedisks_dir (that shows up in appdata), and then copy the adfs there. PRoblem might be that the original savedisks_dir_in_pnd would still also show up, since app could see it. So instead, do it like..

In the pnd

./runtime <- put all the stuff in there, UAE, data, etc, but not the 'meta' stuff, the stuff you don't want UAE to see; like the runme script, the adf files.

Then it becomes runme.sh:

if [ ! -f savedisks_dir ]: then
mkdir ./savedisks_dir
cp ./savedisks_dir_in_pnd/*adf ./savedisks_dir
fi

cd runtime
./uae

Tada!

jeff

Thanks Jeff,

I'll give it a go in a bit and see how I get on!

I decided to put the blankdisks in zip file and have the script extract them on the first startup, using this script:

if [ ! -e blankdisks ]; then
mkdir blankdisks
unzip blankdisks.zip -d blankdisks
fi
 
Last edited by a moderator:
Back
Top