moved gfceu/gfceuX to old/ folder to avoid confusion

the python launchers are obsolete, use the built-in GUI
This commit is contained in:
punkrockguy318 2010-10-19 19:56:17 +00:00
parent ae5221aff9
commit dc5091e79b
33 changed files with 2214 additions and 3961 deletions

18
INSTALL
View File

@ -1,18 +0,0 @@
You can install gfceux with setup.py:
$ sudo python setup.py install
NOTE: The --prefix option of setup.py may be temporarily broken.
We believe this is a python issue, so just install to the default
path of /usr or just run the script out of the source directory.
Requirements:
Python (tested with 2.6); (Ubuntu package name: python2.6)
NOTE: gfceux is not yet compatible with python 3.x
PyGTK (Ubuntu package name: python-gtk2)
Fceux 2.x
NOTE: fceu 1.x is no longer supported in the gfceu 2.x series.
If you still want/need a front-end for gfceu use gfceu 0.x

12
TODO
View File

@ -1,12 +0,0 @@
TODO:
* implement UI for --special (combo box)
* use combo box for bpp
* use combo box to select gamepad to configure, simply UI
* joystick input support
* hotkey config
* resolution
* parse normal options (etc quiet)
* Browser
Deferred:
* A lot of shit was going to be done with the client/server GUI, but netplay is fucked in svn as it is.

View File

@ -1,20 +0,0 @@
.TH gfceux 1 "August 10, 2008" "Lukas Sabota"
.SH NAME
GFCE UltraX - A GTK2 graphical front-end for fceux
.SH SYNOPSIS
.B gfceux
.BR [options]
.PP
.SH DESCRIPTION
Gfceux is a graphical front-end for fceux, an advanced Nintendo Entertainment System emulator.
It allows easy control over various options including input, network, video, and sound.
.SH OPTIONS
.TP
.B --version
Displays the version number of the application
.TP
.B --help
Displays a help message displaying options
.SH AUTHOR
.TP
Written for Ubuntu/Debian by Lukas Sabota.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,2 +0,0 @@
#!/bin/sh
g++ `sdl-config --cflags --libs` main.cpp -o get_fceu_key;

View File

@ -1,75 +0,0 @@
// main.cpp
// get_fceu_key
// this program opens an SDL window and gets an input event from the user.
// it than prints the values that are needed in the fceux config
// this was written to be used with gfceux, the GTK frontend for gfceu
// Lukas Sabota
// Licensed under the GPL v2
// July 16, 2008
#include<iostream>
#include<SDL.h>
const int WIDTH = 300;
const int HEIGHT = 300;
const int BPP = 4;
const int DEPTH = 32;
using namespace std;
int main(int argc, char* argv[])
{
// the caption doesn't set on intrepid
// TODO: test on ubuntu 8.04
SDL_WM_SetCaption("Press any key. . .", 0);
SDL_Surface *screen;
SDL_Event event;
// open any joysticks
for(int i = 0; i < SDL_NumJoysticks(); i++)
SDL_JoystickOpen(i);
if (!(screen = SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, SDL_SWSURFACE)))
{
SDL_Quit();
return 1;
}
while(1)
{
while(SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
return 0;
// this code was modified from drivers/sdl/input.cpp in fceu so
// that the same values will be written in the config as fceux --inputcfg
case SDL_KEYDOWN:
cout << "BUTTC_KEYBOARD" << endl;
cout << 0 << endl;
cout << event.key.keysym.sym << endl;
return 1;
case SDL_JOYBUTTONDOWN:
cout << "BUTTC_JOYSTICK" << endl;
cout << event.jbutton.which << endl;
cout << event.jbutton.button << endl;
return 1;
case SDL_JOYHATMOTION:
if(event.jhat.value != SDL_HAT_CENTERED)
{
cout << "BUTTC_JOYSTICK" << endl;
cout << event.jhat.which << endl;
cout << (0x2000 | ((event.jhat.hat & 0x1F) << 8) |
event.jhat.value) << endl;
return 1;
}
break;
}
}
}
return 0;
}

17
gfceu/.gitignore vendored Normal file
View File

@ -0,0 +1,17 @@
# A simulation of Subversion default ignores, generated by reposurgeon.
*.o
*.lo
*.la
*.al
*.libs
*.so
*.so.[0-9]*
*.a
*.pyc
*.pyo
*.rej
*~
*.#*
.*.swp
.DS_store
# Simulated Subversion default ignores end here

1
gfceu/BUG Normal file
View File

@ -0,0 +1 @@
* Too much shit when trying to run with no display

View File

@ -1,49 +1,6 @@
* Changed glade filename from gfceux.xml -> gfceux.glade
* Removed the need of running ./generate.ui after every glade change
* Got rid of some silly glade errors
* Changed the installation instructions to avoid breakage
* Gfceux now runs properly from the source directory without
being installed
================= version 2.1 ====================== ============
* Increased the width of the sdl inputcfg window to be more visible
with larger font sizes
* Uninstall script works better
* Is now distributed as a python package. This makes things easier
for maintanence
* Is now installable
* Disabled gamepad GUI until joystick support can be completed
* Initial joystick config support: supports buttons, but hot hats and axes
* Documented and cleaned fceux config parser
* Udated about box UI
* Updated UI, explains joystick support isn't complete yet in the GUI
* Cleaned up glade file to silence warnings
* Pygame is no longer required for gfceux to run, just for the input GUI
* Turbo A and Turbo B support for gamepad GUI
* Added initial support for a graphical UI for configuring gamepads
* Moved gfceu options data file into .fceux instead of .fceultra
================= version 2.0.3 =================================
* Updated UI slightly. Moved sound and advanced tabs; made autoscaling
configuration a bit more intuitive; rearranged some items; made some
text more clear
* Changed gfceu code references to gfceux
* Fixed error in which gfceux would display an ugly error message if
the fceux binary could not be found.
* Working on new config system for input. you can try by configuring
the third gamepad. It's not functional yet, but it's a start on more
intuitive gamepad configuration for sdl
================== version 2.0.2 ================================
* Now stores config file in .fceultra
* If the .fceultra config directory doesn't exist yet, gfceux will
now create it.
================== version 2.0.0 ================================
* Supports movie playback
* Support lua script loading
* Supports autoscale
* No longer requires GnomeVFS
* Major code cleanup
* Supports fceux command line options (different syntax from fceu)
* Now requires pygtk >= 2.12
* Transitioned from gtk.glade to gtk.Builder.
========================== version 0.6.2 ========================
* Minor string changes.
========================== version 0.6.1 ========================
* Changed some strings to reflect new email and website
* Fixed and cleaned some stuff with the glade loading
========================== version 0.6.0 ========================

12
gfceu/INSTALL Normal file
View File

@ -0,0 +1,12 @@
You can install gfceu with setup.py:
$ sudo ./setup.py install
Requirements:
Python (tested with 2.5) (Ubuntu package name: python)
PyGTK, GTK, and PyGlade (tested with 2.8) (Ubuntu package name: (python-gtk2 libgtk2.0-0 python-glade)
FCE Ultra 1.x (Ubuntu package name: fceu)
Optional:
GnomeVFS 2 (tested with 2.14.1) (Ubuntu package name libgnomevfs2-0 python-gtk2)
alsa-oss (tested with 1.0.11)

11
gfceu/MANIFEST Normal file
View File

@ -0,0 +1,11 @@
gfceu
setup.py
COPYING
ChangeLog
INSTALL
TODO
gfceu.glade
gfceu.desktop
gfceu.png
gfceu_big.png
gfceu.1

12
gfceu/TODO Normal file
View File

@ -0,0 +1,12 @@
8/2/2008: I'm not going to be puttin any more effort into gfceu 0.6. Use gfceux and fceux, it's much cleaner/newer/better code.
TODO:
* Ensure version server >= 0.0.5
* Resolution?
* Windows Support
* --last command line option
* normal options (quiet)
* server nick
* no xterm
In progress - status_window.py started, needs to work to be functional
* Browser?

4
gfceu/UNINSTALL Normal file
View File

@ -0,0 +1,4 @@
To uninstall gfceux, run this as root:
$ sudo ./uninstall.py
If you installed gfceux to an alternate prefix, specify the prefix as an argument
$ sudo ./uninstall.py [prefix]

549
gfceu/gfceu Executable file
View File

@ -0,0 +1,549 @@
#!/usr/bin/python
# gfceu - Graphical launcher for FCE Ultra.
# Designed on Ubuntu, with platfrom independence in mind.
version = "0.6.2svn"
# Copyright (C) 2006 Lukas Sabota <punkrockguy318@comcast.net>
##
"""
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
# # # # # # # #
# Python imports
import sys
import os
import pickle
import shutil
from optparse import OptionParser
from subprocess import Popen
# # # # # # # #
# Messaging Functions
def gfceu_message(message, use_gtk=False):
"""
gqfceu_message()
This function prints messages to the user. This is generally used for status
messages. However, it can be used for important messages as well. If a
GTK message_box is requried, the use_gtk flag can be enabled
"""
print 'gfceu message: '+message
if use_gtk:
msgbox = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_INFO,
buttons=gtk.BUTTONS_CLOSE)
msgbox.set_markup(message)
msgbox.run()
msgbox.destroy()
def gfceu_error(message, code, use_gtk=True, fatal=True):
"""
gfceu_error()
TODO: This can be reworked to use the raise/except methods already defined
in the standard python language. One of these days...
"""
print '# # # #'
print 'gfceu ERROR code '+str(code)+':'
print message
print '# # # #'
if use_gtk:
msgbox = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_ERROR,
buttons=gtk.BUTTONS_CLOSE)
msgbox.set_markup('gfceu ERROR Code '+str(code)+':\n'+message)
msgbox.run()
msgbox.destroy()
if fatal:
sys.exit(code)
# # # # # # # #
# Import libraries
try:
import pytgtk
pygtk.require("2.6")
except:
pass
try:
import gtk
except ImportError:
gfceu_error('The PyGTK libraries cannot be found.\n\
Ensure that PyGTK (>=2.0) is installed on this system.\n\
On Debian based systems (like Ubuntu), try this command:\n\
sudo apt-get install python-gtk2 libgtk2.0-0', 1, False)
try:
import gtk.glade
except ImportError:
gfceu_error('The glade libraries cannot be found.\n\
Ensure that libglade is installed on this system.\n\
On Debian based systems (like Ubuntu), try this command:\n\
sudo apt-get install libglade2-0 python-gtk2 python-glade2', 2, False)
try:
import gnomevfs
have_gnomevfs = True
except ImportError:
gfceu_error('The gnomevfs libraries cannot be found.\n\
To enable ROM loading over the network, ensure that gnomevfs is installed on\
this system.\n\
On Debian based systems (like Ubuntu), try this command:\n\
sudo apt-get install python-gtk2 libgnomevfs2-0', 5, False, False)
have_gnomevfs = False
# # # # # # # #
# GFCEU Functions
class game_options:
sound_check = True
fullscreen_check = False
extra_entry = ''
romfile = ''
opengl_check = False
join_radio = False
join_add = ''
join_port = 4046
join_pass = ''
host_radio = False
host_port = 4046
host_pass = ''
no_network_radio = True
network_rom = False
def load_options():
global options, optionsfile
try:
ifile = file(optionsfile, 'r')
options = pickle.load(ifile)
pickle.load(ifile)
except:
return
ifile.close()
def save_options():
global options, optionsfile, appconfigdir
ofile = file(optionsfile, 'w')
pickle.dump(options, ofile)
ofile.close()
def give_widgets():
"""
give_widgets()
This function takes data from the options struct and relays it to
the GTK window
"""
global xml, options
try:
widgets['rom_entry'].set_text(options.romfile)
widgets['sound_check'].set_active(options.sound_check)
widgets['fullscreen_check'].set_active(options.fullscreen_check)
widgets['opengl_check'].set_active(options.opengl_check)
widgets['extra_entry'].set_text(options.extra_entry)
# Usability point:
# Users will probably not want to remember their previous network setting.
# Users may accidently be connecting to a remote server/hosting a game when
# they were unaware.
# No network is being set by default
widgets['no_network_radio'].set_active(True)
widgets['join_add'].set_text(options.join_add)
widgets['join_port'].set_value(float(options.join_port))
widgets['join_pass'].set_text(options.join_pass)
widgets['host_port'].set_value(float(options.host_port))
widgets['host_pass'].set_text(options.host_pass)
except AttributeError:
# When new widgets are added, old pickle files might break.
options = game_options()
give_widgets()
def setup_environment ():
"""
Configures the environment if this is the first time the application
has been run. For instance, it checks for the options file and creates
it if it doesn't exist. It also converts between the old version and
the new version of this application, which stores the options file in
a separate directory.
"""
global appconfigdir, old_optionsfile, optionsfile
if not os.path.exists(appconfigdir):
# this is the first time the application is run.
# create the directory
gfceu_message("Creating application settings directory")
os.mkdir(appconfigdir)
if os.path.exists(old_optionsfile):
# for full backwards compatibility, this file is processed, but moved
# to the new directory and filename for future compatibility
gfceu_message("Old version of options file found, converting to new version")
shutil.move(old_optionsfile,optionsfile)
def set_options():
"""
set_options()
This function grabs all of the data from the GTK widgets
and stores it in the options object.
"""
global xml
options.romfile = widgets['rom_entry'].get_text()
options.sound_check = widgets['sound_check'].get_active()
options.fullscreen_check = widgets['fullscreen_check'].get_active()
options.opengl_check = widgets['opengl_check'].get_active()
options.extra_entry = widgets['extra_entry'].get_text()
options.join_radio = widgets['join_radio'].get_active()
options.host_radio = widgets['host_radio'].get_active()
options.no_network_radio = widgets['no_network_radio'].get_active()
options.join_add = widgets['join_add'].get_text()
options.join_port = widgets['join_port'].get_value()
options.join_pass = widgets['join_pass'].get_text()
options.host_port = widgets['host_port'].get_value()
options.host_pass = widgets['host_pass'].get_text()
def launch(passed, local=False):
global xml, options, fceu_server_binary, fceu_binary, aoss_binary
set_options()
if options.sound_check:
sound = '-sound 1 '
else:
sound = '-sound 0 '
if options.fullscreen_check:
fullscreen = '-fs 1 '
else:
fullscreen = '-fs 0 '
if options.join_radio:
if options.join_pass == '':
netpass = ''
else:
netpass = '-netpassword ' + '"' + options.join_pass + '" '
network = '-connect "' + options.join_add + '"'\
' -netport '+ str(options.join_port) + ' ' + netpass
else:
network = ''
if options.host_radio:
if options.host_pass == '':
netpass = ' '
else:
netpass = ' -netpassword ' + '"' + options.host_pass + '" '
network = '-connect localhost -netport '+\
str(options.host_port) + netpass + ' '
if local:
network = ''
if options.opengl_check:
opengl = '-opengl 1 '
else:
opengl = '-opengl 0 '
command = aoss_binary + ' ' + fceu_binary +' '+ sound + fullscreen +\
network + opengl + options.extra_entry + ' '+ passed
gfceu_message('Command: ' + command)
if options.host_radio:
xterm_binary = find_binary("xterm")
if xterm_binary == None:
gfceu_error("Cannot find xterm on this system. You will not \n\
be informed of server output.", 102, True, False)
args = [fceu_server_binary]
else:
args = [xterm_binary, "-e", fceu_server_binary]
args.append('--port')
args.append(str(options.host_port))
if options.host_pass:
args.append("--password")
args.append(options.host_pass)
pid = Popen(args).pid
widgets['main_window'].hide()
# os.system() is a blocker, so we must force
# gtk to process our events.
while gtk.events_pending():
gtk.main_iteration_do()
os.system(command)
if options.host_radio:
os.kill(pid, 9)
widgets['main_window'].show()
def find_binary(this_binary):
path = os.getenv('PATH')
directories= []
directory = ''
# check for '$' so last entry is processed
for x in path + '$':
if x != ':' and x != '$':
directory = directory + x
else:
directories.append(directory)
directory = ''
for x in directories:
if os.path.isfile(os.path.join(x, this_binary)):
return os.path.join(x,this_binary)
if os.path.isfile(os.path.join(os.curdir,this_binary)):
return os.path.join(os.curdir, this_binary)
return None
# # # # # # # #
# GTK Signal Handlers
class GladeHandlers:
def launch_button_clicked(arg1):
global xml
global options
options.romfile = widgets['rom_entry'].get_text()
if widgets['rom_entry'].get_text() == '':
gfceu_message('Please specify a ROM to open in the main tab.', True)
return
if options.network_rom:
try:
myvfs = gnomevfs.Handle(options.romfile)
# FIXME
# Smarter way of handling this? Copying direct error information?
except gnomevfs.HostNotFoundError:
gfceu_error("Remote ROM host not found.", 7, True, False)
return
except:
gfceu_error("Failed to open the network ROM.", 6, True, False)
return
myfile = file('/tmp/gfceu.nes', 'wb')
while 1:
try:
myfile.write(myvfs.read(1024))
except gnomevfs.EOFError:
break
except:
gfceu_error("Failed to open the network ROM.", 10, True, False)
return
myvfs.close()
myfile.close()
romfile = '/tmp/gfceu.nes'
else:
romfile = options.romfile
launch('"'+romfile+'"')
def about_button_clicked(arg1):
global xml
widgets['about_dialog'].set_name('GNOME FCE Ultra '+version)
widgets['about_dialog'].run()
widgets['about_dialog'].hide()
def browse_button_clicked(widget):
global xml,options
set_options()
chooser = gtk.FileChooserDialog("Open...", None,
gtk.FILE_CHOOSER_ACTION_OPEN,
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN, gtk.RESPONSE_OK))
if have_gnomevfs:
chooser.set_property("local-only", False)
else:
chooser.set_property("local-only", True)
chooser.set_default_response(gtk.RESPONSE_OK)
filter=gtk.FileFilter()
filter.set_name("NES Roms")
filter.add_mime_type("application/x-nes-rom")
filter.add_mime_type("application/zip")
filter.add_pattern("*.nes")
filter.add_pattern("*.zip")
chooser.add_filter(filter)
filter = gtk.FileFilter()
filter.set_name("All files")
filter.add_pattern("*")
chooser.add_filter(filter)
if options.romfile == '':
folder = os.getenv('HOME')
else:
folder = os.path.split(options.romfile)[0]
chooser.set_current_folder (folder)
response = chooser.run()
chooser.hide()
if response == gtk.RESPONSE_OK:
if chooser.get_filename():
x = chooser.get_filename()
widgets['rom_entry'].set_text(x)
options.romfile = x
options.network_rom = False
elif chooser.get_uri():
x = chooser.get_uri()
widgets['rom_entry'].set_text(x)
options.romfile = x
options.network_rom = True
def gamepad_clicked(widget):
print widget.name
d = {'gp1_button' : '1',
'gp2_button' : '2',
'gp3_button' : '3',
'gp4_button' : '4'}
command = '-inputcfg gamepad' + d[widget.name] + ' /dev/null'
launch(command, True)
def config_help_button_clicked(arg1):
msgbox = gtk.MessageDialog(parent=None, flags=0,
type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_CLOSE)
msgbox.set_markup("Once a gamepad is seleceted, a titlebar will be displayed\
indicating a NES button. Press the button or key you would like to have\
associated with the button indicated on the titlebar. This process\
will repeat until all buttons on the gamepad are configured.")
msgbox.run()
msgbox.hide()
def join_radio_clicked(arg1):
global options
widgets['join_frame'].set_sensitive(True)
widgets['host_frame'].set_sensitive(False)
options.join_radio = True
options.host_radio = False
options.no_network_radio = False
def host_radio_clicked(arg1):
global fceu_server_binary
if widgets['host_radio'].get_active():
fceu_server_binary = find_binary('fceu-server')
if fceu_server_binary == None:
if os.name == 'nt':
gfceu_error("The fceu server software cannot be found. \n\
Ensure that it is installed in the same directory as \n\
GFCE Ultra.", 102, True, False)
else:
gfceu_error("The fceu server software cannot be found on \n\
this system. Ensure that it is installed and in your path.",
101, True, False)
widgets['no_network_radio'].set_active(True)
options.no_network_radio = True
return False
gfceu_message("Using: "+fceu_server_binary)
widgets['join_frame'].set_sensitive(False)
widgets['host_frame'].set_sensitive(True)
options.join_radio = False
options.host_radio = True
options.no_network_radio = False
def no_network_radio_clicked(arg1):
widgets['join_frame'].set_sensitive(False)
widgets['host_frame'].set_sensitive(False)
options.join_radio = False
options.host_radio = False
options.no_network_radio = True
def end(widget,arg=0):
global xml, options, optionsfile
set_options()
save_options()
gtk.main_quit()
##############################################################################
# Globals
options = None
appconfigdir = os.getenv('HOME') + '/.gfceu'
old_optionsfile = os.getenv('HOME')+'/.gfceu_options'
optionsfile = appconfigdir + 'gfceu_options.dat'
fceu_binary = None
aoss_binary = None
fceu_server_binary = None
#version is defined earlier in the code
#have_vfs is defined earlier in the code
class WidgetsWrapper:
def __init__(self):
# Search for the glade file
# Check first in the directory of this script.
if os.path.isfile('gfceu.glade'):
glade_file = 'gfceu.glade'
# Then check to see if its installed on a *nix system
elif os.path.isfile(os.path.join(os.path.dirname(sys.executable), '../share/gfceu/gfceu.glade')):
glade_file = os.path.join(os.path.dirname(sys.executable), '../share/gfceu/gfceu.glade')
else:
print 'ERROR.'
print 'Could not find the glade interface file.'
print 'Try reinstalling the application.'
sys.exit(1)
self.widgets = gtk.glade.XML(glade_file)
self.widgets.signal_autoconnect(GladeHandlers.__dict__)
def __getitem__(self, key):
return self.widgets.get_widget(key)
# # # # # # # #
# main
if __name__ == '__main__':
# Parse options
parser = OptionParser(version='%prog '+ version)
parser.parse_args()
fceu_binary = find_binary('fceu')
if fceu_binary == None:
gfceu_error('Could not find the fceu binary.\n\
Ensure that FCE Ultra is installed and in the $PATH.\n\
On Debian based systems (like Ubuntu), try the following command:\n\
sudo apt-get install fceu', 4, True)
else:
gfceu_message('Using: '+fceu_binary)
aoss_binary = find_binary('aoss')
if aoss_binary == None:
gfceu_error('Could not find the the ALSA OSS wrapper.\n\
GFCEU will not be able to share the sound device with other applications.\n\
On Debian based systems (like Ubuntu), try the following command:\n\
sudo apt-get install alsa-oss', 76, True, False)
widgets = WidgetsWrapper()
widgets['main_window'].show_all()
setup_environment()
options = game_options()
load_options()
give_widgets()
try:
gtk.main()
except KeyboardInterrupt:
sys.exit(0)

19
gfceu/gfceu.1 Normal file
View File

@ -0,0 +1,19 @@
.TH gfceu 1 "July 17 2006" "Lukas Sabota"
.SH NAME
GNOME FCE Ultra - A graphical front-end for FCE Ultra
.SH SYNOPSIS
.B gfceu
.BR [options]
.PP
.SH DESCRIPTION
GFCE Ultra is a graphical front-end for FCE Ultra, an advanced Nintendo Entertainment System emulator. The program allows easy control over various options including input, network, video, and sound. It uses the GTK+2 library and optionally GNOMEVFS.
.SH OPTIONS
.TP
.B --version
Displays the version number of the application
.TP
.B --help
Displays a help message displaying options
.SH AUTHOR
.TP
Written for Ubuntu/Debian by Lukas Sabota.

View File

@ -1,10 +1,10 @@
[Desktop Entry]
Encoding=UTF-8
Name=FCEUX NES Emulator
Name=GFCE Ultra NES Emulator
Comment=Play Nintendo ROM files
Exec=gfceux
Exec=gfceu
Terminal=false
Type=Application
StartupNotify=true
Icon=gfceux
Icon=gfceu
Categories=GNOME;GTK;Game;

767
gfceu/gfceu.glade Normal file
View File

@ -0,0 +1,767 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--*- mode: xml -*-->
<glade-interface>
<widget class="GtkWindow" id="main_window">
<property name="visible">True</property>
<property name="title">GFCE Ultra</property>
<property name="default_width">442</property>
<property name="icon">gfceu.png</property>
<signal name="delete_event" handler="end"/>
<child>
<widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="border_width">1</property>
<child>
<widget class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">3</property>
<child>
<widget class="GtkVBox" id="main_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
<widget class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">ROM Filename:</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="rom_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="browse_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Browse...</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="browse_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="sound_check">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Enable _Sound</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="label" translatable="yes">Main</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="input_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkHBox" id="hbox6">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="stock">gtk-dialog-info</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">Select an NES gamepad to configure.</property>
<property name="wrap">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">7</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="button_table">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
<widget class="GtkButton" id="gp1_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Gamepad _1</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="gamepad_clicked" after="yes"/>
</widget>
<packing>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="gp2_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Gamepad _2</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="gamepad_clicked" after="yes"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="gp4_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Gamepad _4</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="gamepad_clicked" after="yes"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="gp3_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Gamepad _3</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="gamepad_clicked" after="yes"/>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="config_help_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-help</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="config_help_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="label" translatable="yes">Input</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="video_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkCheckButton" id="opengl_check">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Enable _OpenGL Rendering</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="fullscreen_check">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Enable _Full Screen</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="screentip">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;(Press Alt+Enter to toggle fullscreen in-game.)&lt;/i&gt;&lt;/small&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="label" translatable="yes">Video</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="advanced_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkHBox" id="hbox11">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="stock">gtk-dialog-info</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="advanced_info">
<property name="visible">True</property>
<property name="label" translatable="yes">If you would like to specify any command line options to FCE Ultra, specify them below. For a complete option reference, consult the official FCE Ultra documentation.
Invalid options may cause GFCE Ultra to perform incorrectly.
</property>
<property name="wrap">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox12">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label24">
<property name="visible">True</property>
<property name="label" translatable="yes">Extra Parameters: </property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="extra_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label22">
<property name="visible">True</property>
<property name="label" translatable="yes">Advanced</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="network_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkRadioButton" id="host_radio">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Host Game</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="host_radio_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="host_frame">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment6">
<property name="visible">True</property>
<property name="left_padding">19</property>
<child>
<widget class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
<widget class="GtkLabel" id="label19">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Port:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label20">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Password:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="host_port">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">4046 1 65536 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="host_pass">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="join_radio">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Join Game</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
<property name="group">host_radio</property>
<signal name="toggled" handler="join_radio_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="join_frame">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="left_padding">19</property>
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">3</property>
<property name="row_spacing">5</property>
<child>
<widget class="GtkEntry" id="join_add">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="join_pass">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
<property name="invisible_char">*</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label15">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Server Address:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label16">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Server Port:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label17">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Password:</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="join_port">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">4046 1 65536 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="no_network_radio">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_No Network</property>
<property name="use_underline">True</property>
<property name="response_id">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">host_radio</property>
<signal name="toggled" handler="no_network_radio_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
</widget>
<packing>
<property name="position">4</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="label" translatable="yes">Network</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="position">4</property>
<property name="tab_fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">10</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox9">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
<widget class="GtkHBox" id="hbox10">
<property name="visible">True</property>
<property name="border_width">3</property>
<child>
<widget class="GtkButton" id="launch_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="label">gtk-execute</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="launch_button_clicked"/>
</widget>
<packing>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="about_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-about</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="about_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="quit_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-quit</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
<signal name="clicked" handler="end"/>
</widget>
<packing>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkAboutDialog" id="about_dialog">
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="copyright" translatable="yes">(C) Copyright 2008</property>
<property name="comments" translatable="yes">A GNOME front-end end for the FCE Ultra Nintendo Entertainment System emulator</property>
<property name="website">http://dietschnitzel.com/gfceu/</property>
<property name="license" translatable="yes">This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</property>
<property name="authors">Lukas Sabota
&lt;ltsmooth42@gmail.comt&gt;
Patch writers:
Scott Brown</property>
<property name="translator_credits" translatable="yes" comments="TRANSLATORS: Replace this string with your names, one name per line.">translator-credits</property>
<property name="artists">Sketching:
J. Sammer
Digital Manipulation:
C. Kontros
Artwork for old versions (&lt; 0.2.7):
Jimmy Angelakos
&lt;vyruss000@gmail.com&gt;</property>
<property name="logo">gfceu_big.png</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

BIN
gfceu/gfceu_big_old.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

761
gfceu/gfceu_french.glade Normal file
View File

@ -0,0 +1,761 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--*- mode: xml -*-->
<glade-interface>
<widget class="GtkWindow" id="main_window">
<property name="visible">True</property>
<property name="title">GFCE Ultra</property>
<property name="default_width">442</property>
<property name="icon">gfceu.png</property>
<signal name="delete_event" handler="end"/>
<child>
<widget class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="border_width">1</property>
<child>
<widget class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">3</property>
<child>
<widget class="GtkVBox" id="main_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="spacing">5</property>
<child>
<widget class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="xpad">5</property>
<property name="label" translatable="yes">Fichier ROM:</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="rom_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="browse_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Parcourir...</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="browse_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="sound_check">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Activer _Son</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="label" translatable="yes">Général</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="input_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkHBox" id="hbox6">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="stock">gtk-dialog-info</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="label" translatable="yes">Sélectionner un gamepad NES à configurer.</property>
<property name="wrap">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">7</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="button_table">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
<widget class="GtkButton" id="gp1_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Gamepad _1</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="gamepad_clicked" after="yes"/>
</widget>
<packing>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="gp2_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Gamepad _2</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="gamepad_clicked" after="yes"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="gp4_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Gamepad _4</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="gamepad_clicked" after="yes"/>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkButton" id="gp3_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Gamepad _3</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="gamepad_clicked" after="yes"/>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="config_help_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-help</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="config_help_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
<property name="tab_expand">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="label" translatable="yes">Manette</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="position">1</property>
<property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="video_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkCheckButton" id="opengl_check">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Permettre le rendu _OpenGL</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="fullscreen_check">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Permettre le _plein écran</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="screentip">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;small&gt;&lt;i&gt;(Presser Alt+Entrée pour permutter.)&lt;/i&gt;&lt;/small&gt;</property>
<property name="use_markup">True</property>
<property name="wrap">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
<packing>
<property name="position">2</property>
<property name="tab_expand">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label21">
<property name="visible">True</property>
<property name="label" translatable="yes">Vidéo</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="position">2</property>
<property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="advanced_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkHBox" id="hbox11">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="stock">gtk-dialog-info</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="advanced_info">
<property name="visible">True</property>
<property name="label" translatable="yes">Si vous voulez spécifier des paramètres pour FCE Ultra, faîtes-le ci-dessous. Consultez la documentation officielle FCE Ultra.
De mauvaises options dégradent les performances.
</property>
<property name="wrap">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox12">
<property name="visible">True</property>
<child>
<widget class="GtkLabel" id="label24">
<property name="visible">True</property>
<property name="label" translatable="yes">Extra Paramètres: </property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="padding">5</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="extra_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="padding">5</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
<packing>
<property name="position">3</property>
<property name="tab_expand">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label22">
<property name="visible">True</property>
<property name="label" translatable="yes">Avancé</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="position">3</property>
<property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="network_vbox">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="spacing">5</property>
<child>
<widget class="GtkRadioButton" id="host_radio">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Jeu _hôte</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="host_radio_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="host_frame">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment6">
<property name="visible">True</property>
<property name="left_padding">19</property>
<child>
<widget class="GtkTable" id="table2">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="column_spacing">5</property>
<property name="row_spacing">5</property>
<child>
<widget class="GtkLabel" id="label19">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Port:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label20">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Mot de passe:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="host_port">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">4046 1 65536 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="host_pass">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="join_radio">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Joindre le jeu</property>
<property name="use_underline">True</property>
<property name="draw_indicator">True</property>
<property name="group">host_radio</property>
<signal name="toggled" handler="join_radio_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="join_frame">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="label_xalign">0</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<child>
<widget class="GtkAlignment" id="alignment5">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="left_padding">19</property>
<child>
<widget class="GtkTable" id="table1">
<property name="visible">True</property>
<property name="border_width">5</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="column_spacing">3</property>
<property name="row_spacing">5</property>
<child>
<widget class="GtkEntry" id="join_add">
<property name="visible">True</property>
<property name="can_focus">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="join_pass">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="visibility">False</property>
<property name="invisible_char">*</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label15">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Addresse Serveur:</property>
</widget>
<packing>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label16">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Server Port:</property>
</widget>
<packing>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label17">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Mot de passe:</property>
</widget>
<packing>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="join_port">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="adjustment">4046 1 65536 1 10 10</property>
<property name="climb_rate">1</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">3</property>
</packing>
</child>
<child>
<widget class="GtkRadioButton" id="no_network_radio">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Pas de Réseau</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">host_radio</property>
<signal name="toggled" handler="no_network_radio_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">4</property>
</packing>
</child>
</widget>
<packing>
<property name="position">4</property>
<property name="tab_expand">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label13">
<property name="visible">True</property>
<property name="label" translatable="yes">Réseau</property>
</widget>
<packing>
<property name="type">tab</property>
<property name="position">4</property>
<property name="tab_expand">False</property>
<property name="tab_fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">10</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox9">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<child>
<widget class="GtkHBox" id="hbox10">
<property name="visible">True</property>
<property name="border_width">3</property>
<child>
<widget class="GtkButton" id="launch_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="label">gtk-execute</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="launch_button_clicked"/>
</widget>
<packing>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="about_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-about</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="about_button_clicked"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkButton" id="quit_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-quit</property>
<property name="use_stock">True</property>
<signal name="clicked" handler="end"/>
</widget>
<packing>
<property name="fill">False</property>
<property name="position">2</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkAboutDialog" id="about_dialog">
<property name="copyright" translatable="yes">(C) Copyright 2006</property>
<property name="comments" translatable="yes">Une interface GNOME pour l'émulateur FCE Ultra Nintendo Entertainment System</property>
<property name="website">http://gfceu.thepiratecove.org/</property>
<property name="license" translatable="yes">Logiciel Libre; vous pouvez le redistribuer et/ou le modifier
tant que vous respectez la licence GNU General Public
de la Free Software Foundation; de la version 2, ou de la dernière version.
Ce programme est distribué dans l'espoir d'être utile,
mais SANS AUCUNE GARANTIE... Voir la licence
GNU General Publicpour plus de détails.
Si vous ne disposez pas dela licence GNU General Public
écrivez à la the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.</property>
<property name="authors">Lukas Sabota
&lt;punkrockguy318@comcast.net&gt;
Patch Writers:
Scott Brown</property>
<property name="translator_credits" translatable="yes" comments="TRANSLATORS: Replace this string with your names, one name per line.">translator-credits</property>
<property name="artists">Sketching:
J. Sammer
Digital Manipulation:
C. Kontros
Artwork for old versions (&lt; 0.2.7):
Jimmy Angelakos
&lt;vyruss000@gmail.com&gt;</property>
<property name="logo">gfceu_big.png</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<child>
<placeholder/>
</child>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

BIN
gfceu/gfceu_old.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

15
gfceu/setup.py Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env python
from distutils.core import setup
setup(name="gfceu",
version="0.6.1",
scripts = ['gfceu'],
data_files=[('share/gfceu/',['gfceu.glade', 'gfceu_big.png', 'gfceu.png']),
('share/pixmaps/', ['gfceu.png']),
('share/man/man1/', ['gfceu.1']),
('share/applications/', ['gfceu.desktop'])],
author = "Lukas Sabota",
author_email = "ltsmooth42 _at_ gmail.com",
url = "http://dietschnitzel.com/gfceu"
)

40
gfceu/status_window.py Normal file
View File

@ -0,0 +1,40 @@
#!/usr/bin/env python
# A cool thing that i don't feel like explaining
import gtk
import gobject
import os
class shit:
def __init__(self, command, title="Status Window"):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_default_size(400,300)
self.window.set_title(title)
self.scroll = gtk.ScrolledWindow()
self.scroll.set_property("hscrollbar-policy", gtk.POLICY_NEVER)
self.buffer = gtk.TextBuffer()
self.text_view = gtk.TextView(self.buffer)
self.text_view.set_editable(False)
self.window.add(self.scroll)
self.scroll.add(self.text_view)
gobject.timeout_add(10, self.get_output)
self.handle = os.popen(command, "r",1)
self.add(self.handle.readlines())
def get_output(self):
self.add(self.handle.read())
def show(self):
self.window.show_all()
def hide(self):
self.window.hide_all()
def add(self, string):
self.buffer.insert_at_cursor(string)
myshit = shit("fceu-server", "THE StatUZ")
myshit.show()
gtk.main()

21
gfceux
View File

@ -1,21 +0,0 @@
#!/usr/bin/env python
#
# GTK2 GUI for FCE UltraX
#
# Lukas Sabota <ltsmooth42 _at_ gmail _dot_ com>
#
# <http://fceux.com>
import platform
import sys
if platform.python_version() < '2.5.0':
print "Python version too old, use one greater than 2.5.0";
sys.exit();
try:
from src import main
except:
from gfceux import main
app = main.GfceuxApp()

View File

@ -1,24 +0,0 @@
#!/usr/bin/env python
from distutils.core import setup
setup(name="gfceux",
version="2.2svn",
scripts = ['gfceux'],
packages = ['gfceux'],
package_dir = {'gfceux': 'src'},
data_files=[
('share/gfceux/',
['data/gfceux.glade', 'data/gfceux_big.png', 'data/gfceux.png',
'COPYING']),
('share/pixmaps/',
['data/gfceux.png']),
('share/man/man1/',
['data/gfceux.1']),
('share/applications/',
['data/gfceux.desktop'])],
author = "Lukas Sabota",
author_email = "ltsmooth42 _at_ gmail.com",
url = "http://dietschnitzel.com/gfceu"
)

View File

@ -1 +0,0 @@
__all__ = ["gfceux"]

View File

@ -1,101 +0,0 @@
#!/usr/bin/env python
# config_parse.py
# This module handles the reading and writing of keys to the fceux
# config file.
#
# Lukas Sabota
# Licensed under the GPL
import re
import os
class FceuxConfigParser:
def __init__(self, filename):
self.fn = filename
def _open(self, mode):
try:
self.f = open(self.fn, mode)
return 1
except:
if mode == "r":
print "Can't open config for reading."
else:
print "Couldn't write to the config."
return 0
def readKey(self, keyname):
""" readKey()
reads a key from the configfile and returns the value
"""
self._open("r")
# do some lines
while 1:
line = self.f.readline()
if line == 0:
break
if re.search(keyname, line):
self._close()
return line
# key not found
self.f.close()
return None
def addKey(self, keyname, value=""):
""" addKey()
adds a key with a (optional) value to the config file.
"""
self._open("a")
self.f.write(keyname + " = " + str(value))
self.f.close()
def writeKey(self, keyname, value):
""" writeKey()
modifies an existing key in the config file.
"""
self._open("r")
buf = ""
cursor = 0
# find the key
while 1:
data = self.f.read(keyname.__len__())
buf += data
if data == "":
print "key " + keyname + " not found"
return None
if data == keyname:
break
else:
buf += self.f.readline()
print value
buf += self.f.read(3)
buf += str(value)
buf += '\n'
# ignore the rest of the old line
self.f.readline()
# read the rest of the file
while 1:
data = self.f.readline()
if data == "":
break
buf += data
self.f.close()
# write the buffer to the config file
self._open('w')
self.f.write(buf)
self.f.close()

View File

@ -1,52 +0,0 @@
#!/usr/bin/env python
# get_key.py - an sdl keygrabber for gfceux
# Lukas Sabota
# December 2008
#
# Licensed under the GPL
#
import sys
try:
import pygame
from pygame.locals import *
has_pygame = True
except ImportError:
self.has_pygame = False
class KeyGrabber:
""" KeyGrabber is a wrapper that gets an SDL key from the user using pygame """
def __init__(self, width=800, height=100):
pygame.init()
pygame.joystick.init()
if pygame.joystick.get_count() > 0:
for x in range(0, pygame.joystick.get_count()):
joy = pygame.joystick.Joystick(x)
joy.init()
print "joystick " + str(x) + " initialized."
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("Press any key. . .")
def get_key(self):
""" returns a tuple with information about the key pressed
(device_string, key_number, joy_number) """
while 1:
for event in pygame.event.get():
if event.type == KEYDOWN:
pygame.display.quit()
return ("Keyboard", event.key)
if event.type == JOYBUTTONDOWN:
pygame.display.quit()
return ("Joystick", event.button, event.joy)
# TODO: figure out how fceux saves axes and hat movements and implement
# this might even be easier if we just make the C++ fceux code more modular
# and use a C++ snippet based off code in drivers/sdl/input.cpp and drivers/sdl/sdl-joystick.cpp
#if event.type == JOYAXISMOTION:
# pygame.display.quit()
# return event.joy, event.axis, event.value
if __name__ == "__main__":
kg = KeyGrabber()
print kg.get_key()

View File

@ -1,657 +0,0 @@
#!/usr/bin/python
# gfceux - Graphical launcher for fceux.
# Designed on Ubuntu, with platfrom independence in mind.
version = "2.2svn"
title = "gfceux"
# Copyright (C) 2008 Lukas Sabota <ltsmooth42 _at_ gmail.com>
##
"""
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
# # # # # # # #
# Python imports
import sys
import os
import pickle
import shutil
#from optparse import OptionParser
#from config_parse import FceuxConfigParser
#import get_key
#from subprocess import Popen
try:
import pygtk
pygtk.require("2.0")
import gtk
except ImportError:
print "The PyGTK libraries cannot be found.\n\
Ensure that PyGTK (>=2.12) is installed on this system.\n\
On Debian based systems (like Ubuntu), try this command:\n\
sudo apt-get install python-gtk2 libgtk2.0-0"
class GameOptions:
# sound
sound_check = True
soundq_check = True
soundrate_entry = "11000"
soundbufsize_entry = "48"
# video
fullscreen_check = False
xscale_spin = 2
yscale_spin = 2
bpp_combo = 32
opengl_check = False
autoscale_check = True
# main
extra_entry = ''
romfile = ''
moviefile = ''
luafile = ''
# network
join_radio = False
join_add = ''
join_port = 4046
join_pass = ''
host_radio = False
host_port = 4046
host_pass = ''
no_network_radio = True
def load_options():
global options, optionsfile
try:
ifile = file(optionsfile, 'r')
options = pickle.load(ifile)
pickle.load(ifile)
except:
return
ifile.close()
def save_options():
global options, optionsfile
if os.path.exists(os.path.dirname(optionsfile)) == 0:
os.mkdir(os.path.dirname(optionsfile))
ofile = open(optionsfile, 'w')
pickle.dump(options, ofile)
ofile.close()
def give_widgets():
"""
give_widgets()
This function takes data from the options struct and relays it to
the GTK window
"""
global options, widgets
try:
widgets.get_object("rom_entry").set_text(options.romfile)
widgets.get_object("movie_entry").set_text(options.moviefile)
widgets.get_object("lua_entry").set_text(options.luafile)
# sound
widgets.get_object("sound_check").set_active(options.sound_check)
widgets.get_object("soundq_check").set_active(options.soundq_check)
widgets.get_object("soundrate_entry").set_text(options.soundrate_entry)
widgets.get_object("soundbufsize_entry").set_text(options.soundbufsize_entry)
# video
widgets.get_object("fullscreen_check").set_active(options.fullscreen_check)
widgets.get_object("opengl_check").set_active(options.opengl_check)
widgets.get_object("autoscale_check").set_active(options.autoscale_check)
# set/unset sensitivity on manual scaling
# TODO: idk if i like this really
#if widgets.get_object("autoscale_check").get_active():
# widgets.get_object("scaling_frame").set_sensitive(False)
#else:
# widgets.get_object("scaling_frame").set_sensitive(True)
widgets.get_object("xscale_spin").set_value(options.xscale_spin)
widgets.get_object("yscale_spin").set_value(options.yscale_spin)
widgets.get_object("extra_entry").set_text(options.extra_entry)
# Usability point:
# Users will probably not want to remember their previous network setting.
# Users may accidently be connecting to a remote server/hosting a game when
# they were unaware.
# No network is being set by default
widgets.get_object("no_network_radio").set_active(True)
widgets.get_object("join_add").set_text(options.join_add)
widgets.get_object("join_port").set_value(float(options.join_port))
widgets.get_object("join_pass").set_text(options.join_pass)
widgets.get_object("host_port").set_value(float(options.host_port))
widgets.get_object("host_pass").set_text(options.host_pass)
except AttributeError:
# When new widgets are added, old pickle files might break.
options = GameOptions()
give_widgets()
def set_options():
"""
set_options()
This function grabs all of the data from the GTK widgets
and stores it in the options object.
"""
options.romfile = widgets.get_object("rom_entry").get_text()
options.moviefile = widgets.get_object("movie_entry").get_text()
options.luafile = widgets.get_object("lua_entry").get_text()
# sound
options.sound_check = widgets.get_object("sound_check").get_active()
options.soundq_check = widgets.get_object("soundq_check").get_active()
options.soundrate_entry = widgets.get_object("soundrate_entry").get_text()
options.soundbufsize_entry = widgets.get_object("soundbufsize_entry").get_text()
# video
options.fullscreen_check = widgets.get_object("fullscreen_check").get_active()
options.opengl_check = widgets.get_object("opengl_check").get_active()
options.autoscale_check = widgets.get_object("autoscale_check").get_active()
options.xscale_spin = widgets.get_object("xscale_spin").get_value()
options.yscale_spin = widgets.get_object("yscale_spin").get_value()
options.extra_entry = widgets.get_object("extra_entry").get_text()
options.join_radio = widgets.get_object("join_radio").get_active()
options.host_radio = widgets.get_object("host_radio").get_active()
options.no_network_radio = widgets.get_object("no_network_radio").get_active()
options.join_add = widgets.get_object("join_add").get_text()
options.join_port = int(widgets.get_object("join_port").get_value())
options.join_pass = widgets.get_object("join_pass").get_text()
options.host_port = widgets.get_object("host_port").get_value()
options.host_pass = widgets.get_object("host_pass").get_text()
def find_binary(file):
# first check the script directory
if os.path.isfile(os.path.join(os.path.dirname(sys.argv[0]),file)):
return os.path.join(os.path.dirname(sys.argv[0]), file)
# if not in the script directory, check the $PATH
path = os.getenv('PATH')
directories= []
directory = ''
# check for '$' so last entry is processed
for x in path + '$':
if x != ':' and x != '$':
directory = directory + x
else:
directories.append(directory)
directory = ''
for x in directories:
if os.path.isfile(os.path.join(x, file)):
return os.path.join(x,file)
return None
# # # # # # # # # # # # # # # # #
# Globals
options = None
configfile = os.getenv('HOME') + '/.fceux/fceux.cfg'
optionsfile = os.getenv('HOME') + '/.fceux/gfceux_options.dat'
widgets = None
class GfceuxApp:
def __init__(self):
self.fceux_binary = self.find_fceux()
self.load_ui()
self.create_config()
options = GameOptions()
load_options()
give_widgets()
try:
gtk.main()
except KeyboardInterrupt:
sys.exit(0)
def create_config(self):
if os.path.exists(configfile) == False:
# auto generate a default config by running fceux with no options
os.system(find_binary("fceux"))
def msg(self, text, use_gtk=False):
"""
GfceuApp.msg()
This function prints messages to the user. This is generally used for status
messages. If a GTK message_box is requried, the use_gtk flag can be enabled.
"""
print text
if use_gtk:
msgbox = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_INFO,
buttons=gtk.BUTTONS_CLOSE)
msgbox.set_markup(text)
msgbox.run()
msgbox.destroy()
def print_error(self, message, code, use_gtk=True, fatal=True):
"""
GfceuApp.print_error()
Presents the user with an error message and optionally quits the program.
"""
print title + ' error code '+str(code)+': ' + message
if use_gtk:
msgbox = gtk.MessageDialog(parent=None, flags=0, type=gtk.MESSAGE_ERROR,
buttons=gtk.BUTTONS_CLOSE)
msgbox.set_markup(title + ' ERROR Code '+str(code)+':\n'+message)
msgbox.run()
msgbox.destroy()
if fatal:
sys.exit(code)
def find_fceux(self):
bin = find_binary('fceux')
if bin == None:
self.print_error('Could not find the fceux binary.\n\
Ensure that fceux is installed and in the $PATH.\n', 4, True)
else:
self.msg('Using: ' + bin)
return bin
def load_ui(self):
global widgets
""" Search for the glade XML file and load it """
# Check first in the directory of this script.
if os.path.isfile('data/gfceux.glade'):
glade_file = 'data/gfceux.glade'
# Then check to see if its installed on a *nix system
elif os.path.isfile(os.path.join(os.path.dirname(sys.argv[0]), '../share/gfceux/gfceux.glade')):
glade_file = os.path.join(os.path.dirname(sys.argv[0]), '../share/gfceux/gfceux.glade')
else:
print 'ERROR.'
print 'Could not find the glade UI file.'
print 'Try reinstalling the application.'
sys.exit(1)
try:
print "Using: " + glade_file
widgets = gtk.Builder()
widgets.add_from_file(glade_file)
widgets.connect_signals(self)
except:
self.print_error("Couldn't load the UI data.", 24)
widgets.get_object("main_window").show_all()
def launch(self, rom_name, local=False):
global options
set_options()
sound_options = ''
if options.sound_check:
sound_options += '--sound 1 '
else:
sound_options += '--sound 0 '
if options.soundq_check:
sound_options += '--soundq 1 '
else:
sound_options += '--soundq 0 '
if options.soundrate_entry:
sound_options += '--soundrate ' + options.soundrate_entry + ' '
if options.soundbufsize_entry:
sound_options += '--soundbufsize ' + options.soundbufsize_entry + ' '
# video
video_options = ''
if options.fullscreen_check:
video_options += '--fullscreen 1 '
else:
video_options += '--fullscreen 0 '
if options.opengl_check:
video_options += '--opengl 1 '
else:
video_options += '--opengl 0 '
if options.autoscale_check:
video_options += '--autoscale 1 '
else:
video_options += '--autoscale 0 '
video_options += ' --xscale ' + str(options.xscale_spin)
video_options += ' --yscale ' + str(options.yscale_spin)
video_options += ' '
# lua/movie
other_options = ''
if options.luafile:
other_options += '--loadlua ' + options.luafile + ' '
if options.moviefile:
other_options += '--playmov ' + options.moviefile + ' '
# Netplay is fucked right now
if options.join_radio:
if options.join_pass == '':
netpass = ''
else:
netpass = '--pass ' + options.join_pass
network = '--net ' + options.join_add +\
' --port '+ str(options.join_port) + ' ' + netpass
else:
network = ''
if options.host_radio:
if options.host_pass == '':
netpass = ' '
else:
netpass = ' --pass ' + '"' + options.host_pass + '" '
network = '--net localhost --port '+\
str(options.host_port) + netpass + ' '
network = ''
if local:
network = ''
command = self.fceux_binary + ' ' + sound_options + video_options +\
network + other_options + options.extra_entry + ' '+ rom_name
self.msg('Command: ' + command)
if options.host_radio:
xterm_binary = find_binary("xterm")
if xterm_binary == None:
gfceu_error("Cannot find xterm on this system. You will not \n\
be informed of server output.", 102, True, False)
args = [self.server_binary]
else:
args = [xterm_binary, "-e", self.server_binary]
args.append('--port')
args.append(str(options.host_port))
if options.host_pass:
args.append("--password")
args.append(options.host_pass)
pid = Popen(args).pid
widgets.get_object("main_window").hide()
# os.system() is a blocker, so we must force
# gtk to process our events.
while gtk.events_pending():
gtk.main_iteration_do()
os.system(command)
widgets.get_object("main_window").show()
if options.host_radio:
os.kill(pid, 9)
### Callbacks
def launch_button_clicked(self, arg1):
global options
options.romfile = widgets.get_object("rom_entry").get_text()
if widgets.get_object("rom_entry").get_text() == '':
self.msg('Please specify a ROM to open in the main tab.', True)
return
self.launch('"'+ options.romfile +'"')
def autoscale_check_toggled(self, menuitem, data=None):
if widgets.get_object("autoscale_check").get_active():
widgets.get_object("scaling_frame").set_sensitive(False)
else:
widgets.get_object("scaling_frame").set_sensitive(True)
def about_button_clicked(self, menuitem, data=None):
widgets.get_object("about_dialog").set_name('GFCE UltraX '+version)
widgets.get_object("about_dialog").run()
widgets.get_object("about_dialog").hide()
def lua_browse_button_clicked(self, menuitem, data=None):
global options
set_options()
chooser = gtk.FileChooserDialog("Open...", None,
gtk.FILE_CHOOSER_ACTION_OPEN,
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN, gtk.RESPONSE_OK))
chooser.set_property("local-only", False)
chooser.set_default_response(gtk.RESPONSE_OK)
filter=gtk.FileFilter()
filter.set_name("Lua scripts")
filter.add_pattern("*.lua")
chooser.add_filter(filter)
filter = gtk.FileFilter()
filter.set_name("All files")
filter.add_pattern("*")
chooser.add_filter(filter)
if options.luafile == '':
folder = os.getenv('HOME')
else:
folder = os.path.split(options.luafile)[0]
chooser.set_current_folder (folder)
response = chooser.run()
chooser.hide()
if response == gtk.RESPONSE_OK:
if chooser.get_filename():
x = chooser.get_filename()
widgets.get_object("lua_entry").set_text(x)
options.luafile = x
def movie_browse_button_clicked(self, menuitem, data=None):
global options
set_options()
chooser = gtk.FileChooserDialog("Open...", None,
gtk.FILE_CHOOSER_ACTION_OPEN,
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN, gtk.RESPONSE_OK))
chooser.set_property("local-only", False)
chooser.set_default_response(gtk.RESPONSE_OK)
filter=gtk.FileFilter()
filter.set_name("FM2 movies")
filter.add_pattern("*.fm2")
chooser.add_filter(filter)
filter = gtk.FileFilter()
filter.set_name("All files")
filter.add_pattern("*")
chooser.add_filter(filter)
if options.moviefile == '':
folder = os.getenv('HOME')
else:
folder = os.path.split(options.moviefile)[0]
chooser.set_current_folder (folder)
response = chooser.run()
chooser.hide()
if response == gtk.RESPONSE_OK:
if chooser.get_filename():
x = chooser.get_filename()
widgets.get_object("movie_entry").set_text(x)
options.moviefile = x
def rom_browse_button_clicked(self, menuitem, data=None):
global options
set_options()
chooser = gtk.FileChooserDialog("Open...", None,
gtk.FILE_CHOOSER_ACTION_OPEN,
(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
gtk.STOCK_OPEN, gtk.RESPONSE_OK))
chooser.set_property("local-only", False)
chooser.set_default_response(gtk.RESPONSE_OK)
filter=gtk.FileFilter()
filter.set_name("NES Roms")
filter.add_mime_type("application/x-nes-rom")
filter.add_mime_type("application/zip")
filter.add_pattern("*.nes")
filter.add_pattern("*.zip")
chooser.add_filter(filter)
filter = gtk.FileFilter()
filter.set_name("All files")
filter.add_pattern("*")
chooser.add_filter(filter)
if options.romfile == '':
folder = os.getenv('HOME')
else:
folder = os.path.split(options.romfile)[0]
chooser.set_current_folder (folder)
response = chooser.run()
chooser.hide()
if response == gtk.RESPONSE_OK:
if chooser.get_filename():
x = chooser.get_filename()
widgets.get_object("rom_entry").set_text(x)
# reset lua and movie entries on rom change
widgets.get_object("movie_entry").set_text("")
widgets.get_object("lua_entry").set_text("")
options.romfile = x
# fix this global its ugly
# specifies which NES gamepad we are configuring
gamepad_config_no = "0"
# This isn't used yet because it doesn't work with joysticks.
def gamepad_clicked_new(self, widget, data=None):
widgets.get_object("gamepad_config_window").show_all()
"""
#Disabled for now
#TODO: Full joystick support
def button_clicked(self, widget, data=None):
prefix = "SDL.Input.GamePad." + self.gamepad_config_no
d = {'right_button' : prefix + "Right",
'left_button' : prefix + "Left",
'up_button' : prefix + "Up",
'down_button' : prefix + "Down",
'select_button' : prefix + "Select",
'start_button' : prefix + "Start",
'a_button' : prefix + "A",
'b_button' : prefix + "B",
'turbo_a_button' : prefix + "TurboA",
'turbo_b_button' : prefix + "TurboB"}
if get_key.has_pygame == False:
self.msg("Pygame could not be found on this system. Gfceux will revert to the old configuration routine.", True)
self.gamepad_clicked_old(widget)
else:
kg = get_key.KeyGrabber()
key_tuple = kg.get_key()
cp = FceuxConfigParser(configfile)
cp.writeKey(prefix + "DeviceType", key_tuple[0])
if key_tuple[0] == "Keyboard":
print key_tuple
cp.writeKey(d[widget.name], key_tuple[1])
if key_tuple[0] == "Joystick":
print key_tuple
cp.writeKey(prefix + "DeviceNum", key_tuple[2])
cp.writeKey(d[widget.name], key_tuple[1])
"""
def gamepad_clicked(self, widget, data=None):
d = {'gp1_button' : "1",
'gp2_button' : "2",
'gp3_button' : "3",
'gp4_button' : "4"}
self.gamepad_config_no = d[widget.name]
command = '--inputcfg gamepad' + self.gamepad_config_no
self.launch(command, True)
def gamepad_window_close(self, widget, data=None):
widgets.get_object("gamepad_config_window").hide()
return True
def config_help_button_clicked(self, menuitem, data=None):
msgbox = gtk.MessageDialog(parent=None, flags=0,
type=gtk.MESSAGE_INFO, buttons=gtk.BUTTONS_CLOSE)
msgbox.set_markup("You should be able to figure it out from here.")
msgbox.run()
msgbox.hide()
def join_radio_clicked(self, menuitem, data=None):
global options
widgets.get_object("join_frame").set_sensitive(True)
widgets.get_object("host_frame").set_sensitive(False)
options.join_radio = True
options.host_radio = False
options.no_network_radio = False
def host_radio_clicked(self, menuitem, data=None):
if widgets.get_object("host_radio").get_active():
options.server_binary = find_binary('fceux-server')
if options.server_binary == None:
if os.name == 'nt':
self.print_error("The fceux server software cannot be found. \n\
Ensure that it is installed in the same directory as \n\
GFCE Ultra.", 102, True, False)
else:
self.print_error("The fceux server software cannot be found on \n\
this system. Ensure that it is installed and in your path.",
101, True, False)
widgets.get_object("no_network_radio").set_active(True)
options.no_network_radio = True
return False
widgets.get_object("join_frame").set_sensitive(False)
widgets.get_object("host_frame").set_sensitive(True)
options.join_radio = False
options.host_radio = True
options.no_network_radio = False
def no_network_radio_clicked(self, menuitem, data=None):
widgets.get_object("join_frame").set_sensitive(False)
widgets.get_object("host_frame").set_sensitive(False)
options.join_radio = False
options.host_radio = False
options.no_network_radio = True
def end(self, menuitem, data=None):
set_options()
save_options()
gtk.main_quit()
if __name__ == '__main__':
app = GfceuxApp()

View File

@ -1,37 +0,0 @@
#!/usr/bin/env python
# uninstall script for gfceux
# if gfceux was installed in an non-default prefix, you can specify it
# as an argument
#
# sudo ./uninstall.py [prefix]
#
# prefix must include slash at end
#TODO: fix that
#TODO: remove python package? (site-package/gfceux/etc)
import os
import dircache
import sys
prefix = "/usr/local"
try:
if sys.argv[1]:
prefix = sys.argv[1]
except IndexError:
pass
# first include data places scattered in /usr
files = [
"share/pixmaps/gfceux.png",
"share/man/man1/gfceux.1",
"share/applications/gfceux.desktop",
"bin/gfceux"]
# then include the files in our /usr/share/gfceux
for x in dircache.listdir(prefix + "share/gfceux"):
files.append("share/gfceux/" + x)
for x in files:
os.remove(prefix+x)
# go ahead and remove our shared folder if its empty
os.rmdir(prefix+"share/gfceux")