View Full Version : Mame
rickbdotcom
08-06-2007, 06:57 PM
Anybody working on porting MAME? I just started playing around a bit to try and get SDL to compile with an aim towards using it to get the SDL port of MAME on the iPhone. Of course, the real fun will be figuring out an input method so you can actually play the games once it's actually ported.
LuciferChaos
08-10-2007, 04:24 AM
I don't know all that much about coding, but I'm looking to learn and figure the iPhone is a good place to start. Been using computers since the 1980's, the first computer I had was an Atari ST. I've got a basic understanding of C/C++ (read a few books, such as The C++ Programming Language by Bjarne Stroustrup) but haven't gotten into much actual coding. I thought about trying to port MAME to the iPhone as a good project. Have you started anything or do you know of anyone else or group working on it? The main problem seems to be how to emulate the controls on the iPhone.
sumorai
08-10-2007, 06:05 PM
I don't know all that much about coding, but I'm looking to learn and figure the iPhone is a good place to start.
Eh... My opinion, if you're interested, is that the iPhone is not a good place to start programming. Sure, you can write some C/C++ programs and run them in the terminal, but if you want to write real apps you're going to have to learn Objective-C and Cocoa, and then deal with trying to reverse engineer Apple's UIKit and other frameworks to make your program actually work on the iPhone. It's made a little easier because there are a number of 3rd party iPhone apps out there where the source is available, but there's great potential for extreme frustration trying to write an app for the iPhone.
If you've got a Mac, start playing with Xcode and write some Cocoa apps and that'll get you more prepared to deal with the iPhone. ;)
LuciferChaos
08-11-2007, 12:01 AM
Eh... My opinion, if you're interested, is that the iPhone is not a good place to start programming. Sure, you can write some C/C++ programs and run them in the terminal, but if you want to write real apps you're going to have to learn Objective-C and Cocoa, and then deal with trying to reverse engineer Apple's UIKit and other frameworks to make your program actually work on the iPhone. It's made a little easier because there are a number of 3rd party iPhone apps out there where the source is available, but there's great potential for extreme frustration trying to write an app for the iPhone.
If you've got a Mac, start playing with Xcode and write some Cocoa apps and that'll get you more prepared to deal with the iPhone. ;)
Yeah, thanks for the info. I've got a couple Macs w/ Xcode, I'm going to dig into that and see what I can get going. You ever read Mac OS X Internals: A Systems Approach by Amit Singh? I'm reading that right now, only about 150 pages into it though - out of 1600 pages total ;) Seems to be "the bible" on OS X.
What do you think of ADC? I got a Student membership to ADC (got a nice discount on a MacBook Pro) since I'm starting college this month. I want to get a Ph.D. in Computer Science.
rickbdotcom
08-11-2007, 10:34 PM
I haven't heard of anyone else doing it, so I've started working on it. I should have it up and running before too long.
http://code.google.com/p/iphone-sdl-mame/
Virtualball
08-13-2007, 03:41 AM
Rickbdotcom, how do you build your SDL? I added the source files, but what is the command to compile it?
rickbdotcom
08-13-2007, 07:59 AM
Oh sorry I haven't added instructions for compiling yet on the project page, too busy trying to get MAME to work. :) Assuming you've got the iPhone tool chain compiled already, use these options for configure.
./configure --host=arm-apple-darwin --prefix=/Developer/SDKs/iPhone/usr --enable-shared=no
Take a look at the iphone-sdk README for setting up the SDKs/iPhone directory.
I also symlinked arm-apple-darwin-gcc -> arm-apple-darwin-cc otherwise you'll have to also specify the compiler with --build option.
Virtualball
08-13-2007, 07:59 PM
Rickbdotcom, I'm having some trouble building SDL. Could you possibly zip your SDL folder and upload it to **********? That would be awesome :)
rickbdotcom
08-14-2007, 02:41 AM
If you don't have the toolchain and Developer/SDKs/iPhone directory set up correctly then you're not gonna be able to compile anything regardless. If everything is setup correctly configure should just work with those options. Get the SDL source and add/replace those files (or run the patch). Eventually this will all get added to the main SDL source tree, and I will provide a binary download of the libs and MAME. For now, if you wanna live on the bleeding edge and pretend to be an uber hacker you're gonna have to live with this level of support and figure out how to compile stuff on your own until that's done. :) What errors are you getting when you try to configure or compile? Take a look at config.log to get some ideas if ./configure is failing.
Virtualball
08-14-2007, 03:08 AM
I have a built toolchain and I have had it for two weeks now, it's just that when I configure SDL with your fixes, it still reverts to quartz and cocoa when compiling. It never goes to to the iPhone Video c files.
rickbdotcom
08-14-2007, 04:26 AM
OK I'll rebuild everything from scratch from the repository and see if I missed something...
I'm sorry, my mistake, I should've uploaded the configure script as well. You can run ./autogen.sh yourself to update the configure script. I am fixing now and will have the configure script uploaded shortly...
Thanks!
Virtualball
08-14-2007, 04:42 AM
No, don't be sorry. I should be thanking you, since the first day of the toolchain, I've wanted SDL and you ported it, you rock! :) Thanks for fixing it!
rickbdotcom
08-14-2007, 04:52 AM
Since we're giving out thanks I'd like to thank the SuperNES and iPhone Doom guys for figuring out all the CoreSurface stuff, and the tool chain guys...and Apple...and the guys that pay me lots of money to make computer games so I can buy an iPhone and a Macbook Pro... OK time to cut off, this is starting to sound like an Oscar acceptance speech. :)
Let me know if you have any more problems. I need to get this working with enough instructions so people can build all this themselves from scratch without too much hassle.
Virtualball
08-14-2007, 06:04 AM
Well, now everything links correctly during configuring but when I build, it shows this:
/bin/sh ./libtool --mode=compile gcc -g -O2 -I./include -D_GNU_SOURCE=1 -c ./src/video/iphone/SDL_iphoneevents.m -o build/SDL_iphoneevents.lo
Isn't that building with gcc and not arm-apple-darwin-cc? Also, when it finishes building, it says it's an intel library and not an arm. If you don't want to help me, I'll gladly wait for a precompiled library to pop up :)
rickbdotcom
08-14-2007, 06:24 AM
configure should get the correct compiler if you symlink or rename arm-apple-darwin-cc to arm-apple-darwin-gcc, alternatively you can specify the compiler with the --build option.
I'd rather not give out binaries at the moment since the code is in flux, and I'd rather go through this hassle now, so we can iron out/document all the kinks in the build process.
Virtualball
08-15-2007, 03:14 AM
Hey, I can't help you fix problems with the configure process anymore, I broke my Leopard (paid for btw) installation by installing iLife '08 (also paid for). Something about messing around with headers and pre-release software broke it :( Sorry, but good luck on getting it to work completely, and when I get everything up and running, I'll be looking forward to porting stuff over! :)
rickbdotcom
08-17-2007, 12:37 AM
The floating point code generation with the current toolchain is seriously hosed:
#include <stdio.h>
int main(int argc, char** argv)
{
unsigned int argb=0xffeeddcc;
float a = argb;
float b = argb;
printf("%f %f\n",a, b);
return 0;
}
-bash-3.2# /bin/a.out
4293844480.000000 0.000000
rickbdotcom
08-17-2007, 08:53 AM
Got it working finally!
http://iphone-sdl-mame.googlecode.com/svn/trunk/screenshots/menu.png http://iphone-sdl-mame.googlecode.com/svn/trunk/screenshots/gridlee.png
Stewcp
08-17-2007, 09:20 AM
WOW! well done that man... how playable is it or is this still early stages????
rickbdotcom
08-17-2007, 09:42 AM
Well the frame rate looks pretty good so far. Still a lot of heavy lifting to go in order to add input support and sound. I wanna make it totally configurable, so you can layout the inputs however you want for each game. I'd like to be able to do fancy gesture support so you're not necessarily tied to clicking on tiny parts of the screen to press buttons and control the joystick. Like say play Tempest by actually making a circle with your finger, or centering the joystick wherever you put down your finger, or tap anywhere to fire, etc.
Also want to redo the menu and configuration screens with native iPhone widgets, since the keyboard based menus aren't really appropriate for the iPhone's style of input.
awesome effort!
Might be cool to investigate whether a bluetooth gamepad like this might work or not?
http://www.smartgamepad.com/
rickbdotcom
08-17-2007, 04:09 PM
At the moment bluetooth only works with headsets. We'll have to await the efforts of the driver hackers for any other devices.
LuciferChaos
08-18-2007, 02:58 AM
Great work rickb!
Nibbler911
10-10-2007, 07:36 AM
Since the svn doesn't include the MAME source, I'm assuming your using the 062 and 029 revs of Xmame. Is that right?
And after using those versions I can get it built on 029 but after picking a game on the phone it goes to a blackscreen and then a crash back to springboard.
On the 062 rev I can't get it built, I keep getting stuck at
Compiling Vector.c which gives me:
"Could not match memory address. Inline asm failure!"
Whats the trick to get this built so I can help with the project...
Thanks and great work so far!
pac^man
04-29-2008, 11:52 PM
so this is dead? :(
iPhoneDave
04-30-2008, 12:50 AM
It looks like kaisersoze has been working on it for the past couple of months:
http://code.google.com/p/iphone-sdl-mame/source/list
But judging by the screenshots, it looks like he's using the SDK so we may not see it for awhile...
jbloggs
04-30-2008, 03:00 AM
Maybe the guy who developed EMame can port it to the iPhone.
http://www.harmonicode.com/EEMame/
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.