PDA

View Full Version : A little Linux C++ project I've been working on...



Shintock
12-29-2004, 12:06 AM
A simple proof of concept:
Gamefu - Gaming All-Machine Emulator Frontend for Unix

In my quest to find a decent graphical console emulator frontend for Linux, I came up empty handed. Thanks to some helpful people in the tech forum who hooked me up with some SDL docs, I've been able to start this:

http://www.doigtsagiles.com/images/menu.jpg

Props to pheonix for his awesome skinnage. :D

Basically, you'll be able to open any ROM you wish for any system, using your joystick. No need for the keyboard or mouse. This is ideal for a setup where the computer is hooked up to a TV.

An exemple of a ROM listing for NES:

http://www.doigtsagiles.com/images/list.jpg

Up top, I'm planning on showing a screenshot of the game (got to work out a little bug and it'll be working) and the meta-data as well (ROM Title, mapper used, switch, CHR size, etc...).

Basically what I want is suggestions for features that should be included, because I know I haven't thought of everything yet.

So get suggesting! :mad:

/me cracks whip

Brian
12-29-2004, 12:08 AM
I want to see the second screenshot! It looks cool.

Edit: Well now it's there...

Brian
12-29-2004, 12:09 AM
It would be cool to have a way to categorize games and systems. For example, Dragon Warrior should be placed under NES as well as RPG. So you can choose by game or system. That would rock.

Shintock
12-29-2004, 12:10 AM
You more like a library style browser? Hmmm... that would mean having to categorize thousands of games by hand, because there is no way of reading the genre directly from the ROM. :\

I could always let the user categorize his own ROMs though... :)

Freelancer
12-29-2004, 12:32 AM
That's even better. For example, what if someone disagrees with you about whether a certain game is an RPG. Letting people classify their own ROMs is the way to go.

Dj Yoshi
12-29-2004, 12:32 AM
Yeah, this is pretty cool, I'm looking forward to running it on my fresh debian system which is installing right now ;)

So get crackin!

BV
12-29-2004, 12:35 AM
Awesome.

phoenix_9286
12-29-2004, 02:27 AM
Originally posted by Shintock
Props to pheonix for his awesome skinnage. :D

Again, you're very much welcome. I just like how well it turned out. ;)

dalf
12-29-2004, 02:33 AM
Shintock's C++ skills are better than mine.

/me causes the header file problem in his code

Darth Evad
12-29-2004, 09:47 AM
nice!

Shintock
12-29-2004, 10:25 AM
Originally posted by JediGandalf
/me causes the header file problem in his code
Hehe, silly me, the function I was trying to define was in the .h instead of in the corresponding .cpp. In other words, I didn't just prototype, I actually had the function typed out in my .h. Stupid n00by mistake. :p

Thanks for the praise guys. :D I might eventually make this portable, but for now the code that gets the ROM list is specific to *nix.

Still need feature suggestions!

Ni
12-29-2004, 10:33 AM
Does it support gamepads? Ie, controlling the menu's using a gamepad/joystick?

Looks great though :)

Shintock
12-29-2004, 10:34 AM
It was conceived with the thought of exclusively controlling with a joystick/gamepad in mind. :)

gbk
12-29-2004, 10:41 AM
For the love of kak, please dont make me use a joystick. :(

Darth Evad
12-29-2004, 10:46 AM
make him use a joystick!!! :p

Shintock
12-29-2004, 10:47 AM
Kak loves him today, the keyboard is also supported. The dude I'm doing this with can't get his gamepad working in Linux, so we didn't have a choice. :p

Cool Matty
12-29-2004, 02:47 PM
Originally posted by Shintock
You more like a library style browser? Hmmm... that would mean having to categorize thousands of games by hand, because there is no way of reading the genre directly from the ROM. :\

I could always let the user categorize his own ROMs though... :)

The hell there isn't a way.

Almost every single rom has a totally different extension for each system.

Genesis = usually bin or smd
SNES = smc
NES = nes

And on and on and on. The only one that might be a problem is MAME, which uses ZIPs, especially if you allow usage of zipped roms.

Compos Mentis
12-29-2004, 05:06 PM
Make the rom listing a text file, including genres and system. Then when someone does get around to doing all the roms, you can offer that as a seperate file. HUZZAH

Maybe shots of the game could be shown in a preview thumbnail. Say it loaded a .png or .jpg with the same name as the rom, if it exists. Other wise...load a default system-specific image?

Shintock
12-29-2004, 08:22 PM
Originally posted by Cool Matty
The hell there isn't a way.

Almost every single rom has a totally different extension for each system.

Genesis = usually bin or smd
SNES = smc
NES = nes

And on and on and on. The only one that might be a problem is MAME, which uses ZIPs, especially if you allow usage of zipped roms.
The hell are you saying?

Genre as in RPG, Action, Adventure, etc... I know the filename extensions for each system.

Dj Yoshi
12-29-2004, 08:29 PM
Originally posted by Shintock
The hell are you saying?

Genre as in RPG, Action, Adventure, etc... I know the filename extensions for each system.

MSN. Now.

Cool Matty
12-29-2004, 09:25 PM
Originally posted by Shintock
The hell are you saying?

Genre as in RPG, Action, Adventure, etc... I know the filename extensions for each system.

Sorry, didn't read the entire post about breaking into Genres. But your screenshots do not show any system categorization either, unless you just didn't show it.

Shintock
12-30-2004, 01:46 PM
Hehe. :o

When you select "Play Games," there's a little windows that comes up that asks you what system you want to search for games for. The program then looks up in a configuration file the path you have set for the ROMs for that system, as well as the emulator you wish to use.

Cool Matty
12-30-2004, 05:07 PM
Here's a good suggestion I thought of:

Add a jukebox ability, using some sort of MP3 player, like XMMS. And if you want to take it even further, add support for visualizations.

Oh, and on top of that, TV Tuner capability. Might as well go for a full entertainment center. Now THAT would be awesome.

If ya put that in, I could quite possibly be very interested :D

Oh, and here's some stuff you might want to add as options (if you haven't already)


Overall Volume Control
Overall Resolution settings
Brightness / Contrast
Joystick Calibration (Duh :p)
Overall Debug Stats (FPS, etc)
Boot OS GUI
Options Password (To deny access)
Network setup (For Networked Roms, Internet Radio, etc)
Check for updates

Shintock
12-30-2004, 11:13 PM
CM, those are all great ideas. Thanks. :D

For the TV tuning, check out MythTV. It's in the portage tree. It also includes an emu frontend much like mine. Definitely what you're looking for.

The network support is going to be an essential, because it is something that I'm going to want to use myself.

The debug stats are going to have to be supported by the emulators themselves, as far as I know. Most emus support displaying the FPS count.

Overall resolution settings: do you mean for just the frontend, or for all the emus at the same time? Changing the resolution for the emus all at once would be kind of complicated, but still fairly easy to accomplish. It would only be a matter of modifying all of the config files at once for each emu.

Music capability is definitely a freakin' good idea. Having it resume a song when exiting the emulator would be pretty cool.

By booting OS gui you mean starting X? Good idea. Won't be needed for my purposes but definitely a feature that should be included.

Thanks for the great ideas, keep them coming if you have any more. :D

Shintock
12-30-2004, 11:28 PM
http://www.mythtv.org/

Cool Matty
12-31-2004, 12:19 AM
Originally posted by Shintock
CM, those are all great ideas. Thanks. :D

For the TV tuning, check out MythTV. It's in the portage tree. It also includes an emu frontend much like mine. Definitely what you're looking for.

The network support is going to be an essential, because it is something that I'm going to want to use myself.

The debug stats are going to have to be supported by the emulators themselves, as far as I know. Most emus support displaying the FPS count.

Overall resolution settings: do you mean for just the frontend, or for all the emus at the same time? Changing the resolution for the emus all at once would be kind of complicated, but still fairly easy to accomplish. It would only be a matter of modifying all of the config files at once for each emu.

Music capability is definitely a freakin' good idea. Having it resume a song when exiting the emulator would be pretty cool.

By booting OS gui you mean starting X? Good idea. Won't be needed for my purposes but definitely a feature that should be included.

Thanks for the great ideas, keep them coming if you have any more. :D

Yes, I know about MythTV, I was just saying, you could make your program do that too, and have EVERYTHING :D

Debug stats - I meant it like the resolution settings. Turn this on, and it enables all those statistics for every emulator (and possibly the mp3 player also, sorta like running in verbose mode)

Overall resolution settings - yes, to change for all emulators, and the main GUI too. Helpful since editing config files isnt exactly easy to do with a joystick :p

Music - Yup, and possibly even do OC Remix based on the game last played or selected, or just by system. :D (if you are THAT bored, that is :D)

Booting OS - If this thing starts every time the computer starts up, you want an easy way to get to the OS in case something goes wrong.

And I'd definately make a password for these things. That way a little brother cant screw with the settings when it stops by.

Let's see, more ideas...

Surround Sound setup...
Backup Save Game files
CD-Rom support for roms, etc
DVD playback? (Could easily be done via mplayer)
Screenshot viewer (For viewing high score screenshots, etc.)
Universal Button for screenshots... (For all emulators. Possibly done outside the emulators themselves via GIMP or something?)
CD playback, complete with CDDA lookup support
Visualizations :D
Random Game option (Picks a random rom and loads it. Possibly just per system and all systems)
Sort games (by name, last played, most played, etc?)
Video Playback (Off network, CD, or hard drive. Perfect for anime!!! woooo. Also easily done with mplayer)
Overall control settings and per-system control settings via a joystick usable menu.
Extensive Cheat library (dunno, in case you want to?)
FLIP SCREEN LAYOUT horizontal/vertical. MUST HAVE FOR SOME MAME GAMES!!!
Skin support (meh, you never know)
IR remote support (up to you, might be stretching it)


That's everything I can think of right now. Also, make sure you get the brightness/contrast, and volume options in there. If they can't access the OS, and its a TV in a cabinet, they might not be able to change that stuff by themselves easily.

Cool Matty
12-31-2004, 09:41 PM
Ba-bump.

Brian
01-01-2005, 03:33 PM
I would recommend keeping it simple. Make sure you implement a feature at a time and that the system works in between. The problems with such lofty goals is that it often takes more an investment than just keeping it simple. So make the emulator interface first. Then the cataloging. Then maybe a music player. Make sure to release after each new feature, put a tag in the code so people can grab it from CVS (or whatever). Don't start laying the foundation to take over from MythTV until you've got your emulator program working and stable!

Shintock
01-01-2005, 04:38 PM
Oops, I meant to reply to this. Thanks for the bump.

The TV-tuner capabilities are going to be very, very low priority for now. Although I love the idea, it's not going to be easy and is not really part of my original vision of my frontend. To make things even more complicated, I don't have a TV-tuner, only S-Video and Composite inputs.

The music player shouldn't be too hard, using something like gstreamer, mplayer or arts (probably arts, since it supports more audio formats, IIRC). Once I get the basics working (as Brian said, it's really my priority for now, expecially since I'm so close to making it functional). I've got a class made up that will take care of reading the user config file and check the path for the emus wanted. It also takes care of threading and excuting the proper emu. All I have to do now is test it out with my list. I'll check it out tomorrow, when I'm back home and can get back to my Gentoo box.

CM - I especially like the remote idea. I have an ATi Remote Wonder, so it would be something doable (seeing as I can actually test it, in contrast to the TV-tuner capabilities).

I'm going to save this page, and keep this great list of ideas. Thanks to everybody for their support and interest. :D

Keep the discussion going! :D

Cool Matty
01-01-2005, 10:13 PM
If you need help with testing or anything like that, let me know. I have a dedicated box just for this type of program, and I also have a TV Tuner card if you ever get around to it. If you need help with anything, let me know. I'd love to see this project succeed.

And yes, I fully agree with Brian. Take it a step at a time, getting the core components done, then moving on. (Although for the more integrated parts, I'd make sure you at least keep it in mind when you are programming, so you don't end up having to redo something to get a new feature to work, like the music integration.)

Oh, and Shintock: For the music, I'd recommend using mplayer, for the following reasons:

A. It plays a whole crapload of formats. As to if it is more than aRTs, I dunno, but it's all that I can think of. MP3, WMA, OGG, etc etc.
B. It has full support for custom GUIs, which means it has the potential to fit right in with your project, meaning less work on your end to get it integrated.
C. It plays videos and DVDs also, meaning a great jumping off point after the other features start to work.
D. It supports LIRC (for your ATi Remote :D)

Shintock
01-02-2005, 12:12 AM
Great CM. :D I'll PM you my MSN address, we can talk.

My and my buddy are getting together tomorrow to code some more, get the menus working, work out the user configuration file, and get the screenshots working. He's the one doing most of the "behind the scenes" work (directory listing, threading, game launching), while I take care of the joystick control and graphical functions.

This is going to be great. :D

Brian
01-02-2005, 02:47 AM
You should make a small *simple* site to update people on your status. Hell, use the EC, I'll read your entries every day ;)

Shintock
01-02-2005, 02:52 AM
I'm waiting on SourceForge, they're considering approving the project. :)

In the meantime, I could set up another blog on my site or something.

Martyn
01-02-2005, 10:12 AM
Stoopid question, but would i be able to use it with my knoppix disc? It looks coolcoolcool.

:D

Shintock
01-02-2005, 01:07 PM
It's pretty small, so I imagine you could install it to the ram disk, and it would work. I'm not familiar with the inner workings of Knoppix though, but I also don't see why it wouldn't work. :p

DarkShock
01-03-2005, 10:55 PM
Hi, I'm the "dude" who helping out Shintock with this project.

Here is the latest progress:
-Game Listing is getting debugged a lot, support less than 8 roms, no more scrolling problems
-Configuration file implanted. Here a snipplet:


[SNES]
DisplayName="Super Nintendo Entertainment System"
DisplayImagePath="/usr/share/gamefu/systems/snes.png"
Emulator="zsnes -m"
ImagePath="/mnt/donnee/Shock/Emulation/snes/images"
RomPath="/mnt/donnees/Shock/Emulation/snes/"
RomExtension="smc fig swc zip"

With the configuration file, you can now have many systems as you want. Before, the systems were hard-coded.
Game-fu is checking out for the presente of $HOME/gamefu.cfg.

No, the screenshot previewing isn't implanted yet. We're mostly in a short debugging stage.

Shintock
01-03-2005, 10:58 PM
He's French, forgive his grammar errors.

STAY AWAY, YOU DAMN GRAMMAR NAZIS!!!!111one :mad:

We'll have a new screenshot up later.

Shintock
01-04-2005, 01:13 AM
Here we go. I fixed the scrolling problems, and I had to fix a bug that created a seg fault if there was less than 8 roms (notice that there are 8 roms being shown in the list at once) in the specified folder. The games are running properly using the specified emulator and options specified in gamefu.cfg, thanks to DarkShock, who did all the coding involved for reading the config file and loading the settings.

It's shown here in windowed mode, just to illustrate how it works, but it is our intention to make it a full-screen app, and to launch the games full-screen as well.