From 32f5774cb8b8c7d59cb73118783fc8948c2626bf Mon Sep 17 00:00:00 2001 From: punkrockguy318 Date: Thu, 5 Jun 2008 23:31:28 +0000 Subject: [PATCH] gfceu is now compatible with fceux --- gfceu | 50 ++++++------ gfceu.glade | 214 +++++++++++++++++++++++++++------------------------- 2 files changed, 135 insertions(+), 129 deletions(-) diff --git a/gfceu b/gfceu index 4f8f84ef..7eb8ccd9 100644 --- a/gfceu +++ b/gfceu @@ -225,26 +225,26 @@ def set_options(): def launch(passed, local=False): - global xml, options, fceu_server_binary, fceu_binary, aoss_binary + global xml, options, fceu_server_binary, fceu_binary set_options() if options.sound_check: - sound = '-sound 1 ' + sound = '--sound 1 ' else: - sound = '-sound 0 ' + sound = '--sound 0 ' if options.fullscreen_check: - fullscreen = '-fs 1 ' + fullscreen = '--fullscreen 1 ' else: - fullscreen = '-fs 0 ' + fullscreen = '--fullscreen 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 + netpass = '--pass ' + '"' + options.join_pass + '" ' + network = '-net "' + options.join_add + '"'\ + ' --port '+ str(options.join_port) + ' ' + netpass else: network = '' @@ -252,8 +252,8 @@ def launch(passed, local=False): if options.host_pass == '': netpass = ' ' else: - netpass = ' -netpassword ' + '"' + options.host_pass + '" ' - network = '-connect localhost -netport '+\ + netpass = ' --pass ' + '"' + options.host_pass + '" ' + network = '--net localhost --port '+\ str(options.host_port) + netpass + ' ' @@ -261,11 +261,11 @@ def launch(passed, local=False): network = '' if options.opengl_check: - opengl = '-opengl 1 ' + opengl = '--opengl 1 ' else: - opengl = '-opengl 0 ' + opengl = '--opengl 0 ' - command = aoss_binary + ' ' + fceu_binary +' '+ sound + fullscreen +\ + command = fceu_binary +' '+ sound + fullscreen +\ network + opengl + options.extra_entry + ' '+ passed gfceu_message('Command: ' + command) @@ -297,7 +297,8 @@ def launch(passed, local=False): os.kill(pid, 9) widgets['main_window'].show() -def find_binary(this_binary): +def find_binary(file): + path = os.getenv('PATH') directories= [] directory = '' @@ -310,12 +311,12 @@ def find_binary(this_binary): 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(x, file)): + return os.path.join(x,file) + + if os.path.isfile(os.path.join(os.curdir,file)): + return os.path.join(os.curdir, file) - if os.path.isfile(os.path.join(os.curdir,this_binary)): - return os.path.join(os.curdir, this_binary) - return None # # # # # # # # @@ -487,7 +488,6 @@ 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 @@ -521,7 +521,7 @@ if __name__ == '__main__': parser = OptionParser(version='%prog '+ version) parser.parse_args() - fceu_binary = find_binary('fceu') + fceu_binary = find_binary('fceux') if fceu_binary == None: gfceu_error('Could not find the fceu binary.\n\ Ensure that FCE Ultra is installed and in the $PATH.\n\ @@ -529,13 +529,7 @@ if __name__ == '__main__': 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() diff --git a/gfceu.glade b/gfceu.glade index 7d6240fa..04e5a667 100644 --- a/gfceu.glade +++ b/gfceu.glade @@ -68,20 +68,7 @@ - - True - True - Enable _Sound - True - 0 - True - True - - - False - False - 1 - + @@ -140,17 +127,30 @@ 5 5 - + True True - Gamepad _3 + Gamepad _1 True 0 - 1 - 2 + + + + + + True + True + Gamepad _2 + True + 0 + + + + 1 + 2 @@ -172,30 +172,17 @@ - + True True - Gamepad _2 - True - 0 - - - - 1 - 2 - - - - - - True - True - Gamepad _1 + Gamepad _3 True 0 + 1 + 2 @@ -424,28 +411,13 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 5 5 - + True - True + 0 + Port: - 1 - 2 - 1 - 2 - - - - - - True - True - 4046 1 65536 1 10 10 - 1 - - - 1 - 2 + GTK_FILL @@ -463,13 +435,28 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - + True - 0 - Port: + True + 4046 1 65536 1 10 10 + 1 - GTK_FILL + 1 + 2 + + + + + + True + True + + + 1 + 2 + 1 + 2 @@ -521,54 +508,13 @@ Invalid options may cause GFCE Ultra to perform incorrectly. 3 5 - + True True - 4046 1 65536 1 10 10 - 1 1 2 - 1 - 2 - - - - - - True - 0 - Password: - - - 2 - 3 - GTK_FILL - - - - - - True - 0 - Server Port: - - - 1 - 2 - GTK_FILL - - - - - - True - 0 - Server Address: - - - GTK_FILL @@ -588,13 +534,54 @@ Invalid options may cause GFCE Ultra to perform incorrectly. - + + 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 @@ -643,6 +630,31 @@ Invalid options may cause GFCE Ultra to perform incorrectly. False + + + True + True + Enable _Sound + True + 0 + True + True + + + 5 + + + + + True + Sound + + + tab + 5 + False + + 10