MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Pages: 1

Bryan Ischo
MAME Fan
Reged: 03/28/10
Posts: 358
Send PM


Announcing Libmame
#266216 - 10/13/11 04:06 AM


Hello. I've been working for a while on a project that, as a prerequisite, required turning MAME into a library that I could link into my application.

I've put the documentation for libmame up along with a patch that can be applied to the official MAME 0.143 sources up here:

http://www.ischo.com/libmame

I intend to spruce things up with some more details, examples, build instructions, etc, but for the moment I thought I'd announce it just to get some feedback on the API from anyone who is interested.

Primarily the goal of libmame is to produce a library that can run the MAME engine with a goal to emulating games and for this reason the library API specifically excludes some MAME functionality, such as configuration files, the MAME internal mechanism for mapping input events to game controller events, etc. It's strictly focused on querying the database of game descriptions, and starting and running games. It leaves the mechanism for managing user configuration and handling input devices up to the code that calls the library instead of managing that stuff internally as MAME does.

I will probably also post a few utility programs that I have written on top of libmame that demonstrate its functionality; for example I wrote a benchmarking program that provides some nice features above and beyond standard MAME benchmarking and is more scriptable.

Comments and feedback are most welcome!



grobda
Tank with very high rate of fire plasma weapon and Quantum shield.
Reged: 06/13/07
Posts: 160
Loc: The Zone
Send PM


Re: Announcing Libmame new [Re: Bryan Ischo]
#272211 - 01/04/12 11:48 PM


Another example ? Libmame as part of a dedicated gaming device OS. Integration into the device's management of sound/video/touch screen functions.



Playing for keeps in Arcadia



xpl
MAME Fan
Reged: 03/22/12
Posts: 2
Send PM


Re: Announcing Libmame new [Re: Bryan Ischo]
#281944 - 04/09/12 08:30 AM


A very interesting project!

Does this project keep on updating?

I found the latest version of libmame is 0.144.
And tried to compile it, but failed




Bryan Ischo
MAME Fan
Reged: 03/28/10
Posts: 358
Send PM


Re: Announcing Libmame new [Re: xpl]
#282488 - 04/14/12 12:43 AM


Yeah, I keep it (mostly) up-to-date with the newest MAME in my own git repository.

If you're really interested, I can make that available to you.



xpl
MAME Fan
Reged: 03/22/12
Posts: 2
Send PM


Re: Announcing Libmame new [Re: Bryan Ischo]
#282947 - 04/17/12 05:44 AM



You can update the latest code in the libmame downloads page.

Maybe someone is also interested.

I think make mame as a library is a good idea. It will make mame portable on different platform.



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9713
Loc: ECV-197 The Orville
Send PM


Re: Announcing Libmame new [Re: xpl]
#283214 - 04/19/12 04:17 PM


> I think make mame as a library is a good idea. It will make mame portable on
> different platform.

MAME as distributed by MAMEdev builds on Windows (32/64 bit), Linux (x86, x64, ARM, PowerPC), Mac OS X (PowerPC, 32-bit Intel, 64-bit Intel), Free/Net/OpenBSD (x86, x64), and OS/2. There are also currently maintained ports to Android, iOS, and the Nintendo Wii.

Portability assistance is most definitely not needed



letoram
MAME Fan
Reged: 01/14/12
Posts: 13
Send PM


Re: Announcing Libmame new [Re: R. Belmont]
#284200 - 04/29/12 02:08 AM


Indeed, among the stronger points of MAME (in addition to the core feature as an emulator) lies in its portability. Or rather, it builds and runs on lots of platforms; but there are more to it than that (integration with local UI paradigms, filesystem and other namespace management, ...). The restrictions of having to write a library rather than a fully fledged emu+UI+system interface would, probably, have been a good one to put on the project as a whole.

So far, "libmame" is a neat idea, the actual interface however, could've used some work (doesn't abstract much of the MAME quirks and there are serious drawbacks to a callback-driven API model) but anyhow, kudos to the work done! As a friendly suggestion, however, compare it to say, "libretro" (from the BSNES/SSNES and friends- crowd).



Bryan Ischo
MAME Fan
Reged: 03/28/10
Posts: 358
Send PM


Re: Announcing Libmame new [Re: letoram]
#285504 - 05/08/12 05:04 AM


Thanks for the feedback.

Can you point out MAME quirks that you'd abstract in a different way?

Also, I wonder, how would you implement something like an emulator library in C without callbacks? You could use C++ with abstract base classes but that's essentially the same thing, just different syntactic sugar.

I checked out libretro, as far as I can tell it is very similar to libmame in approach, except of course it only handles a limited set of systems (NES and friends) so it can be considerably simpler than libmame. It's also callback based. Oh, and, the header file libretro.h is very poorly commented, which is a pet peeve of mine. You'll notice that libmame.h is heavily commented.

For what it's worth, I have also written some other API layers to build on libmame. I tried to generalize as much as I could so that other emulators could be plugged in. It's not ready for prime time yet.

Edited by Bryan Ischo (05/08/12 05:10 AM)



Bryan Ischo
MAME Fan
Reged: 03/28/10
Posts: 358
Send PM


Re: Announcing Libmame new [Re: Bryan Ischo]
#289368 - 06/13/12 10:06 AM


libmame is now hosted on github, so you can get the most up-to-date version there. Currently 0.146 is supported.

https://github.com/bji/libmame



azrael11
MAME Fan
Reged: 05/01/11
Posts: 6
Send PM


Re: Announcing Libmame new [Re: Bryan Ischo]
#289518 - 06/14/12 10:02 PM


How about delphi can i call the api from delphi 7 ....
Is libmame a dll call or... something else...?

> Thanks for the feedback.
>
> Can you point out MAME quirks that you'd abstract in a different way?
>
> Also, I wonder, how would you implement something like an emulator library in C
> without callbacks? You could use C++ with abstract base classes but that's
> essentially the same thing, just different syntactic sugar.
>
> I checked out libretro, as far as I can tell it is very similar to libmame in
> approach, except of course it only handles a limited set of systems (NES and friends)
> so it can be considerably simpler than libmame. It's also callback based. Oh, and,
> the header file libretro.h is very poorly commented, which is a pet peeve of mine.
> You'll notice that libmame.h is heavily commented.
>
> For what it's worth, I have also written some other API layers to build on libmame. I
> tried to generalize as much as I could so that other emulators could be plugged in.
> It's not ready for prime time yet.



Bryan Ischo
MAME Fan
Reged: 03/28/10
Posts: 358
Send PM


Re: Announcing Libmame new [Re: azrael11]
#289526 - 06/15/12 12:50 AM


> How about delphi can i call the api from delphi 7 ....
> Is libmame a dll call or... something else...?

libmame is a C API and it is implemented as a C .so/.dll.

Sorry I have no idea what delphi 7 even is ... but if it can call into C DLLs, then yes it can call the API. Of course, the API is callback-based and I have no idea how that would work when called from something that is not native C.



AWJ
Reged: 03/08/05
Posts: 936
Loc: Ottawa, Ontario
Send PM


Re: Announcing Libmame new [Re: Bryan Ischo]
#289527 - 06/15/12 01:36 AM


You're a more hardcore Unix nerd than I am if you haven't heard of Delphi. It's a Rapid Application Development platform (framework and IDE) for Windows originally created by Borland in the 90s; they sold it some years ago. Basically it's VB, only replace Basic with Borland's dialect of object-oriented Pascal.



Bryan Ischo
MAME Fan
Reged: 03/28/10
Posts: 358
Send PM


Re: Announcing Libmame new [Re: AWJ]
#289528 - 06/15/12 01:42 AM


> You're a more hardcore Unix nerd than I am if you haven't heard of Delphi. It's a
> Rapid Application Development platform (framework and IDE) for Windows originally
> created by Borland in the 90s; they sold it some years ago. Basically it's VB, only
> replace Basic with Borland's dialect of object-oriented Pascal.

Yeah I'm a hardcode Unix nerd. Haven't used any development environment in any significant fashion other than C/C++/Java & emacs since ~1991.

Aside from the occasional port to Windows, which typically involves doing as much coding as I can in Unix in emacs and final tweaks in Windows in emacs.


Pages: 1

MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Pi 
0 registered and 5 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 3704