diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 0aaa8676..00000000 --- a/INSTALL +++ /dev/null @@ -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 - - diff --git a/TODO b/TODO deleted file mode 100644 index df749269..00000000 --- a/TODO +++ /dev/null @@ -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. diff --git a/data/gfceux.1 b/data/gfceux.1 deleted file mode 100644 index 851b5601..00000000 --- a/data/gfceux.1 +++ /dev/null @@ -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. diff --git a/data/gfceux.glade b/data/gfceux.glade deleted file mode 100644 index e499edf7..00000000 --- a/data/gfceux.glade +++ /dev/null @@ -1,1445 +0,0 @@ - - - - - - 2 - 1 - 5 - 0.5 - 1 - - - 2 - 1 - 10 - 0.5 - 1 - - - 4046 - 1 - 65536 - 1 - 10 - - - 4046 - 1 - 65536 - 1 - 10 - - - Gamepad Configuration - - - - - - True - - - True - <b>NOTE:</b> The below GUI is brand new and joysticks are not completely support yet. To configure a joystick, use --inputcfg. - - True - True - - - 0 - - - - - True - - - True - 0 - none - - - True - 12 - - - True - 3 - 3 - - - Up - True - True - True - - - 1 - 2 - - - - - Left - True - True - True - - - 1 - 2 - - - - - Down - True - True - True - - - 1 - 2 - 2 - 3 - - - - - Right - True - True - True - - - 2 - 3 - 1 - 2 - - - - - - - - - - - - - - - - - - - - - - - - True - <b>D-Pad</b> - True - - - - - False - False - 0 - - - - - True - 0 - none - - - True - 12 - - - True - - - Select - True - True - True - - - False - False - 0 - - - - - Start - True - True - True - - - False - False - 1 - - - - - - - - - True - <b>Essentials</b> - True - - - - - 1 - - - - - True - 0 - none - - - True - 12 - - - True - - - True - - - B - True - True - True - - - 0 - - - - - A - True - True - True - - - 1 - - - - - 0 - - - - - True - - - Turbo B - True - True - True - - - 0 - - - - - Turbo A - True - True - True - - - 1 - - - - - 1 - - - - - - - - - True - <b>Alpha and Beta</b> - True - - - - - 2 - - - - - 1 - - - - - - - True - GFCE UltraX - 442 - gfceux.png - - - - True - 1 - - - True - True - 3 - - - True - 5 - 5 - - - True - 5 - - - True - 5 - ROM Filename: - - - False - False - 0 - - - - - True - True - - - 1 - - - - - _Browse... - True - True - False - True - - - - False - False - 2 - - - - - False - False - 0 - - - - - True - 5 - - - True - 5 - Movie Filename: - - - False - False - 0 - - - - - True - True - - - 1 - - - - - _Browse... - True - True - False - True - - - - False - False - 2 - - - - - False - False - 1 - - - - - True - 5 - - - True - 5 - Lua Script: - - - False - False - 0 - - - - - True - True - - - 1 - - - - - _Browse... - True - True - False - True - - - - False - False - 2 - - - - - False - False - 2 - - - - - - - True - Main - - - False - - - - - True - 5 - 5 - - - True - - - True - gtk-dialog-info - - - False - False - 0 - - - - - True - Select an NES gamepad to configure. - True - - - False - False - 7 - 1 - - - - - False - False - 0 - - - - - True - 2 - 2 - 5 - 5 - - - Gamepad _1 - True - True - False - True - - - - - - - - - Gamepad _2 - True - True - False - True - - - - 1 - 2 - - - - - - Gamepad _4 - True - True - False - True - - - - 1 - 2 - 1 - 2 - - - - - - Gamepad _3 - True - True - False - True - - - - 1 - 2 - - - - - - False - False - 1 - - - - - gtk-help - True - True - False - True - - - - False - False - 5 - end - 2 - - - - - 1 - - - - - True - Input - - - 1 - False - - - - - True - 5 - 5 - - - Enable _OpenGL Rendering - True - True - False - True - True - - - False - False - 0 - - - - - Enable _Full Screen - True - True - False - True - True - - - False - False - 1 - - - - - True - <small><i>(Press Alt+Enter to toggle fullscreen in-game.)</i></small> - True - True - - - False - False - 2 - - - - - _Autoscale Fullscreen - True - True - False - True - True - True - - - - False - 3 - - - - - True - 0 - none - - - True - 12 - - - True - - - True - - - True - X scale: - - - False - 5 - 0 - - - - - True - True - adjustment1 - 0.099999999776482579 - 1 - True - - - False - 1 - - - - - False - 0 - - - - - True - - - True - Y scale: - - - False - 5 - 0 - - - - - True - True - adjustment2 - 0.10000000000000001 - 1 - True - if-valid - - - False - 1 - - - - - False - 1 - - - - - - - - - True - <b>Manual Scaling</b> - True - - - - - 4 - - - - - True - - - True - Bits per pixel: - - - False - 5 - 0 - - - - - True - True - 2 - 32 - - - False - False - 1 - - - - - False - False - 5 - - - - - 2 - False - - - - - True - Video - - - 2 - False - - - - - True - 5 - - - Enable _Sound - True - True - False - True - True - True - - - False - 5 - 0 - - - - - Extra _Quaility - True - True - False - True - True - True - - - False - 5 - 1 - - - - - True - - - True - Sample rate: - - - False - False - 5 - 0 - - - - - True - True - 6 - 11000 - - - False - False - 1 - - - - - False - 5 - 2 - - - - - True - - - True - Buffer size (ms): - - - False - False - 5 - 0 - - - - - True - True - 3 - 48 - - - False - False - 1 - - - - - False - 3 - - - - - 3 - - - - - True - Sound - - - 3 - False - - - - - True - 5 - 5 - - - True - - - True - gtk-dialog-info - - - False - False - 0 - - - - - True - If you would like to specify any command line options to FCE UltraX, specify them below. For a complete option reference, visit http://fceux.com . - -Invalid options may cause GFCE UltraX to behave incorrectly. - - True - - - False - False - 1 - - - - - False - False - 5 - 0 - - - - - True - - - True - Extra Parameters: - - - False - False - 5 - 0 - - - - - True - True - - - 5 - 1 - - - - - False - 1 - - - - - 4 - - - - - True - Advanced - - - 4 - False - - - - - True - 5 - 5 - - - _Host Game - True - True - False - True - True - - - - False - False - 0 - - - - - True - 0 - none - - - True - 19 - - - True - 2 - 2 - 5 - 5 - - - True - 0 - Port: - - - GTK_FILL - - - - - - True - 0 - Password: - - - 1 - 2 - GTK_FILL - - - - - - True - True - adjustment3 - 1 - - - 1 - 2 - - - - - - True - True - - - 1 - 2 - 1 - 2 - - - - - - - - - - False - False - 1 - - - - - _Join Game - True - True - False - True - True - host_radio - - - - False - False - 2 - - - - - True - 0 - none - - - True - 0 - 19 - - - True - 5 - 3 - 2 - 3 - 5 - - - True - True - - - 1 - 2 - - - - - - True - True - False - - - 1 - 2 - 2 - 3 - - - - - - True - 0 - Server Address: - - - GTK_FILL - - - - - - True - 0 - Server Port: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - - True - True - adjustment4 - 1 - - - 1 - 2 - 1 - 2 - - - - - - - - - - False - False - 3 - - - - - _No Network - True - True - False - True - True - True - host_radio - - - - False - False - 4 - - - - - 5 - - - - - Network - - - 5 - False - - - - - 10 - 0 - - - - - True - True - - - True - 3 - - - gtk-execute - True - True - True - True - True - False - True - - - - False - 0 - - - - - gtk-about - True - True - False - True - - - - False - False - 1 - - - - - gtk-quit - True - True - False - True - - - - False - 2 - - - - - 0 - - - - - False - False - 1 - - - - - - - normal - (C) Copyright 2008 - A GTK2 front-end end for the fceux Nintendo Entertainment System emulator. - 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. - Lukas Sabota -<ltsmooth42@gmail.comt> - -Patch writers: -Scott Brown - translator-credits - Sketching: - J. Sammer -Digital Manipulation: - C. Kontros - -Artwork for old versions (< 0.2.7): - Jimmy Angelakos - <vyruss000@gmail.com> - gfceux_big.png - - - True - - - http://fceux.com - True - True - True - True - none - http://fceux.com - - - 3 - - - - - http://dietschnitzel.com/gfceu/ - True - True - True - True - none - http://dietschnitzel.com/gfceu/ - - - 4 - - - - - True - - - False - end - 0 - - - - - - diff --git a/data/gfceux.xml b/data/gfceux.xml deleted file mode 100644 index d354ca51..00000000 --- a/data/gfceux.xml +++ /dev/null @@ -1,1447 +0,0 @@ - - - - - - 2 - 1 - 5 - 0.5 - 1 - - - 2 - 1 - 10 - 0.5 - 1 - - - 4046 - 1 - 65536 - 1 - 10 - - - 4046 - 1 - 65536 - 1 - 10 - - - Gamepad Configuration - - - - - - True - - - True - <b>NOTE:</b> The below GUI is brand new and joysticks are not completely support yet. To configure a joystick, use --inputcfg. - - True - True - - - 0 - - - - - True - - - True - 0 - none - - - True - 12 - - - True - 3 - 3 - - - Up - True - True - True - - - 1 - 2 - - - - - Left - True - True - True - - - 1 - 2 - - - - - Down - True - True - True - - - 1 - 2 - 2 - 3 - - - - - Right - True - True - True - - - 2 - 3 - 1 - 2 - - - - - - - - - - - - - - - - - - - - - - - - True - <b>D-Pad</b> - True - - - - - False - False - 0 - - - - - True - 0 - none - - - True - 12 - - - True - - - Select - True - True - True - - - False - False - 0 - - - - - Start - True - True - True - - - False - False - 1 - - - - - - - - - True - <b>Essentials</b> - True - - - - - 1 - - - - - True - 0 - none - - - True - 12 - - - True - - - True - - - B - True - True - True - - - 0 - - - - - A - True - True - True - - - 1 - - - - - 0 - - - - - True - - - Turbo B - True - True - True - - - 0 - - - - - Turbo A - True - True - True - - - 1 - - - - - 1 - - - - - - - - - True - <b>Alpha and Beta</b> - True - - - - - 2 - - - - - 1 - - - - - - - True - GFCE UltraX - 442 - gfceux.png - - - - True - 1 - - - True - True - 3 - - - True - 5 - 5 - - - True - 5 - - - True - 5 - ROM Filename: - - - False - False - 0 - - - - - True - True - - - 1 - - - - - _Browse... - True - True - False - True - - - - False - False - 2 - - - - - False - False - 0 - - - - - True - 5 - - - True - 5 - Movie Filename: - - - False - False - 0 - - - - - True - True - - - 1 - - - - - _Browse... - True - True - False - True - - - - False - False - 2 - - - - - False - False - 1 - - - - - True - 5 - - - True - 5 - Lua Script: - - - False - False - 0 - - - - - True - True - - - 1 - - - - - _Browse... - True - True - False - True - - - - False - False - 2 - - - - - False - False - 2 - - - - - - - True - Main - - - False - - - - - True - 5 - 5 - - - True - - - True - gtk-dialog-info - - - False - False - 0 - - - - - True - Select an NES gamepad to configure. - True - - - False - False - 7 - 1 - - - - - False - False - 0 - - - - - True - 2 - 2 - 5 - 5 - - - Gamepad _1 - True - True - False - True - - - - - - - - - Gamepad _2 - True - True - False - True - - - - 1 - 2 - - - - - - Gamepad _4 - True - True - False - True - - - - 1 - 2 - 1 - 2 - - - - - - Gamepad _3 - True - True - False - True - - - - 1 - 2 - - - - - - False - False - 1 - - - - - gtk-help - True - True - False - True - - - - False - False - 5 - end - 2 - - - - - 1 - - - - - True - Input - - - 1 - False - - - - - True - 5 - 5 - - - Enable _OpenGL Rendering - True - True - False - True - True - - - False - False - 0 - - - - - Enable _Full Screen - True - True - False - True - True - - - False - False - 1 - - - - - True - <small><i>(Press Alt+Enter to toggle fullscreen in-game.)</i></small> - True - True - - - False - False - 2 - - - - - _Autoscale Fullscreen - True - True - False - True - True - True - - - - False - 3 - - - - - True - 0 - none - - - True - 12 - - - True - - - True - - - True - X scale: - - - False - 5 - 0 - - - - - True - True - adjustment1 - 0.099999999776482579 - 1 - True - - - False - 1 - - - - - False - 0 - - - - - True - - - True - Y scale: - - - False - 5 - 0 - - - - - True - True - adjustment2 - 0.10000000000000001 - 1 - True - if-valid - - - False - 1 - - - - - False - 1 - - - - - - - - - True - <b>Manual Scaling</b> - True - - - - - 4 - - - - - True - - - True - Bits per pixel: - - - False - 5 - 0 - - - - - True - True - 2 - 32 - - - False - False - 1 - - - - - False - False - 5 - - - - - 2 - False - - - - - True - Video - - - 2 - False - - - - - True - 5 - - - Enable _Sound - True - True - False - True - True - True - - - False - 5 - 0 - - - - - Extra _Quaility - True - True - False - True - True - True - - - False - 5 - 1 - - - - - True - - - True - Sample rate: - - - False - False - 5 - 0 - - - - - True - True - 6 - 48000 - - - False - False - 1 - - - - - False - 5 - 2 - - - - - True - - - True - Buffer size (ms): - - - False - False - 5 - 0 - - - - - True - True - 3 - 48 - - - False - False - 1 - - - - - False - 3 - - - - - 3 - - - - - True - Sound - - - 3 - False - - - - - True - 5 - 5 - - - True - - - True - gtk-dialog-info - - - False - False - 0 - - - - - True - If you would like to specify any command line options to FCE UltraX, specify them below. For a complete option reference, visit http://fceux.com . - -Invalid options may cause GFCE UltraX to behave incorrectly. - - True - - - False - False - 1 - - - - - False - False - 5 - 0 - - - - - True - - - True - Extra Parameters: - - - False - False - 5 - 0 - - - - - True - True - - - 5 - 1 - - - - - False - 1 - - - - - 4 - - - - - True - Advanced - - - 4 - False - - - - - True - False - 5 - 5 - - - _Host Game - True - True - False - True - True - - - - False - False - 0 - - - - - True - 0 - none - - - True - 19 - - - True - 2 - 2 - 5 - 5 - - - True - 0 - Port: - - - GTK_FILL - - - - - - True - 0 - Password: - - - 1 - 2 - GTK_FILL - - - - - - True - True - adjustment3 - 1 - - - 1 - 2 - - - - - - True - True - - - 1 - 2 - 1 - 2 - - - - - - - - - - False - False - 1 - - - - - _Join Game - True - True - False - True - True - host_radio - - - - False - False - 2 - - - - - True - 0 - none - - - True - 0 - 19 - - - True - 5 - 3 - 2 - 3 - 5 - - - True - True - - - 1 - 2 - - - - - - True - True - False - - - 1 - 2 - 2 - 3 - - - - - - True - 0 - Server Address: - - - GTK_FILL - - - - - - True - 0 - Server Port: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - - True - True - adjustment4 - 1 - - - 1 - 2 - 1 - 2 - - - - - - - - - - False - False - 3 - - - - - _No Network - True - True - False - True - True - True - host_radio - - - - False - False - 4 - - - - - 5 - - - - - False - Network - - - 5 - False - - - - - 10 - 0 - - - - - True - True - - - True - 3 - - - gtk-execute - True - True - True - True - True - False - True - - - - False - 0 - - - - - gtk-about - True - True - False - True - - - - False - False - 1 - - - - - gtk-quit - True - True - False - True - - - - False - 2 - - - - - 0 - - - - - False - False - 1 - - - - - - - normal - (C) Copyright 2008 - A GTK2 front-end end for the fceux Nintendo Entertainment System emulator. - 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. - Lukas Sabota -<ltsmooth42@gmail.comt> - -Patch writers: -Scott Brown - translator-credits - Sketching: - J. Sammer -Digital Manipulation: - C. Kontros - -Artwork for old versions (< 0.2.7): - Jimmy Angelakos - <vyruss000@gmail.com> - gfceux_big.png - - - True - - - http://fceux.com - True - True - True - True - none - http://fceux.com - - - 3 - - - - - http://dietschnitzel.com/gfceu/ - True - True - True - True - none - http://dietschnitzel.com/gfceu/ - - - 4 - - - - - True - - - False - end - 0 - - - - - - diff --git a/get_key/build.sh b/get_key/build.sh deleted file mode 100755 index 10fefdb5..00000000 --- a/get_key/build.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -g++ `sdl-config --cflags --libs` main.cpp -o get_fceu_key; diff --git a/get_key/main.cpp b/get_key/main.cpp deleted file mode 100644 index bb52f03b..00000000 --- a/get_key/main.cpp +++ /dev/null @@ -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 -#include - -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; -} - diff --git a/gfceu/.gitignore b/gfceu/.gitignore new file mode 100644 index 00000000..674deb69 --- /dev/null +++ b/gfceu/.gitignore @@ -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 diff --git a/gfceu/BUG b/gfceu/BUG new file mode 100644 index 00000000..ac514cf1 --- /dev/null +++ b/gfceu/BUG @@ -0,0 +1 @@ +* Too much shit when trying to run with no display diff --git a/COPYING b/gfceu/COPYING similarity index 100% rename from COPYING rename to gfceu/COPYING diff --git a/ChangeLog b/gfceu/ChangeLog similarity index 67% rename from ChangeLog rename to gfceu/ChangeLog index fb8d00d0..0031c474 100644 --- a/ChangeLog +++ b/gfceu/ChangeLog @@ -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 ======================== diff --git a/gfceu/INSTALL b/gfceu/INSTALL new file mode 100644 index 00000000..e1e363f6 --- /dev/null +++ b/gfceu/INSTALL @@ -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) diff --git a/gfceu/MANIFEST b/gfceu/MANIFEST new file mode 100644 index 00000000..493dbe58 --- /dev/null +++ b/gfceu/MANIFEST @@ -0,0 +1,11 @@ +gfceu +setup.py +COPYING +ChangeLog +INSTALL +TODO +gfceu.glade +gfceu.desktop +gfceu.png +gfceu_big.png +gfceu.1 diff --git a/gfceu/TODO b/gfceu/TODO new file mode 100644 index 00000000..a793939d --- /dev/null +++ b/gfceu/TODO @@ -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? diff --git a/gfceu/UNINSTALL b/gfceu/UNINSTALL new file mode 100644 index 00000000..b235fb83 --- /dev/null +++ b/gfceu/UNINSTALL @@ -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] diff --git a/gfceu/gfceu b/gfceu/gfceu new file mode 100755 index 00000000..d46e256d --- /dev/null +++ b/gfceu/gfceu @@ -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 +## +""" +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) diff --git a/gfceu/gfceu.1 b/gfceu/gfceu.1 new file mode 100644 index 00000000..74543b99 --- /dev/null +++ b/gfceu/gfceu.1 @@ -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. diff --git a/data/gfceux.desktop b/gfceu/gfceu.desktop similarity index 73% rename from data/gfceux.desktop rename to gfceu/gfceu.desktop index fe60738b..37cc8e87 100644 --- a/data/gfceux.desktop +++ b/gfceu/gfceu.desktop @@ -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; diff --git a/gfceu/gfceu.glade b/gfceu/gfceu.glade new file mode 100644 index 00000000..7d23bf6e --- /dev/null +++ b/gfceu/gfceu.glade @@ -0,0 +1,767 @@ + + + + + + True + GFCE Ultra + 442 + gfceu.png + + + + True + 1 + + + True + True + 3 + + + True + 5 + 5 + + + True + 5 + + + True + 5 + ROM Filename: + + + False + False + + + + + True + True + + + 1 + + + + + True + True + _Browse... + True + 0 + + + + False + False + 2 + + + + + False + False + + + + + True + True + Enable _Sound + True + 0 + True + True + + + False + False + 1 + + + + + + + True + Main + + + tab + False + + + + + True + 5 + 5 + + + True + + + True + gtk-dialog-info + + + False + False + + + + + True + Select an NES gamepad to configure. + True + + + False + False + 7 + 1 + + + + + False + False + + + + + True + 2 + 2 + 5 + 5 + + + True + True + Gamepad _1 + True + 0 + + + + + + + + + True + True + Gamepad _2 + True + 0 + + + + 1 + 2 + + + + + + True + True + Gamepad _4 + True + 0 + + + + 1 + 2 + 1 + 2 + + + + + + True + True + Gamepad _3 + True + 0 + + + + 1 + 2 + + + + + + False + False + 1 + + + + + True + True + gtk-help + True + 0 + + + + False + False + 2 + + + + + 1 + + + + + True + Input + + + tab + 1 + False + + + + + True + 5 + 5 + + + True + True + Enable _OpenGL Rendering + True + 0 + True + + + False + False + + + + + True + True + Enable _Full Screen + True + 0 + True + + + False + False + 1 + + + + + True + <small><i>(Press Alt+Enter to toggle fullscreen in-game.)</i></small> + True + True + + + False + False + 2 + + + + + 2 + + + + + True + Video + + + tab + 2 + False + + + + + True + 5 + 5 + + + True + + + True + gtk-dialog-info + + + False + False + + + + + True + 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. + + True + + + False + False + 1 + + + + + False + False + 5 + + + + + True + + + True + Extra Parameters: + + + False + False + 5 + + + + + True + True + + + 5 + 1 + + + + + False + 1 + + + + + 3 + + + + + True + Advanced + + + tab + 3 + False + + + + + True + 5 + 5 + + + True + True + _Host Game + True + 0 + True + + + + False + False + + + + + True + False + 0 + GTK_SHADOW_NONE + + + True + 19 + + + True + 2 + 2 + 5 + 5 + + + True + 0 + Port: + + + GTK_FILL + + + + + + True + 0 + Password: + + + 1 + 2 + GTK_FILL + + + + + + True + True + 4046 1 65536 1 10 10 + 1 + + + 1 + 2 + + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + + + + + + False + False + 1 + + + + + True + True + _Join Game + True + 0 + True + host_radio + + + + False + False + 2 + + + + + True + False + 0 + GTK_SHADOW_NONE + + + True + 0 + 19 + + + True + 5 + 3 + 2 + 3 + 5 + + + True + True + + + 1 + 2 + + + + + + True + True + False + * + + + 1 + 2 + 2 + 3 + + + + + + True + 0 + Server Address: + + + GTK_FILL + + + + + + True + 0 + Server Port: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Password: + + + 2 + 3 + GTK_FILL + + + + + + True + True + 4046 1 65536 1 10 10 + 1 + + + 1 + 2 + 1 + 2 + + + + + + + + + + False + False + 3 + + + + + True + True + _No Network + True + 0 + True + True + host_radio + + + + False + False + 4 + + + + + 4 + + + + + True + Network + + + tab + 4 + False + + + + + 10 + + + + + True + True + + + True + 3 + + + True + True + True + True + True + gtk-execute + True + 0 + + + + False + + + + + True + True + gtk-about + True + 0 + + + + False + False + 1 + + + + + True + True + gtk-quit + True + 0 + + + + False + 2 + + + + + + + False + False + 1 + + + + + + + GDK_WINDOW_TYPE_HINT_NORMAL + (C) Copyright 2008 + A GNOME front-end end for the FCE Ultra Nintendo Entertainment System emulator + http://dietschnitzel.com/gfceu/ + 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. + Lukas Sabota +<ltsmooth42@gmail.comt> + +Patch writers: +Scott Brown + translator-credits + Sketching: + J. Sammer +Digital Manipulation: + C. Kontros + +Artwork for old versions (< 0.2.7): + Jimmy Angelakos + <vyruss000@gmail.com> + gfceu_big.png + + + True + + + + + + True + + + False + GTK_PACK_END + + + + + + diff --git a/data/gfceux.png b/gfceu/gfceu.png similarity index 100% rename from data/gfceux.png rename to gfceu/gfceu.png diff --git a/data/gfceux_big.png b/gfceu/gfceu_big.png similarity index 100% rename from data/gfceux_big.png rename to gfceu/gfceu_big.png diff --git a/gfceu/gfceu_big_old.png b/gfceu/gfceu_big_old.png new file mode 100644 index 00000000..24ecfa26 Binary files /dev/null and b/gfceu/gfceu_big_old.png differ diff --git a/gfceu/gfceu_french.glade b/gfceu/gfceu_french.glade new file mode 100644 index 00000000..5b925125 --- /dev/null +++ b/gfceu/gfceu_french.glade @@ -0,0 +1,761 @@ + + + + + + True + GFCE Ultra + 442 + gfceu.png + + + + True + 1 + + + True + True + 3 + + + True + 5 + 5 + + + True + 5 + + + True + 5 + Fichier ROM: + + + False + False + + + + + True + True + + + 1 + + + + + True + True + _Parcourir... + True + + + + False + False + 2 + + + + + False + False + + + + + True + True + Activer _Son + True + True + True + + + False + False + 1 + + + + + False + + + + + True + Général + + + tab + False + False + + + + + True + 5 + 5 + + + True + + + True + gtk-dialog-info + + + False + False + + + + + True + Sélectionner un gamepad NES à configurer. + True + + + False + False + 7 + 1 + + + + + False + False + + + + + True + 2 + 2 + 5 + 5 + + + True + True + Gamepad _1 + True + + + + + + + + + True + True + Gamepad _2 + True + + + + 1 + 2 + + + + + + True + True + Gamepad _4 + True + + + + 1 + 2 + 1 + 2 + + + + + + True + True + Gamepad _3 + True + + + + 1 + 2 + + + + + + False + False + 1 + + + + + True + True + gtk-help + True + + + + False + False + 2 + + + + + 1 + False + + + + + True + Manette + + + tab + 1 + False + False + + + + + True + 5 + 5 + + + True + True + Permettre le rendu _OpenGL + True + True + + + False + False + + + + + True + True + Permettre le _plein écran + True + True + + + False + False + 1 + + + + + True + <small><i>(Presser Alt+Entrée pour permutter.)</i></small> + True + True + + + False + False + 2 + + + + + 2 + False + + + + + True + Vidéo + + + tab + 2 + False + False + + + + + True + 5 + 5 + + + True + + + True + gtk-dialog-info + + + False + False + + + + + True + 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. + + True + + + False + False + 1 + + + + + False + False + 5 + + + + + True + + + True + Extra Paramètres: + + + False + False + 5 + + + + + True + True + + + 5 + 1 + + + + + False + 1 + + + + + 3 + False + + + + + True + Avancé + + + tab + 3 + False + False + + + + + True + 5 + 5 + + + True + True + Jeu _hôte + True + True + + + + False + False + + + + + True + False + 0 + GTK_SHADOW_NONE + + + True + 19 + + + True + 2 + 2 + 5 + 5 + + + True + 0 + Port: + + + GTK_FILL + + + + + + True + 0 + Mot de passe: + + + 1 + 2 + GTK_FILL + + + + + + True + True + 4046 1 65536 1 10 10 + 1 + + + 1 + 2 + + + + + + True + True + + + 1 + 2 + 1 + 2 + + + + + + + + + + False + False + 1 + + + + + True + True + _Joindre le jeu + True + True + host_radio + + + + False + False + 2 + + + + + True + False + 0 + GTK_SHADOW_NONE + + + True + 0 + 19 + + + True + 5 + 3 + 2 + 3 + 5 + + + True + True + + + 1 + 2 + + + + + + True + True + False + * + + + 1 + 2 + 2 + 3 + + + + + + True + 0 + Addresse Serveur: + + + GTK_FILL + + + + + + True + 0 + Server Port: + + + 1 + 2 + GTK_FILL + + + + + + True + 0 + Mot de passe: + + + 2 + 3 + GTK_FILL + + + + + + True + True + 4046 1 65536 1 10 10 + 1 + + + 1 + 2 + 1 + 2 + + + + + + + + + + False + False + 3 + + + + + True + True + _Pas de Réseau + True + True + True + host_radio + + + + False + False + 4 + + + + + 4 + False + + + + + True + Réseau + + + tab + 4 + False + False + + + + + 10 + + + + + True + True + + + True + 3 + + + True + True + True + True + True + gtk-execute + True + + + + False + + + + + True + True + gtk-about + True + + + + False + False + 1 + + + + + True + True + gtk-quit + True + + + + False + 2 + + + + + + + False + False + 1 + + + + + + + (C) Copyright 2006 + Une interface GNOME pour l'émulateur FCE Ultra Nintendo Entertainment System + http://gfceu.thepiratecove.org/ + 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. + Lukas Sabota +<punkrockguy318@comcast.net> + +Patch Writers: +Scott Brown + translator-credits + Sketching: + J. Sammer +Digital Manipulation: + C. Kontros + +Artwork for old versions (< 0.2.7): + Jimmy Angelakos + <vyruss000@gmail.com> + gfceu_big.png + + + True + + + + + + True + + + False + GTK_PACK_END + + + + + + diff --git a/gfceu/gfceu_old.png b/gfceu/gfceu_old.png new file mode 100644 index 00000000..ab5144d9 Binary files /dev/null and b/gfceu/gfceu_old.png differ diff --git a/gfceu/setup.py b/gfceu/setup.py new file mode 100755 index 00000000..6e327ce7 --- /dev/null +++ b/gfceu/setup.py @@ -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" + + ) + diff --git a/gfceu/status_window.py b/gfceu/status_window.py new file mode 100644 index 00000000..4970cc84 --- /dev/null +++ b/gfceu/status_window.py @@ -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() diff --git a/gfceux b/gfceux deleted file mode 100755 index 11eaa441..00000000 --- a/gfceux +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python -# -# GTK2 GUI for FCE UltraX -# -# Lukas Sabota -# -# -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() - - diff --git a/setup.py b/setup.py deleted file mode 100755 index 005b70df..00000000 --- a/setup.py +++ /dev/null @@ -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" - ) - diff --git a/src/__init__.py b/src/__init__.py deleted file mode 100644 index 6551d283..00000000 --- a/src/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__all__ = ["gfceux"] diff --git a/src/config_parse.py b/src/config_parse.py deleted file mode 100755 index d59e675d..00000000 --- a/src/config_parse.py +++ /dev/null @@ -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() - diff --git a/src/get_key.py b/src/get_key.py deleted file mode 100755 index 8e5a58c1..00000000 --- a/src/get_key.py +++ /dev/null @@ -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() - diff --git a/src/main.py b/src/main.py deleted file mode 100755 index 2a489f8e..00000000 --- a/src/main.py +++ /dev/null @@ -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 -## -""" -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() diff --git a/uninstall.py b/uninstall.py deleted file mode 100755 index 3ccfb1a1..00000000 --- a/uninstall.py +++ /dev/null @@ -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")