GTK/X11 Port (aka Linux/UNIX GUI)

This is for people involved in the developement of Snes9x, or SNES emulators in general.
BUG REPORTS BELONG IN TECH SUPPORT/BUG TRACKING!
Post Reply
deniseweird
Snes9x White Belt
Posts: 41
Joined: Wed Feb 20, 2008 9:38 am

Post by deniseweird »

stevejesus wrote:KDE users already have a multiple emulator frontend.

http://kemulator.sourceforge.net/
Thanks for the suggestion, but it doesn't even compare. It uses Qt2, while version 4.4 is about to come out for Qt. :P There is also Kamefu and one other program I don't remember the name for, but I didn't like them too much.
User avatar
stevejesus
Snes9x White Belt
Posts: 24
Joined: Fri Feb 08, 2008 2:56 pm
Location: Indianapolis IN

Post by stevejesus »

I miss KDE... I don't know why. I don't like it very much. I used to use it full time. Then, almost 2 years ago I switched to Gnome and have never looked back. I tried KDE4 a couple of weeks after official release... but it seems broken. I like the new icon mouse-over controls though.:)

Anyway, let's both chip in on a case of beer for Bear0so!
deniseweird
Snes9x White Belt
Posts: 41
Joined: Wed Feb 20, 2008 9:38 am

Post by deniseweird »

I do admit KDE4 is not quite ready yet. One of the things I absolutely love about KDE is it's customizability (Hey, GNOME just got a very basic color scheme editor Recently I believe.), but so far 4 has less options than 3.5. We will see how it evolves.

But enough of the DE rant. Even if Snes9x uses GTK I can make it blend in pretty good with Qtcurve, except for the file dialog. I'm glad we have good working GUI at all.

Sure! I agree, cheers for Bear0so :D
deniseweird
Snes9x White Belt
Posts: 41
Joined: Wed Feb 20, 2008 9:38 am

Post by deniseweird »

You're right. It's different from a launcher or similar wich just picks a rom and start an external program (Snes9x in this case). Modifying all the emulators used would be necessary.

About your libraries, they sound really amazing! If this would be picked up here, we could have one GUI for all systems and DEs. May I ask though, how is performance with this? And it's not buggy? I know bsnes doesn't care about speed in other cases, but Snes9x tries to be fast I believe.
deniseweird
Snes9x White Belt
Posts: 41
Joined: Wed Feb 20, 2008 9:38 am

Post by deniseweird »

Then I really like your libraries :) I do not know programming myself, but it sounds like this is just what we need for portability. I would really look forward seeing it in Snes9x. But it's up to the author of this GUI to decide of course.
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

byuu wrote: Sorry to self-promote here, but if you're looking for some sort of generic library for writing a user interface, I've written one that wraps both the Win32 native and GTK+ APIs. Adding a Qt wrapper would be a weekend project for someone who knew the API (I do not.)

With the wrapper, you can write the UI once, and it automagically works on every platform, using its native toolkit. Kind of like wxWidgets, but without all the complexity and issues. And a Qt port would be trivial.

Do the same for hardware abstraction (unify the API for DirectDraw+Direct3D+GDI+OpenGL+Xv+SDL, etc etc), as I've also written a library for, and you pretty much have all the portability you could want.

The bad news is that it requires someone to patch these libraries directly into the emulators. I've had no luck convincing anyone to even try out my wrappers thus far :/

If you wanted an example, here are two screenshots of it: Main window, Configuration window.

Speaking of which, BearOso, if you want, you're free to use my Xv driver in Snes9X -- code is public domain and very small.
Your API really is impressive. It's more clean and concise than I could ever hope to do myself, and you've done a great job further improving the GTK part and different outputs support.
deniseweird wrote:Then I really like your libraries Smile I do not know programming myself, but it sounds like this is just what we need for portability. I would really look forward seeing it in Snes9x. But it's up to the author of this GUI to decide of course.
This GUI is fairly cemented to GTK. Adapting to byuu's library would pretty much be another complete port. I'm not ruling it out entirely--I've done a couple ports of snes9x already and byuu's libraries are excellent--but the scope of such a change is greater than you might think it is.
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Re: Does not compile in Debian 4.0r3 (etch)

Post by BearOso »

spsuaiken wrote: "make" stops with the following errors:

gtk/gtk_s9xwindow.cpp:507: error: variable or field
I'm not sure what this is about. There's only a function declaration at line 507.

Can you tell me what compiler you're using? I've tried reproducing this on gcc 3.3 through 4.2.3 and I can't. Also, more of the output would be helpful.
spsuaiken
Snes9x White Belt
Posts: 3
Joined: Fri Feb 22, 2008 1:21 pm

Re: Does not compile in Debian 4.0r3 (etch)

Post by spsuaiken »

BearOso wrote:
spsuaiken wrote: "make" stops with the following errors:

gtk/gtk_s9xwindow.cpp:507: error: variable or field
I'm not sure what this is about. There's only a function declaration at line 507.

Can you tell me what compiler you're using? I've tried reproducing this on gcc 3.3 through 4.2.3 and I can't. Also, more of the output would be helpful.
sorry, phpBB cut off rest of message due to '

gcc --version
gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

debian packages libgtk2.0-0, libgtk2.0-dev packages from apt-get
(i'm tempted to build gtk from source at this point)

mesa was built from source but as linux-x86
(i'm going to retry it with linux-dri)
make wrote: gtk/gtk_s9xwindow.cpp:507: error: variable or field 'event_recent_open' declared void
gtk/gtk_s9xwindow.cpp:507: error: 'GtkRecentChooser' was not declared in this scope
gtk/gtk_s9xwindow.cpp:507: error: 'chooser' was not declared in this scope
gtk/gtk_s9xwindow.cpp:507: error: expected primary-expression before 'data'
gtk/gtk_s9xwindow.cpp:507: error: initializer expression list treated as compound expression
gtk/gtk_s9xwindow.cpp:508: error: expected ',' or ';' before '{' token
gtk/gtk_s9xwindow.cpp: In member function 'int Snes9xWindow::try_open_rom(const char*)':
gtk/gtk_s9xwindow.cpp:985: error: 'GtkRecentData' was not declared in this scopegtk/gtk_s9xwindow.cpp:985: error: expected ';' before 'recent_data'
gtk/gtk_s9xwindow.cpp:999: error: 'recent_data' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1004: error: 'gtk_recent_manager_get_default' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1006: error: 'gtk_recent_manager_add_full' was not declared in this scope
gtk/gtk_s9xwindow.cpp: In member function 'void Snes9xWindow::show()':
gtk/gtk_s9xwindow.cpp:1572: error: 'gtk_recent_manager_get_default' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1572: error: 'gtk_recent_chooser_menu_new_for_manager' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1574: error: 'GtkRecentFilter' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1574: error: 'filter' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1574: error: 'gtk_recent_filter_new' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1575: error: 'gtk_recent_filter_add_application' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1576: error: 'GTK_RECENT_CHOOSER' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1577: error: 'gtk_recent_chooser_set_local_only' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1579: error: 'gtk_recent_chooser_set_show_icons' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1581: error: 'GTK_RECENT_SORT_MRU' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1581: error: 'gtk_recent_chooser_set_sort_type' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1583: error: 'gtk_recent_chooser_add_filter' was not declared in this scope
make: *** [gtk/gtk_s9xwindow.o] Error 1
debian:/usr/src/snes9x-1.51-src#
i'll let you know how things go after recompile of mesa and possibly gtk from source
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Re: Does not compile in Debian 4.0r3 (etch)

Post by BearOso »

spsuaiken wrote:
make wrote: gtk/gtk_s9xwindow.cpp:507: error: variable or field 'event_recent_open' declared void
gtk/gtk_s9xwindow.cpp:507: error: 'GtkRecentChooser' was not declared in this scope
gtk/gtk_s9xwindow.cpp:507: error: 'chooser' was not declared in this scope
gtk/gtk_s9xwindow.cpp:507: error: expected primary-expression before 'data'
gtk/gtk_s9xwindow.cpp:507: error: initializer expression list treated as compound expression
gtk/gtk_s9xwindow.cpp:508: error: expected ',' or ';' before '{' token
gtk/gtk_s9xwindow.cpp: In member function 'int Snes9xWindow::try_open_rom(const char*)':
gtk/gtk_s9xwindow.cpp:985: error: 'GtkRecentData' was not declared in this scopegtk/gtk_s9xwindow.cpp:985: error: expected ';' before 'recent_data'
gtk/gtk_s9xwindow.cpp:999: error: 'recent_data' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1004: error: 'gtk_recent_manager_get_default' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1006: error: 'gtk_recent_manager_add_full' was not declared in this scope
gtk/gtk_s9xwindow.cpp: In member function 'void Snes9xWindow::show()':
gtk/gtk_s9xwindow.cpp:1572: error: 'gtk_recent_manager_get_default' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1572: error: 'gtk_recent_chooser_menu_new_for_manager' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1574: error: 'GtkRecentFilter' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1574: error: 'filter' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1574: error: 'gtk_recent_filter_new' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1575: error: 'gtk_recent_filter_add_application' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1576: error: 'GTK_RECENT_CHOOSER' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1577: error: 'gtk_recent_chooser_set_local_only' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1579: error: 'gtk_recent_chooser_set_show_icons' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1581: error: 'GTK_RECENT_SORT_MRU' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1581: error: 'gtk_recent_chooser_set_sort_type' was not declared in this scope
gtk/gtk_s9xwindow.cpp:1583: error: 'gtk_recent_chooser_add_filter' was not declared in this scope
make: *** [gtk/gtk_s9xwindow.o] Error 1
debian:/usr/src/snes9x-1.51-src#
i'll let you know how things go after recompile of mesa and possibly gtk from source
Ah, the problem is that you need gtk+-2.10. The recent items stuff isn't in gtk before that. I neglected to bump the configure requirement up when I added that.
spsuaiken
Snes9x White Belt
Posts: 3
Joined: Fri Feb 22, 2008 1:21 pm

Re: Does not compile in Debian 4.0r3 (etch)

Post by spsuaiken »

BearOso wrote: Ah, the problem is that you need gtk+-2.10. The recent items stuff isn't in gtk before that. I neglected to bump the configure requirement up when I added that.
Yeah, it made it farther through compile after I installed latest gtk+ from source, then stopped at a pango error. I'm not going to post it. I'm just going to a Gentoo distribution as Debian is so far "behind" so to say.
Screwtape
Snes9x White Belt
Posts: 49
Joined: Thu May 26, 2005 12:59 pm

Re: Does not compile in Debian 4.0r3 (etch)

Post by Screwtape »

spsuaiken wrote:I'm just going to a Gentoo distribution as Debian is so far "behind" so to say.
Or you could just upgrade from stable to testing, and have an always up-to-date system without having to recompile anything: http://packages.debian.org/libgtk2.0
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

A new version has been added. This implements the snes_ntsc filter. Xv support will be in the next release.
User avatar
stevejesus
Snes9x White Belt
Posts: 24
Joined: Fri Feb 08, 2008 2:56 pm
Location: Indianapolis IN

Post by stevejesus »

Thank you so much for the inclusion of the NTSC filter. It works great! So, is there a command-line switch for this? I would like to use this filter with Mythgame on the TV.

Also, my weird fullscreen slowdown issues have stopped with this release.
User avatar
stevejesus
Snes9x White Belt
Posts: 24
Joined: Fri Feb 08, 2008 2:56 pm
Location: Indianapolis IN

Post by stevejesus »

Will we see a v.20?
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

stevejesus wrote:Will we see a v.20?
Actually, no. I was planning on abandoning the project on a prime number, and I like 19.

What kind of command-line switch are you looking for? Is there a reason you'd like a switch as opposed to just setting the option and having it load from the config file by default? I know this version isn't very PVR-friendly as it is, but I was planning on improving that eventually (or not, considering this was the last release :-)).
User avatar
BearOso
Official GTK/Linux Porter/Dev
Posts: 460
Joined: Tue Oct 02, 2007 12:50 am

Post by BearOso »

-20 is posted. This adds the XVideo output and changes some defaults.
prurigro
Snes9x White Belt
Posts: 9
Joined: Wed Mar 05, 2008 9:39 pm

Post by prurigro »

I just registered to say thanks a ton BearOso! - you've managed to turn the emulator I thought would forever be shadowed by zsnes (in linux), into the one I'd stand by to the end. Beyond that, the fact that you added XV support is jaw dropping- snes9x should seriously consider using this as the official product

after having tried the latest release I gotta say I've never had performance like this in a snes emu on my slower box; very nice work :) one thing though, this only happens on my computer with an LCD, but there's a line of green about a pixel wide all the way down the right of the window (or fullscreen) in xv mode. I assume my CRT just skips that last pixel, but it could just be some funky driver config on my LCD computer or something too, I'm not sure-- I cant find any problems beyond this though

thanks again, you got me hooked on snes games again for the first time in a while =D

edit : another problem new to me using xv is input lagging-- after a point of playing pressing a button will take a second or so before taking effect, like, pressing forward will cause the character to move forward a few seconds after pressing it. Non game keys like the ones i defined for fullscreen and system pause have the same wait. this issue disappears by returning to windowed mode and then fullscreen again. fullscreen here is widescreen with no filters if that helps?
Last edited by prurigro on Thu Mar 06, 2008 5:16 am, edited 3 times in total.
Post Reply