yusongying / imame4all

Automatically exported from code.google.com/p/imame4all
0 stars 0 forks source link

Building with XCode for non-jailbroken device-possible? #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello all,

this might be a stupid question, but I have just non-jailbroken devices, an 
iCade and an Apple developer account. Is it possible to build imame4all with my 
provisioning profile, then install it on my ipad? 
I couldn't find instructions for this, nor anyone trying the same before, so I 
thought I ask before trying. Thanks. 

What steps will reproduce the problem?
1. Download source
2. Start .xcodeproject
3. ???
4. FUN!!

Original issue reported on code.google.com by xarel1...@googlemail.com on 14 Jul 2011 at 6:36

GoogleCodeExporter commented 9 years ago
I am developing using a jailbreak 3.x toolchain over ubuntu. I was able to 
build with xcode making a makefile project on a OSX on VMWARE, but i deploy the 
executable to a jailbroken device later... anyway, i'm using jailbroken apis 
like btstack and private apis like Coresurface, so you need to mod files or 
finally deploy on a jailbroken device.

i going to find the xcode project if you want to play with, i'll attach later,,

Original comment by seleuco....@gmail.com on 14 Jul 2011 at 6:46

GoogleCodeExporter commented 9 years ago
Hello,
thanks for your answer. I have some experience in developing for iOS, but 
really zero about jailbreaking-I have no idea what jailbroken APIs mean. But I 
am pretty sure that it's no problem to use private APIs, as long as I just 
install on my device (i.e. don't attempt to publish it on the App Store). 
I'd be glad if you could post whatever you have! At least I could try...would 
love to play Phoenix with the icade. 
Thanks! 

Original comment by xarel1...@googlemail.com on 14 Jul 2011 at 7:55

GoogleCodeExporter commented 9 years ago
Here is  xcode project version 1.6.1, if hasn't the last changes suporting 
iCade becouse i'm pending to upload them... anyway tell me if you get it work, 
and the changes you made... if finally you can get it work, i suppouse you can 
add the iCade changes when i upload them

Original comment by seleuco....@gmail.com on 14 Jul 2011 at 8:19

Attachments:

GoogleCodeExporter commented 9 years ago
One thing i realice is that iMame read ROM files from 
/var/mobile/Media/ROMs/iMAME4all/roms instead app sandbox... you need to be 
able form read from there or change the code, also you must put all mame files 
needed in this foder... you can open the deb file if you need to get them

Original comment by seleuco....@gmail.com on 14 Jul 2011 at 8:23

GoogleCodeExporter commented 9 years ago
I don't see it ever being possible. As was said, it relies on unapproved APIs 
and requires files outside of its sanboxed iOS folder. Also I'm not sure if zip 
files are an allowable iOS file type. Additionally, you'd come into problems 
with the copyrights of the ROMs. 

Original comment by cck...@gmail.com on 14 Jul 2011 at 8:54

GoogleCodeExporter commented 9 years ago
i use zlib to read roms... but as you said, you need you change the code a 
little, to read from other place... it should not be difficult to change, i 
think... also he wants to build iMame for his own use, with his own roms ... so 
there is not a problem there, it he don't goint to publish iMame...

Original comment by seleuco....@gmail.com on 14 Jul 2011 at 9:02

GoogleCodeExporter commented 9 years ago
Hi Seleuco!
Thanks for uploading. I seem to have trouble unziping the .7z. OSX doesn't 
support it out of the box, I tried zipeg (http://www.zipeg.com) which is hung 
on 99% and 7zx which says it can't open the file. I downloaded now 13 MB to 
unsuccessfully open a 6MB file, makes the better compression kind of pointless 
:) Would you mind to post again as zip?
@cck, I think Mame would never make it to the App Store, as the ROMs are 
copyrighted as you say. But with a developer account you can codesign an App 
for upload on your own devices (actually, up to 100 UUIDs). 
I know of one project which uses a private API for creating buttons with a 
glass effect: https://github.com/bengottlieb/ButtonMaker - I was able to 
install this on my iphone. Of course this makes only sense for people with a 
developer profile, which in turn requires an Apple developer account, but 
people with a need for glass button creation for iOS are usually developers.

I think changing paths to the App directory shouldn't be too difficult, but I 
have to see what else is required. I hope it's ok to ask here when I run into 
problems.

Original comment by xarel1...@googlemail.com on 15 Jul 2011 at 8:22

GoogleCodeExporter commented 9 years ago
Just now zipeg seems to have unzipped the file - took more than 30 minutes! So 
no need to upload a zip!

Original comment by xarel1...@googlemail.com on 15 Jul 2011 at 8:29

GoogleCodeExporter commented 9 years ago
Fine. I zipped in first instance, but the file was more than 10mb. The max size 
allowed to upload. 

Enviado desde mi iPhone

El 15/07/2011, a las 10:29, imame4all@googlecode.com escribió:

Original comment by seleuco....@gmail.com on 15 Jul 2011 at 9:02

GoogleCodeExporter commented 9 years ago
Hi Seleuco, thank you for your XCode Project. I was able to compile the project 
for a non-jailbroken iPhone (I've a developer license) but on startup it hangs 
since it cannot find libBtStack.dylib. Unfortunately I was not able to compile 
statically the libBtStack (so it does not require the .dylib). Have you some 
workaround to suggest to compile iMame4All on a non-jilbreak iPhone? Is it 
possible to simply remove the BT code from the project?

Thank you

Zac

Original comment by sandro.z...@gmail.com on 19 Jul 2011 at 2:55

GoogleCodeExporter commented 9 years ago
I think you not get into a lot of problems removing or faking  btstack code, 
since it is isolated in 2 or 3 classes classes... Let me know your progress....

Enviado desde mi iPad

El 19/07/2011, a las 16:55, imame4all@googlecode.com escribió:

Original comment by seleuco....@gmail.com on 19 Jul 2011 at 3:05

GoogleCodeExporter commented 9 years ago
If someone can help me with porting for non-Jailbroken devices (Developer 
License Needed)...I brutally removed the bluetooth code (i removed just the 
references) and tried to add a "Shared Documents" Feature (rom upload via 
iTunes); I've modified the file config.cpp to config.mm to use some ObjC 
routine to use the app Path and modified the "/var/..." dirs to poit to 
App/Documents dir. The app compiles (no emulator, only on real device), starts 
but no pad is showed so no further actions can be made.

The screen rotates as i rotate iPhone. 

I think I commented the code that draws the buttons but I can't be able to 
understand where it is (my knowledge of the code is near to zero). I attached 
the modified code

Thank you all...

Zac

Original comment by sandro.z...@gmail.com on 20 Jul 2011 at 4:41

Attachments:

GoogleCodeExporter commented 9 years ago
if i have time i'll take a look this weekend... no promiss.. but i think it 
would be more interesting to make a fake bt libray only to resolve missing 
symbols...

anyway all DPad stuff is made in EmulatorController.m

Original comment by seleuco....@gmail.com on 20 Jul 2011 at 5:13

GoogleCodeExporter commented 9 years ago
I'll retry to compile libbtstack in a static library and will retry...

Original comment by sandro.z...@gmail.com on 21 Jul 2011 at 5:10

GoogleCodeExporter commented 9 years ago
I have revised your emulator controller cleanup,  I haven't  seen anything 
wrong... Maybe the images aren't loaded correctly..

Original comment by seleuco....@gmail.com on 21 Jul 2011 at 7:33

GoogleCodeExporter commented 9 years ago
I've also been trying to get it to compile on Xcode 4.0 (jailbreak) and all is 
looking good except it doesn't draw any of the buttons (you can tap the screen 
and they work though) I've checked the images are there but I'm scratching my 
head at the moment. I can't successfully get XCode to debug on the iPad to step 
through the code.

I have had some success at tuning the performance on iMame4all (my main reason 
to get this compiling). I'm getting some nice speedups with the LLVM compiler 
and specifically compiling for the iPad CPU. CPS1 games are getting about 5 fps 
increase and are more fluid. The biggest increase is with vector games, 
asteroids before ~50fps, my build ~90fps. Looks like the LLVM is using the 
hardware FPU. The increase may also be due to better use of the cpu cache. 

I would also like to see the default video colour be "Auto" instead of 16bit as 
there is a significant speed increase with 8bit. And the iPad CPU default clock 
at 80%.

The sound is still rather broken in iMame4all though, very out of sync 
unfortunately.

Original comment by squid123...@gmail.com on 22 Jul 2011 at 4:09

GoogleCodeExporter commented 9 years ago
Thank you seleuco! I think i got something!
0) I started from the file you shared above;
1) I downloaded the svn code of libBTstack, using the Getting Started in wiki 
to compile with ios "5.0" support;
2) I made an "ar" of the .o files in libBTStack "src" dir and made 
libBTStack2.a (the one you can see in Linker Options of the XCode Project): 
many thanks to my wife! She's better than me when dealing with gnu tools :D
3) Then I added the missing file iMame4all_2-Info.plist-aa to the XCode Project 
and in here I added the UIFileSharingEnabled options to load Roms from iTunes 
in the Document Sharing Section.
4) then the files in XCode Classes folder had a wrong (referenced to author 
home-dir) path: just deleted and imported again from the Classes Folder;
5) then I rewrote the get_documents_path and get_resource_path to deal with the 
App Bundle Directory. A couple of .c and .cpp file now are .m and .mm to allow 
mixage of c/c++ code with objC
6) It seems to work! (perhaps the sound routine is missing or I made some mess 
with the code...) All the important dir will be created in the app "Documents" 
dir. Roms can be loaded using iTunes.

Again thank you all and a special thanks to seleuco who shared this project. I 
hope someone will enjoy also this version.

Zac 

Original comment by sandro.z...@gmail.com on 22 Jul 2011 at 4:13

Attachments:

GoogleCodeExporter commented 9 years ago
>LLVM compiler and specifically compiling for the iPad CPU

i compile iMAME4all targeting ARM6 cpus, that's way it works for 3g user... it 
seems interesting the performance gain you get targeting ARM7... but is it 
needed the extra 5 fps? on my iPad 2... all games runs without frameskiping... 
iPad 1 is different thing... but vector games are not NTSC sync... has more 
than 50fps sense?

>"Auto" instead of 16bit as there is a significant speed increase with 8bit.

i did some testing and with auto mode... there had some roms with mising 
sprites if you selected this mode ... i think it was better idea force 16bits 
and let intellegents users put 8bpp if they needed

Original comment by seleuco....@gmail.com on 22 Jul 2011 at 4:42

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
>Thank you seleuco! I think i got something!

Fantastic... when i will have some time i would like to test your work... i 
would like to create a branch with your modifications in the SVN so other 
peeople could enjoy you work... let me know your future additions

Original comment by seleuco....@gmail.com on 22 Jul 2011 at 4:46

GoogleCodeExporter commented 9 years ago
Seleuco, forgot to thank you for this amazing work! Many years ago I wrote 
ZodMAME on the Tapwave and extensively tuned it for the ATI graphics chip in 
that device, this is the first iOS development I've tried, so I know a lot 
about the internal workings of MAME and it's many headaches it causes. I want 
to get the speed up on the iPad 1 as that is what I use and will have the iCade 
coming soon. I've tried desperately to get the Linux toolchain working but it 
is quite a complex mess, XCode is easy but there's things I can't do on it. So 
Zac's work is great getting it working on there. Possibly the future move is to 
get it working on XCode instead of toolchain and still have it working on 
jailbroken devices, I don't know enough about XCode yet.

Zac, have you got debugging on a device working with XCode & iMame4all yet? 

I really wanted to get the Cyclone 68000 asm core working to give it a big 
speed boost, i.e. full speed for everything on the iPad 1. XCode assembler and 
the Cyclone 68000 just do not get along. It should be possible to get Cyclone 
working on the Linux toolchain but I can't get the darn toolchain together. A 
VM of your toolchain dev would be nice but perhaps a bit too much to ask? 
Vector game Asteroids is a 60fps game.

Original comment by squid123...@gmail.com on 22 Jul 2011 at 6:51

GoogleCodeExporter commented 9 years ago
> I wrote ZodMAME on the Tapwave and extensively tuned it for the ATI graphics 
chip in that device

Yeah... great work there :)

>I want to get the speed up on the iPad 1

Fine. Your advices are welcome :)

>Linux toolchain working but it is quite a complex mess

It's is a really headache... i dont know how i get finally working ;)

>Possibly the future move is to get it working on XCode

i was able to work with xcode and i have other projects only there, like a 
amstrad cpc emulator, not yet finished... but i have a vmware osx virtualized, 
and i dont trust a lot in this setup.. i my wife allow me to spent some bucks, 
i would like to buy a mac mini to work with.. meantime i feel more confortable 
with my eclipse cdt

>Cyclone 68000 asm core working to give it a big speed boost

if you are been able to get it working, your are my hero and i really like to 
include your work on iMAME... i was big, big speed improve. As i know iOS is 
using some asm register internally. So you need to rewrite Cyclone to not use 
that register.

Original comment by seleuco....@gmail.com on 22 Jul 2011 at 7:29

GoogleCodeExporter commented 9 years ago
Apple using a specific register (R9) globally, disallowing many tightly written 
assembly sources to be used. 

Original comment by seleuco....@gmail.com on 22 Jul 2011 at 7:47

GoogleCodeExporter commented 9 years ago
http://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSAB
IReference/iPhoneOSABIReference.pdf

Original comment by seleuco....@gmail.com on 22 Jul 2011 at 8:09

GoogleCodeExporter commented 9 years ago
@squid: i did a very small job since the initial XCode project was shared by 
seleuco. I just did something to run iMame4All on a non Jailbroken device and 
to use iTunes to load the roms. I haven' t tested this version with wiimote 
since I don't have one.

In XCode you can do debugging attaching a real iOs Device for which you have a 
proper provisioning profile (I think that to use emulator you have to recompile 
libBtstack for i386). 

Original comment by sandro.z...@gmail.com on 23 Jul 2011 at 12:53

GoogleCodeExporter commented 9 years ago
@squid: i did a very small job since the initial XCode project was shared by 
seleuco. I just did something to run iMame4All on a non Jailbroken device and 
to use iTunes to load the roms. I haven' t tested this version with wiimote 
since I don't have one.

In XCode you can do debugging attaching a real iOs Device for which you have a 
proper provisioning profile (I think that to use emulator you have to recompile 
libBtstack for i386). 

Original comment by sandro.z...@gmail.com on 23 Jul 2011 at 12:53

GoogleCodeExporter commented 9 years ago
There are some issues with this Xcode project when compiling:

ld: warning: directory not found for option 
'-L/Users/zac/Downloads/Sviluppo/imame/btstack/btstack-read-only/src'
ld: warning: directory not found for option 
'-L/Users/david/Documents/iMame4all/lib'

Original comment by gus.bran...@gmail.com on 10 Aug 2011 at 7:43

GoogleCodeExporter commented 9 years ago
I think a little knowing is needed if you want to build imame since this 
project need to be tweaked for your needs.   Anyway that's should be easily 
fixed for you. 

Enviado desde mi iPad

El 10/08/2011, a las 21:44, imame4all@googlecode.com escribió:

Original comment by seleuco....@gmail.com on 10 Aug 2011 at 7:52

GoogleCodeExporter commented 9 years ago
Well, the issues above were just hardcoded paths to some of the files included 
like the btstack source.  I just wanted to mention it so that sandro could 
update his package with instructions.

Better news though, another user has taken the project and has an Xcode 
compatible version of 1.8.1 that also allows non-jailbroken developers the 
ability to load it up.  His page is at:

http://www.lesbird.com/iMame4All/iMame4All_Xcode.html

Original comment by gus.bran...@gmail.com on 12 Aug 2011 at 1:42

GoogleCodeExporter commented 9 years ago
Fine. I love you guys. That's the opensource cooperation. :)

Original comment by seleuco....@gmail.com on 12 Aug 2011 at 3:14