Help With Scripts


T

TelcoLou

Guest
Ok, I'm Soooo close to figuring this out :lol:

I wanted to make an "Emulators" folder to store all my quick-launch scripts. So far, I can only get emulators that are contained in seperate folders to run.

Here's 2 examples that work:

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 200
cd /mnt/sd/DrMD/
./DrMDx.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

As I understand it, this will run the LCD_CPU Tweak program (located in my SD's root), then Change Directory to my DrMD folder which contains the DrMDx.gpe file.

This works perfectly.

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 266
cd /mnt/sd/gp2xmess-0.9-beta/gp2xmess
./a7800.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

^ this also works perfectly ... however, this one does not:

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 266
./squidgesnes.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

Seems like any .gpe that is stored in the root of the SD will not run via a script inside my Emulators folder. Any help would be GREATLY appreciated :)
 
TelcoLou posted on Feb 14 2006 at 10:06 PM said:
Ok at I'm Soooo close to figuring this out :lol:

I wanted to make an "Emulators" folder to store all my quick-launch scripts. So far, I can only get emulators that are contained in seperate folders to run.

Here's 2 examples that work:

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 200
cd /mnt/sd/DrMD/
./DrMDx.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

As I understand it, this will run the LCD_CPU Tweak program (located in my SD's root), then Change Directory to my DrMD folder which contains the DrMDx.gpe file.

This works perfectly.

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 266
cd /mnt/sd/gp2xmess-0.9-beta/gp2xmess
./a7800.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

^ this also works perfectly ... however, this one does not:

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 266
./squidgesnes.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

Seems like any .gpe that is stored in the root of the SD will not run via a script inside my Emulators folder. Any help would be GREATLY appreciated :)

When in doubt, full paths!

You are currently in the Emulators folder: squidesnes.gpe is not

That ./squidgesnes.gpe needs to be something like /mnt/sd/squidgesnes.gpe if it's in the root.

... I can do a for loop in bash script XD
 
Last edited by a moderator:
Just like the other ones -- change to the directory in which it resides.

In this case:

cd /mnt/sd

ought to do the trick.
 
Thanks for the help ... strangely enough, I got Handy to work:

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 266
/mnt/sd/GP2XHandy.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

But when I run SquidgeSNES, I get the black screen with text, then get dumped back to the GP2X menu:

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 266
/mnt/sd/squidgesnes.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

... yet, when I run the squidgesnes.gpe directly, it works fine :lol:

I'll figure it out ... thanks again guys :)
 
Hmmmmm.... it seems like ONLY squidgesnes won't work using a script ... here's a stare & compare:

DrMDx:

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 200
cd /mnt/sd/DrMD/
./DrMDx.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

squidesnes (Note: I deleted all squidgesnes files and re-installed the .gpe, .cfg and the skin folder in a SNES directory):

Code:
#!/bin/sh

/mnt/sd/cpu_speed.gpe 1 2 266
cd /mnt/sd/SNES/
./squidgesnes.gpe
sync

cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

And again, It works fine if I run the .gpe directly ... using the script as shown, I just get dumped back to the GP2X menu. All my other emus work using scripts, just not squidgesnes.
 
In both your example scripts for squidgeSNES, you aren't actually changing to the the directory that the executable resides in. It appears squidgeSNES uses relative paths to resource files & can't find them when running from your script.

Try this:
Code:
#!/bin/sh
cd /mnt/sd/{[I]SquidgeSNES directory here[/I]}
./squidgesnes.gpe
sync
cd /usr/gp2x/
exec /usr/gp2x/gp2xmenu

EDIT: typo's

EDIT: Apologies, your second example should work, tested it on mine, strangely enough it doesn't.
 
Back
Top