Results 1 to 10 of 10

Thread: GUI Frontend and Desktop Shortcut for FCEUltra

  1. #1
    Join Date
    Apr 2005
    Location
    Dallas
    Beans
    217
    Distro
    Ubuntu 10.10 Maverick Meerkat

    GUI Frontend and Desktop Shortcut for FCEUltra

    I've been installing Ubuntu on my brother's computer, and since he has never used Linux before I've tried to make things as simple as possible for him to figure out once the computer is turned over to him. One thing I've done is make sure that every program he has been using in Windows is either working in Linux or has a replacement available, and I've put icons on the taskbar for all the most used programs.

    During this process I made a shortcut for FCEUltra (NES Emulator) using Zenity and a short bash script. This shortcut doesn't just bring up fceu though.. it uses zenity to display a list of your roms in the directory specified in the bash script, and starts the rom chosen from the list in fceu. Here are the steps:

    1.Install zenity and fceu:
    Code:
    sudo apt-get install zenity fceu
    2.Create the bash script that will run when clicking on the shortcut icon:
    Code:
    sudo gedit /usr/bin/startfceu
    Enter the following lines into the file. I've included an option for adding an icon to the zenity window, but it's not needed. I've also included the option for starting fceu in "fullscreen" at 800x600 resolution. Make sure to enter the correct path to your NES roms:
    Code:
    #!/bin/bash
    cd /path/to/nes/roms
    GAME=$(zenity --title "FCEUltra - Select a Nintendo game to play" --window-icon=/icon/for/zenity/window --file-selection)
    /usr/games/fceu -fs 1 -xres 800 -yres 600 $GAME
    3.Make the new file executable:
    Code:
    sudo chmod a+x /usr/bin/startfceu
    You can test this script out now by typing startfceu at the command prompt. The only thing left is to create a desktop icon that points to this new script. Go to Applications -> System Tools -> Applications Menu Editor and create a new shortcut with your chosen name and icon, and make sure the command line says startfceu.

  2. #2
    Join Date
    Apr 2005
    Location
    Finland
    Beans
    133

    Re: GUI Frontend and Desktop Shortcut for FCEUltra

    Thanks for the guide. Since FCE Ultra doesn't seem to offer any easy way to configure keys it might be useful to do it in this script. I know it's not the most convenient way since you have to do it every time but atleast you don't need to do any hex editing this way.

    Change the last line of the script to:
    Code:
    /usr/games/fceu -fs 1 -xres 800 -yres 600 -inputcfg gamepad1 $GAME
    Remember to select Start in terminal in the menu editor when you're creating a shortcut for this one since it asks the keys in the terminal. It also seems to allow multiple keys for the same function but you can just press the same one twice when it's asking for them.

  3. #3
    Join Date
    Apr 2005
    Location
    Finland
    Beans
    133

    Re: GUI Frontend and Desktop Shortcut for FCEUltra

    Correction to my previous post: You only have to configure the keys once, then FCE Ultra remembers them. But still seems that the command line switch is the only way to configure them.

    I just noticed that the graphical file selector doesn't work with files that include spaces, which is unfortunately almost all of them. Any idea how you could get the script to convert ' ' to '\ ' and '(' to '\(' so that it would work?

  4. #4
    Join Date
    Oct 2004
    Beans
    Hidden!
    Distro
    Ubuntu Karmic Koala (testing)

    Re: GUI Frontend and Desktop Shortcut for FCEUltra

    if you put "'"$game"'" does that work?
    I tested with echo in terminal, if it returns everything in 'quotes', spaces should not be a problem...
    The idea of copyright did not exist in ancient times, when authors frequently copied other authors at length in works of non-fiction. This practice was useful, and is the only way many authors' works have survived even in part. -- Richard Stallman

  5. #5
    Join Date
    Apr 2005
    Location
    Finland
    Beans
    133

    Re: GUI Frontend and Desktop Shortcut for FCEUltra

    Well with the original script it gives
    Code:
    Starting FCE Ultra 0.98.12...
    Loading (PRG0).nes'...
    
    Error opening "(PRG0).nes'"!
    And with "'"$GAME"'" it just gives
    Code:
    Starting FCE Ultra 0.98.12...
    Loading (PRG0).nes'...
    
    Error opening "(PRG0).nes'"!
    The PRG0 is the last part of the file name.
    Wish I knew more about shell scripting...

  6. #6
    Join Date
    Apr 2005
    Location
    Dallas
    Beans
    217
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: GUI Frontend and Desktop Shortcut for FCEUltra

    Didn't know you guys were having problems with this script until now. The original script is the exact one that was working for me, but I should say that I made sure all my nes files were renamed to take out all punctuation (and to keep the nes directory easy to navigate). I'm pretty sure your problem is related to having some type of punctuation in the names of one or more of your games.

    If you don't want to rename the files, you could also try enclosing $GAME in the last line of the bash script with single quotes instead of double quotes (double quotes will sometimes allow certain characters to be interpreted by the shell when single quotes will not). I would try this myself, but as mentioned before the computer I installed this on is with my brother on the other side of the country and my current laptop's processor is incapable of running even nes roms without getting pegged. Let me know how it works.

  7. #7
    Join Date
    Mar 2006
    Beans
    3

    Re: GUI Frontend and Desktop Shortcut for FCEUltra

    How do you get fceu to recognize an original NES gamepad connected to parallel?

  8. #8
    Join Date
    Dec 2004
    Beans
    282

    Re: GUI Frontend and Desktop Shortcut for FCEUltra

    I have also developed a bit more extensive frontend to FCEU, check out my post here:
    http://ubuntuforums.org/showthread.p...highlight=fceu
    It supports sound, network, controller configuration, and there is more to come.

  9. #9
    Join Date
    Aug 2006
    Beans
    2

    Re: GUI Frontend and Desktop Shortcut for FCEUltra

    I am getting this error messege after selecting the ROM in the GUI
    Code:
    /usr/bin/startfceu: line 4: /usr/games/fceu: No such file or directory
    What am I doing wrong? Sorry for the Newbie Q

  10. #10
    Join Date
    Dec 2004
    Beans
    282

    Re: GUI Frontend and Desktop Shortcut for FCEUltra

    Quote Originally Posted by NMStang218 View Post
    I am getting this error messege after selecting the ROM in the GUI
    Code:
    /usr/bin/startfceu: line 4: /usr/games/fceu: No such file or directory
    What am I doing wrong? Sorry for the Newbie Q

    ensure you have fceu installed:

    sudo apt-get install fceu

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •