Porting MAME to Android - Android Software Development

I'm not a programmer, I just want to compile MAME for the Android. But, of course compiling code within the Android platform is not possible (as one would do it in Ubuntu or Debian), so I need the Android SDK and enough knowledge of java to call the native code, which needs to be packaged by the NDK, launched from within Cygwin.
Seems there will also be some video issues, beyond my comprehension. MAME developer R. Belmont posted this on porting MAME to Android:
The OpenGL support won't help you with GLES, that'll need to be an entirely separate code path
Click to expand...
Click to collapse
Whatever that means, it sounds like a lot of work. Looking around for similar projects for examples on how to call native code like the source for MAME , I found the java activity source code for aDosBox. It's also an emulator, but also has video requirements and uses native source as it's base. I'm still decrypting what it does, but for a developer (perhaps you!) looking to port MAME, it might be a good place to start.
What would be cool, is a couple templates I could just plug the needed particulars into. One for the Android.mk file that adds any required libraries needed for video stuff when I use ndk-build, and one for the java activity that simply calls the native code.
The MAME source code also has an SDL backend in the included build system. The build system 'detects' what platform it's on and builds accordingly. Can SDL be used in the Android SDK?

Related

source code to hook SystemAPISets implemented in nk.exe

mamaich said:
Occasionally I've found this page - http://blogs.msdn.com/sloh/archive/2005/05/27/422605.aspx
It has an interesting code at the bottom. I've already made a program that can hook system calls, I'll try to hook EnterCriticalSection and WaitForMultipleObjects and force them to use that code. Maybe this would reduce the occasional lockdowns.
Click to expand...
Click to collapse
I've made such a program. It gave no noticeable improvements for me, but I've attached it to this post with source code.
Source code would be interesting to people, who need to hook kernel functions that are implemented in nk.exe.
The function uses LoadKernelLibrary to load DLL, DLL relocates SystemAPISets table to writeable memory and hooks needed functions.
Code has no comments and looks ugly, but is short and should be easy to understand.
mamaich: thanks so much for this. I need all the hooking code I can get my hands on right now.
Will look at this ASAP. In your debt
V
Thanks...I've just started programming in EVC++ 4, so it might be useful.
Project is compiled with VS2005, it can be ported to eVC4. And it is designed for WM5, but should work also with older OSes, maybe minor modifications in internal OS structures may be necessary.

Pre-compiled TodayScreenSupport-UnManaged?

I'm trying to follow these instructions for creating a Today Screen Plugin, but I can't compile the unmanaged code. I can't even get eVC to run on my Vista machine, and I don't know enough about c++ to manually convert it to a VS.NET 2008 project.
Is there a reason that I have to compile it myself? Is there somewhere I could download a "pre-compiled" version without having to struggle through this?
I managed to get the eVC++ projects imported into VS.NET 2008 and built, hooray!.
Next I opened the "Managed" solution that is supposed to build the cab files for the device and an installer for my dev box. With some tweaking of paths, I was able to get this to build too.
However, it looks like it's building a new project type for vs.net2003, not 2005. So installing the custom project doesn't actually seem to work. And I still can't actually start working on what I *REALLY* want to do, which is writing a today screen plugin.
So now I have to figure out how to make this project type compatible with vs.net 2008.
What a convoluted and weird way to distribute this stuff. Why didn't they just distribute some binaries?
You could try memwatcher project from WM5 SDK which came with Visual Studio 2008 or to convert the project from WM6 SDK that is created for VS2005. The example shows free memory (SD card and RAM) and is useful as starting point for new projects in VC++ (unmanaged).
MemWatcher is written to support different screen sizes and orientation by calculating the size of bars according the device screen size.
Read more about Memory Watcher here:
http://msdn.microsoft.com/en-us/library/bb158711.aspx
I had no problems with these examples and created simple today screen for my needs with added to RAM/SD bars a battery level and large clock with date.
Thank you for the suggestion, but my C++ skills are negligible. I tried briefly to figure out how to write my own based on those samples, but since I don't even know string manipulation it was very much an uphill battle.
Later I found this, which allowed me to write something useable in C#. It's still alpha, but it seems to be stable. And it let me get on with the fun part of developing instead of trying to figure out linkers and static libraries.

A Few questions regarding development for android..

Hello all,
I'm now the proud owner of an android phone (htc desire) and as a hobbiest programmer i'm of course intrested in making (free) apps for it. I come from a linux based devices background (like gp2x, wiz, dingoo a320) etc. So i'm used to the gcc toolchains and libs and I read a bit around about android programming. Am i correct in saying that is not possible to just use a gcc toolchain for programming android apps since android uses some sort of java virtual machine ?
Or is this possible after all, just like one woud make apps for linux based devices. I think the Answer will be NO but i still ask since i wasn't certain and did not find that much information about it.
Suppose it is not possible, my only option for porting linux based games / apps would be to use the NDK and split up the main functions of a game and make a shared lib out of it, which could be called using JNI from java right ?
But i have a question if this is the case...
I can't really imagine that all phone manufactures use the same hardware in their phone or even the same architecture, so suppose i would use the NDK to create a shared lib with basic functions of a game i wish to port, wouldn't this lib need to be build for the specific architecture of a certain phone and thus could only work on that phone ? or are all android phones arm based ?
So you could say my question basically comes down to this :
Will Using the ndk and apps created with it, be less compatible then a java only app for all the droid phones out there ?
thanks
hmm seems i can answer my own questions now, i hadn't looked at the official ndk site itselve yet and did not know it would have all the info i needed.
So using gcc toolchains only does not work,
android uses a (modified ?)java virtual machine called dalvik
de libraries do have to be build for a specific architecture, and all droid's (phones) do seem to run on arm, but in the future the x86 architecture will be supported as well.
HOWEVER,
one can target ARMv5TE or ARMv7-A (and in the future x86) and include the needed libs (per architecture) in the apk file, the droid system will do the rest by checking if a lib for the specific architecture is availible or not.
also it's worth to note that ARMv5TE libs should work on any arm based droid phone, BUT without hardware fpu support. Since all the (linux based) devices i programmed for had no hardware fpu either and weren't as near as powerfull as my desire is, i don't think using software floating point would be a problem for my needs and if it i do need it i can always use fixed point math.
Just thought i should write a small excerpt of that page here, since there might be other people looking for it eventually

Java on Galaxy S

How can i install Java to my Galaxy S for working some websites that they need it???
for Browser there is no plugin available yet
but if you want to run say Java games application or software made for Java, then there is a software that can convert it from java into android apps
but it's not free
I'm going on the assumption that the OP was referring to Java SE 'applets' commonly used on the web, such as used for games like Minecraft or RuneScape.
I can't see any software in the immediate future allowing compatibility for this unless somebody voluntarily hacks something together although for what it's worth I had a look over to see what ARMEL compiled packages the Debian repository has:
http://packages.debian.org/experimental/openjdk-6-jre may work in a chrooted Debian environment if anybody wants to try it assuming all the dependencies are available for ARMEL too. I have no idea if this would work and I may have a go at attempting it some time myself. This of course probably isn't what you want but it technically would mean you could run your Java applets in a browser - just not the browser you'd probably want.

What is NDK ? why we use it ?

Welcome
I want to explain here shortly what is NDK ?
NDK stands for Native Development Kit. It is a good tool which enables you to use native languages like c/c++ in your apps besides android development code in java.
You may ask why i should this tool and write code in hard languages like c++ ?
Well, actually c++ is more complex than android code with java but it is very helpful in some apps like games
Especially, if you are ios and android developer and want to make a game, you will develope it for android by java then you will develope it by xcode and objective c for ios.
But if you made it by c++ using NDK, you will almostly use the same code in ios version and maybe make a little tweaks, so you will save a lot of time :good:
So it is very useful and time saver for apps will be made for ios and android platforms.
For more information about that, check android website by google for NDK and many other resources
Thanks for reading
........ and to think I thought NDK was the spark plugs you add to the development kit...... to give your work some Zing !

Categories

Resources