Author Topic: Opie-sh Script For Snes9x  (Read 9123 times)

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh Script For Snes9x
« on: December 17, 2004, 11:23:06 pm »
I've had problems getting Zemufe working on 3.5.2 so I took it as a good excuse to learn Opie-SH a little better.  Awesome stuff.

Here is a script to make a list of Roms and run them.
This is made up for Snes9x, but it'd be painless to switch it to something else, since all it really does is make a list of files and pipe it to the command at the bottom.

IT it looking for Roms as *.zip (case sensitive)
Code: [Select]
#!/bin/sh
#Path to your Roms

LOCATION=/mnt/card/games/snes

#Load a game from your list
ROM=`   cd $LOCATION; ls -1 *.zip \
        | opie-sh -i -l -t "Roms" -F  -g `
if [ "$ROM" = "" ]
then exit
fi

#Enable Sound Button
setsound () {
        opie-sh -m -t "Sound"   \
        -M "Do you want sound?" \
        -g -0 Yes -1 No
RETURNCODE=$?

#Hitting "OK" returns 255, so if you press "OK" you get sound.
case $RETURNCODE in
        255) SOUND=-sound;;
        0)  SOUND=-sound;;
        1)  SOUND=-nosound;;
esac
}

setsound

if [ "$SOUND" = "" ]; then
        exit
fi
snes9x $SOUND $LOCATION/$ROM
It's ugly, but it works.
Be sure to change the location of your roms.

I added this to my /etc/profile to get the buttons the way I like them.
Code: [Select]
S9XKEYS=113,32,293,291,290,111,112,13,46A     = Center Button
B     = Home
X     = Contacts
Y     = Calendar
L     = o
R     = p
Start=Enter
Select=Space
Quit  = q

then add S9XKEYS to the end of the "export" line.

Appleman

  • Newbie
  • *
  • Posts: 5
    • View Profile
Opie-sh Script For Snes9x
« Reply #1 on: December 19, 2004, 04:42:20 pm »
This works pretty slick.

However, whenever I run snes9x it starts up then quits right away with Fatal Signal: Bus Error (SDL Parachute deployed)


Any ideas?

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh Script For Snes9x
« Reply #2 on: December 19, 2004, 11:11:33 pm »
You did change the $LOCATION I am assuming, otherwise you wouldnt have any games listed.

What kind of errors does it spit out from the console?
Are you using snes9x-sdl-qpe out of the 3.5.2 feed?

I have only used this on a 5500, but I dont imagine that matters much.

anunakin

  • Sr. Member
  • ****
  • Posts: 340
    • View Profile
    • http://vivaphp.net
Opie-sh Script For Snes9x
« Reply #3 on: December 20, 2004, 01:17:46 pm »
Hey! this works fine here and I create a snes9x.desktop... works fine!
I using this icon /usr/kde/3.3/share/icons/crystalsvg/32x32/apps/package_games.png from KDE 3.3 Crystal Icons... very good...
http://www.geocities.com/anunakin/images/package_games.png
[img]http://www.geocities.com/anunakin/images/package_games.png\" border=\"0\" class=\"linked-image\" /]
[Desktop Entry]
Comment=Snes9x is a powerfull SNES Emulator
Exec=sn.sh
Icon=package_games
Type=Application
Name=Snes9x
[img]http://www.vivaphp.net/imagens/rev2.jpg\" border=\"0\" class=\"linked-sig-image\" /]
Anunakin (Marcus Fazzi)

Nokia N900 32GB + microSD 2GB
Nokia N810 w/ microSD 8GB
Nokia 5310 XpressMusic w/ microSD 1GB
HP48GX->Psion Sienna->Palm m130->Tungsten T->Zaurus SL-5500->C3000->C3100 ALL SOLD

My FEED(On Line AGAIN!!!)

x86Daddy

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • http://
Opie-sh Script For Snes9x
« Reply #4 on: December 22, 2004, 01:49:19 am »
I've *almost* got this perfect on my SL-5500....  Someone please tell me there's a way to make it portrait mode?

anunakin

  • Sr. Member
  • ****
  • Posts: 340
    • View Profile
    • http://vivaphp.net
Opie-sh Script For Snes9x
« Reply #5 on: December 22, 2004, 09:22:34 am »
I think, u need edit and recompile snes9x to do it!
[img]http://www.vivaphp.net/imagens/rev2.jpg\" border=\"0\" class=\"linked-sig-image\" /]
Anunakin (Marcus Fazzi)

Nokia N900 32GB + microSD 2GB
Nokia N810 w/ microSD 8GB
Nokia 5310 XpressMusic w/ microSD 1GB
HP48GX->Psion Sienna->Palm m130->Tungsten T->Zaurus SL-5500->C3000->C3100 ALL SOLD

My FEED(On Line AGAIN!!!)

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh Script For Snes9x
« Reply #6 on: December 22, 2004, 04:35:10 pm »
I would send baskets of money to whoever made a portrait snes9x.

Im working on building yet another mutant ipk of qtopiagnuboy.
Replacing qtopignuboyl with some Opie-SH scripts, so it should look very similar to the SNES frontend up above.

Duskrider

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • http://
Opie-sh Script For Snes9x
« Reply #7 on: December 27, 2004, 12:07:16 am »
Hey guys =) I got a 1gig memory card for christmas and with it came a determination to run FFIV on my Zaurus. However, I am totally illiterate when it comes to mucking about in the innards of computers...so would someone be so kind as to give me a clue (or even something like a step by step guide) to how to get this to work? I literally don't know where to begin - I copied this into a .txt file, and then I guess I have to convert it to something, somehow, and then put that converted something on the Zaurus, but I have no idea how to do such a thing or even if that is the concept at all.

Many thanks if anyone can help me with this one

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh Script For Snes9x
« Reply #8 on: December 27, 2004, 03:24:35 am »
Its pretty easy once you get into it, but looking at it for the first time is probably intimidating.

What you can do (I'll let you cheat and I can send you an ipk of the files) is copy the text for that into a file called "opie-sh-snes.sh" and save it into /opt/QtPalmtop/bin on your zaurus.
make sure to do a 'chmod +x opie-sh-snes.sh' to get it to be executable.

The hard part is making the .desktop file to go with it, and using an icon that is there.
Save the icon into /opt/QtPalmtop/pics
and save
Code: [Select]
[Desktop Entry]
Comment=Snes9x is a powerfull SNES Emulator
Exec=opie-sh-snes.sh
Icon=package_games
Type=Application
Name=Snes9x
into a file called snes9x.desktop in /opt/QtPalmtop/apps/Games

then you just restart opie, and it should show up.

Here is an ipk of the thing you'll need.
It is looking for games on the SD card at /mnt/card/games/snes, if you need to change this, edit opie-sh-snes.sh and change the LOCATION variable at the top.

You'll still need to do the export thing in my first post to get your keybindings to use the Application Buttons.
« Last Edit: December 27, 2004, 03:39:44 am by MrSquishy »

anunakin

  • Sr. Member
  • ****
  • Posts: 340
    • View Profile
    • http://vivaphp.net
Opie-sh Script For Snes9x
« Reply #9 on: December 27, 2004, 07:21:54 am »
Great man! nice job!  
[img]http://www.vivaphp.net/imagens/rev2.jpg\" border=\"0\" class=\"linked-sig-image\" /]
Anunakin (Marcus Fazzi)

Nokia N900 32GB + microSD 2GB
Nokia N810 w/ microSD 8GB
Nokia 5310 XpressMusic w/ microSD 1GB
HP48GX->Psion Sienna->Palm m130->Tungsten T->Zaurus SL-5500->C3000->C3100 ALL SOLD

My FEED(On Line AGAIN!!!)

CoreDump

  • Hero Member
  • *****
  • Posts: 713
    • View Profile
    • http://www.hentges.net
Opie-sh Script For Snes9x
« Reply #10 on: December 27, 2004, 02:15:57 pm »
If you add a popup / message where the script is looking for games, I'd be happy to add it to OE (and any future OZ feed for that matter).

The only difficulty I can see here are the buttons (S9XKEYS)
Does the current configuration work on other devices than a Z5x00, too?
Webmaster of hentges.net & Embedded Linux Developer.

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh Script For Snes9x
« Reply #11 on: December 27, 2004, 04:15:30 pm »
Wow, quite an honor to get a package into the feed.
This one has an entry for rom location (Which can be disabled in the script) and I fixed the icon I broke in the 0.1 ipk above.
I didnt make the depend's need snes9x-qpe-sdl because this should work with several versions of snes9x.

 Thank you everyone for the help.

CoreDump

  • Hero Member
  • *****
  • Posts: 713
    • View Profile
    • http://www.hentges.net
Opie-sh Script For Snes9x
« Reply #12 on: December 27, 2004, 05:29:14 pm »
Could you please try the attached ipk if it works for you?
Webmaster of hentges.net & Embedded Linux Developer.

MrSquishy

  • Full Member
  • ***
  • Posts: 159
    • View Profile
    • http://
Opie-sh Script For Snes9x
« Reply #13 on: December 27, 2004, 06:11:15 pm »
It's odd that attaching the ipk converts the dashes to underscores.  That could possibly mess up a package manager couldnt it?

Looks like the package works fine though.

CoreDump

  • Hero Member
  • *****
  • Posts: 713
    • View Profile
    • http://www.hentges.net
Opie-sh Script For Snes9x
« Reply #14 on: December 27, 2004, 06:33:18 pm »
Code: [Select]
CoreDump  * r1.2774 openembedded/packages/opie-sh-snes/ (4 files in 2 dirs): Add opie-sh-snes, an opie-sh wrapper to launch SNES ROMs. Credits to MrSquishy @ ZUG
Gratulations  
Webmaster of hentges.net & Embedded Linux Developer.