M.A.M.E (Arcade Emulator) and my TvTuner in PythonOgre

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

M.A.M.E (Arcade Emulator) and my TvTuner in PythonOgre

Post by ahmedali »

Just two projects I did in PythonOgre using ctypes. The objective was to play tv using a common tv tuner and play MAME arcade games inside pythonogre. Both uses ctypes for memory copy from framebuffer to ogre texture.

1- MAME using vcmame 0.105 http://mamedev.org/
If you dont know about MAME, its an emulator that can play thousands of arcade games. However problem was that it doesnt come as a library but a huge exe. The screenshot shows Art of Fighting 3 by SNK. the cabinet model is for StreetFighter2 i got from Baraka @ http://3darcade.mameworld.net/.

Image Image Image
Image Image

2- Common wdm tv tuner card, only one channel is active at a time ofcourse. Using python VideoCapture module modified for channel changing.
Image Image
User avatar
ChalkTrauma
Bronze Sponsor
Bronze Sponsor
Posts: 21
Joined: Fri Nov 03, 2006 4:25 am
Location: US
x 1
Contact:

Post by ChalkTrauma »

Hi ahmedali,

Very interesting project.. It looks great.. I've actually been working on a project that combines my love of M.A.M.E and my interest in Ogre3D for a while now ( along with my cabinet project, but that is another story ). I don't have much to show yet, things are very rough and I'm still working on the foundation and the tooling, but I had to post when I saw your work..

Do you mind elaborating on how you went about doing what you did, right now I have videos playing on my virtual cabinets, I never thought about trying what you have done..

I take it since you say you used the vcmame distro to pull MAME into visual C++ and you interfaced the MAME renderer with Ogre3D? Did you do this as a plugin, like the wmv video plugin?

How hard was it to do and what is the performance like?

Again, congrats on the good work..
'It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'
User avatar
johnhpus
Platinum Sponsor
Platinum Sponsor
Posts: 1186
Joined: Sat Apr 17, 2004 2:49 am
x 3

Post by johnhpus »

Really cool idea. Nice work.
User avatar
ChalkTrauma
Bronze Sponsor
Bronze Sponsor
Posts: 21
Joined: Fri Nov 03, 2006 4:25 am
Location: US
x 1
Contact:

Post by ChalkTrauma »

Hrmmm.. I had a look at the mame sources and was able to get mame .119 compiling with VS 2005 SP1 with a little bit of effort, wasn't exactly straight forward :?

But I'm guessing you are getting your textures from drawd3d_window_draw in osd\windows\drawd3d.c? Is that how you acquire your texture data?

Very novel idea.. my hat is off to you.. I never considered the option of rendering mame frames in my frontend.. it sure beats canned video files :)
'It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'
User avatar
jordan.day
Gnoblar
Posts: 5
Joined: Fri Sep 28, 2007 6:40 am

Post by jordan.day »

This is a really interesting project. I've never even really thought of a "virtual arcade" before, but this looks like a neat idea!
User avatar
ahmedali
Gnome
Posts: 302
Joined: Fri Feb 20, 2004 8:52 pm
Location: Lahore, Pakistan

Post by ahmedali »

Thanks guys, I just noted that it is possible to play more than 1 games in parallel if cpu can bear it.

@ChalkTrauma
In near future, once i get time, I shall upload altered files, python files and info. But I used mame 0.105, the latest mame0.119 has completely changed OSD base code.

process in simple words:
1- I downloaded vcmame for 0.105 + mame0.105 sources from mamedev.
2- Build vcmame in vs2005 bypassing multiple symbol linking error.
3- Converted project to Shared library, calling main() from exported function.
4- Used texture prepared for gdi blitting. which calls a python callback function.
5- Made changes to DirectInput for full non-exclusive input and non-focused input capturing.

in python:
1- mame launched in a seperate python thread.
2- a callback is received every time a frame is rendered in mame.
3- blit texture using ctype's memory copy function to ogre's texture.
User avatar
ChalkTrauma
Bronze Sponsor
Bronze Sponsor
Posts: 21
Joined: Fri Nov 03, 2006 4:25 am
Location: US
x 1
Contact:

Post by ChalkTrauma »

ahmedali,

Thanks for the info.. I'd be interested in looking at the code when you get time to upload it..
'It is not over unknown seas but back over well-known years that your quest must go; back to the bright strange things of infancy and the quick sun-drenched glimpses of magic that old scenes brought to wide young eyes.'
Post Reply