Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: How to program your own frontend from scratch?  (Read 2778 times)

0 Members and 1 Guest are viewing this topic.

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1962
  • Last login:June 30, 2025, 02:20:39 pm
How to program your own frontend from scratch?
« on: July 11, 2003, 08:07:08 pm »
I've always been into programming a bit. I do some basic programming and scripting for work related things but have never really done anything really deep.  Anyways, I think that for me personally I would love to try to program my own Mame frontend (or general emu frontend) mostly just to be a learning experience.  I have a very good understanding about programming and programming techniques, but I dont know where to begin?  I know there are a lot of programmers here that could point me in the right place.  (Please dont say "Just go learn C++....that doesnt remotely being to help me) I dont know what sort of things I need to make a graphical frontend using C++ or something of that sort.  If you programmers could point me in some direction I'd appreciate it.  Thanks
« Last Edit: July 11, 2003, 08:11:08 pm by Jakobud »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:How to program your own frontend from scratch?
« Reply #1 on: July 11, 2003, 08:53:22 pm »
Pick an language, any language.  But remember the coding languages that are the easiest to use are generally the most limiting.  Keep that in mind.  

Once you pick one you need to do research on how to do the following.....

1.Display text.  This can be via a standard list box, a label or blitting to the screen.  But this one is pretty mucha  given.  

2.  Launch other applications.  99% of the time this means the "shell" command or calling the createprocess api.

3.  Learn how to call the windows api list.  This is totally necessary as anything complicated will most likely need an api call.  

4.  Figure out how to display png images.  This one is harder than it sounds as many languages (vb and v c++)  don't support png images.  To display them you usually need an external plugin, the most popular being the paintx dll. So you also need to learn how ot call third party dlls in the language you choose.

And you need to do all of this just to make a crappy front end.  Are you still sure you want to try this?  ;)

CM

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 243
  • Last login:January 02, 2012, 08:59:17 pm
  • The internet?!? Is that thing still around?
Re:How to program your own frontend from scratch?
« Reply #2 on: July 11, 2003, 09:03:19 pm »
Pick an language, any language.  But remember the coding languages that are the easiest to use are generally the most limiting.  Keep that in mind.  

Drat! My javascript FE is doomed!!!!!   ;)

Lilwolf

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4945
  • Last login:July 31, 2022, 10:26:34 pm
Re:How to program your own frontend from scratch?
« Reply #3 on: July 12, 2003, 09:23:18 am »
Also, another big thing is being able to parse the listinfo file.

But BEFORE you start righting your own frontend.  Answer these to yourself

1)  What do I want my frontend to do?
2)  Can I get another to do it... (really answer this)
3)  Can I come close.

I spent more time writing a frontend then I did building my cabinet.... or playing any games on it.

I'm glad I did...  Dont' get me wrong.  The one item that none of the other FE's still couldn't do is automatically setup my controls for a 4 player CP in a 2 player game (where player 1 and 2 are in the middle).  So I did it.  

But if I HADN'T...  My cab would be finished (trimmed, ect... Still doen't have tmolding on it)..  I would have it self contained (since it's been in development for 2 years, computers still outside)... It would be one button turn on...

But also... I wouldn't have a good knowledge of 3d programming at the core level.  I wouldn't have written my own java opengl graphic engine.  I wouldn't have had a ton of fun.

Its not for everyone... And I don't think it has anythign to do with building a cabinet... Its just another hobby.

Dave Dribin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 152
  • Last login:May 26, 2007, 11:17:39 pm
  • ugh... yeah
    • Dave Dribin's Home Page
Re:How to program your own frontend from scratch?
« Reply #4 on: July 12, 2003, 10:21:32 am »
Before I start, lemme say that there is no "right" answer and there are really *lots* of options.

In addition to, or maybe before, you pick your language, I would pick a library or framework.  Even if you're only gonna target Windows, I'd suggest staying away from MS-only technologies, especially if you're doing this as a learning experience.  IMHO, the knowledge you learn will be more "robust" since it will be relevent in more places if you ever put it on your resume.

Personally, I like to design a FE like a game.  That really gives you a lot of options visually.  You'll want to think about if you need 3D or not.  If so you'll want OpenGL.  And even if you're doing 2D, you may want to look at OpenGL since you can do some pretty cool effects with it.

If I were to do Game Launcher from scratch, I'd evaluate the following:

- Allegro: A 2D game programming library, MAME uses it.  Pros: portable between DOS, Windows, Linux (and soon OS X), full 2D h/w acceleration support, good sound support, many 3rd party libraries (for PNG, TTF, MP3).  Cons: Poor OpenGL integration.

http://alleg.sourceforge.net/

- SDL: A 2D and 3D library.  Use in mulitimedia programs, and many commercial 3D games.  I believe Unreal Tournament and Quake 3 used SDL, at least for their Linux ports.  Pros: very portable (no DOS), full 2D and 3D h/w acceleration, excellent OpenGL integration, good 3rd party libraries.  Cons: No DOS support

http://www.libsdl.org/

These are both sort of low-level libraries in the sense that the are just graphics and sound.  If you actually want to do a game, or game-like features, you need to write your own game engine.  This is basically what I had to do for Game Launcher.  Now a 3D game engine is a bit more  work.  I recently ran across this cool looking framework called Crystal Space:

http://crystal.sourceforge.net/drupal/node.php?title=Features

I don't know much about it, but the screen shots look way cool.  And the fact that it can import 3D Studio Max files means you can go crazy with the 3D sprites. :)  Not sure how this would be useful to a front-end, but your imagination is the limit.

You'll notice that these are all C or C++.  That's still the language of choice for game engines.  That said there are bindings for other languages.  Crystal Space, for example, has support for Python and Lua, so maybe you can do all your stuff in a scripting language, while letting the "core" be written in C/C++.

And if you just want to do some standard GUI work, I'd look into wxWindows:

http://www.wxwindows.org/

The big advantage wxWindows has over stuff like Qt or Java is that it looks like a "real" Windows app since it uses the Win32 API.  There are even some GUI building programs for it.  Even though C++ is the native API for wxWindows, there is a binding to Python which is very popular:

http://www.wxpython.org/

And I've actually been working on a Java binding at my  job:

http://www.wx4j.org/

but this stuff isn't quite that stable yet. ;)

-Dave

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1962
  • Last login:June 30, 2025, 02:20:39 pm
Re:How to program your own frontend from scratch?
« Reply #5 on: July 13, 2003, 04:45:04 pm »
Thank you for the helpful respones guys.  I'm not looking into making my own FE just because I find other FE's to be unfullfilling.  I think there are more than enough FE's to fullfill anything I'd want to do.  I just want to get more into progamming and I think that a mame frontend might be a good starting point/learning process.  Thanks again!

IIOIOOIOO

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 295
  • Last login:August 04, 2003, 02:18:12 pm
Re:How to program your own frontend from scratch?
« Reply #6 on: July 13, 2003, 05:10:44 pm »
Depending on what point your skills are at, and what languages you're wanting to build experience with, you might have better luck building helper-type apps/utils for existing FEs as a starting point. If nothing else, it will keep you interested while you dig through the mountain of research you have coming.

bigmoe

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 184
  • Last login:July 16, 2004, 04:17:54 pm
  • I forgot my mantra!
Re:How to program your own frontend from scratch?
« Reply #7 on: July 16, 2003, 01:48:58 pm »

And I've actually been working on a Java binding at my  job:

http://www.wx4j.org/

but this stuff isn't quite that stable yet. ;)

-Dave


Neato!  They actually pay you to do that?


I hate to be the one to suggest it, for fear of stoning in this crowd :P, but my company is moving platforms to .NET...and that is probably also a viable option for a FE attempt (might do one myself for the exercise).  After toiling under MFC, C# (and yes, VB.NET, too) is a pleasure to program in...now if only the docs were as good as Java's (no, that's not a joke).  .NET supports PNG and also has a M$-developed extensions for DirectX, so there is a 3d option, too.  I would not be surprised if there were OpenGL extensions, and it's pretty easy to call "unmanaged" (read: external libraries) anyhow.

However, depending on your background, tastes, goals, etc., Dave is likely right to steer you toward a more open and platform-neutral direction.  I would follow his excellent advice if I were not already so M$-mired...besides which, though faster than I expected for a JIT, .NET is expensive (with the other options you can pretty much have a working compiler solution for free) and a resource hog--big strikes against it in the emu world.  That, and the Internet folks will prolly never consider you a mensch... ;)


bm
What was that again?

Dave Dribin

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 152
  • Last login:May 26, 2007, 11:17:39 pm
  • ugh... yeah
    • Dave Dribin's Home Page
Re:How to program your own frontend from scratch?
« Reply #8 on: July 16, 2003, 02:22:40 pm »

And I've actually been working on a Java binding at my  job:

http://www.wx4j.org/

but this stuff isn't quite that stable yet. ;)

-Dave


Neato!  They actually pay you to do that?

Yup!  We're using it on one of our projects (yes, it's a dumb acronym, and no, I didn't come up with it :)):

http://cart.sourceforge.net/

Quote
I hate to be the one to suggest it, for fear of stoning in this crowd :P, but my company is moving platforms to .NET...and that is probably also a viable option for a FE attempt (might do one myself for the exercise).

Sure, if you were considering Java, you'd also have to look at C#/.NET.  FWIW, Java 3D uses OpenGL or DirectX.  And I'm almost certain it supports PNGs out of the box, or at least it's easy to add PNG support.

-Dave

Mike

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 307
  • Last login:September 22, 2005, 01:22:14 pm
  • Umm, yea about the TPS report
Re:How to program your own frontend from scratch?
« Reply #9 on: July 16, 2003, 02:23:00 pm »
If your going to write a new FE, I personally would say use C++. The reason being is that personally I feel alot of what can be done with VB is done already. There may be some bells and whistle that could still be added but I don't think you can come up with a totally inovative FE using VB. I also wouldn't use Java even though it can do alot of what C++ can do, it is a memory hog, not as stable and won't run as fast as C++. Also there is really no reason to write an FE that is cross platform compatible in my opinion. Some will probably disagree with that statement but here is why I say that. My experience has always showed me that when trying to make something cross platform compatible you spend 10% of your time developing it for the primary platform you want it to run on, then you spend 90% of your time trying to get it working on different platforms. Also I believe that the guy out there that wants to run linux it's his own problem to get an FE to work with it. It's a lot easier for him to reload his machine than it is for me to spend hours writing something for him.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:How to program your own frontend from scratch?
« Reply #10 on: July 16, 2003, 02:54:40 pm »
Actually, since an FE is graphical the best things are languages that use graphics.  This would include VB, or C++ with opengl or directx.

PacManFan

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 858
  • Last login:December 06, 2005, 12:18:56 pm
    • Kymaera Home Page
Re:How to program your own frontend from scratch?
« Reply #11 on: July 16, 2003, 03:17:19 pm »
I wanted to put in my .02$ also,
I suppose you really have to analyze the goals of the project before you can make a decision of language. Is the FE going to be cross-platform compatible? (Linux,Mac,Dos,etc...). Are there any time constraints? (VB is good for Rapid application development). What code libraries exist for the language that you can leverage off of? What are the complexities of the features you want in the FE?

I personally code in pure C++, I use VB a lot for "small" applications because it's very easy to program in. VB has it's problems, mainly a slower execution speed than c/c++ and the need for large runtime Dll files. Java is a good choice for cross-platform, except that it's very slow in comparison to vb or c++.
I would recommend using c++ to code in, because it is cross-platform compatible, and has tons of libraries available for it for graphics and sound. The main drawback is that it can be a little more complex to code in than VB.

On you project overall, I recommend that you spend a lot of time designing the features and clearly specifying the goals of your FE before you code a single line. Make the architecture flexible enough to incorporate later changes, but not completly open-ended. Don't re-invent the wheel, use whatever libraries you can find to help you along, and try to stay away from DLL's if possible, try to find a way to statically link in the code you need from LIB files. (This will help you with distribution issues in the future)

-PacManFan
All Hail Smezznar! The Giant purple centipede of Omnicron 5. Regail him with your odiferous offerings of onion powder!

Jeehemdee

  • Guest
  • Trade Count: (0)
Re:How to program your own frontend from scratch?
« Reply #12 on: July 16, 2003, 03:19:49 pm »
Just an interrogation:

Would it be possible to program a front-end in Flash ?

rampy

  • *shrug*
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2910
  • Last login:March 02, 2007, 11:32:16 am
  • ...as useless as a JPG is to Helen Keller
    • Build Your Own PVR
Re:How to program your own frontend from scratch?
« Reply #13 on: July 16, 2003, 03:21:24 pm »
like emulaxian? (or is that more shockwave than flash?)

also.. it's not quite flash but ArcadeFX is written in Authorware.

*shrug*

rampy

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:How to program your own frontend from scratch?
« Reply #14 on: July 16, 2003, 04:37:55 pm »
emulaxian is director/flash.  My attempt at a FE is flash.  flash sucks!

)p(

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 964
  • Last login:March 27, 2009, 03:38:15 am
  • We are the Galaxians...
    • Emulaxian:cabinet and frontend
Re:How to program your own frontend from scratch?
« Reply #15 on: July 16, 2003, 06:13:17 pm »
emulaxian is director/flash.  My attempt at a FE is flash.  flash sucks!

emulaxian's functionality is 100% Director...but it can host flash...and because it can communicate directly with flash in principle it can host flash menu's like the shooting menu I use in the default skin...without any problems...

the only problem with flash is that it does not support dynamically loading of png images...else it would be a great tool for non programmers to make some weird new fe's ;-)

peter