Jump to content
  • Advertisement
Sign in to follow this  
chewbakka

Running on Android with MIPS

This topic is 1293 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My project works like a charm on Android now. With 2.24.0 it is now fully working on Android ARM. However my MIPS based tablet is not so lucky. If I just compile the project with MIPS abi and run, the application will not be able to register a thing, every call to registering application interface fails.

I noticed from as_config.h that AS_MIPS will only get detected with the snsystems compiler or PSP. I could add AS_MIPS manually but I'm not sure about the other configuration macros like CDECL_RETURN_SIMPLE_IN_MEMORY and stuff.

Is there any experience about setting AS up for Android on MIPS?

Share this post


Link to post
Share on other sites
Advertisement
You're the first one to mention this. I didn't even know that there were MIPS machines running Android. :)

It will require a bit of experimenting to find the correct configurations for Android + MIPS platforms. In the test/test_feature program I have designed a series of tests to confirm the correct configuration. If you can run those and let me know which works or do not work I'll help you determine what configurations should be set.

The relevant tests are the following from the main.cpp file:


// The following tests are designed specifically to test the native calling conventions.
// These are grouped by calling convention and ordered in increasing complexity.
{
// cdecl
if( TestExecute() ) goto failed; else printf("-- TestExecute passed\n");
if( TestCDeclReturn::Test() ) goto failed; else printf("-- TestCDeclReturn passed\n");
if( TestExecute1Arg() ) goto failed; else printf("-- TestExecute1Arg passed\n");
if( TestExecute2Args() ) goto failed; else printf("-- TestExecute2Args passed\n");
if( TestExecute4Args() ) goto failed; else printf("-- TestExecute4Args passed\n");
if( TestExecute4Argsf() ) goto failed; else printf("-- TestExecute4Argsf passed\n");
if( TestExecuteMixedArgs() ) goto failed; else printf("-- TestExecuteMixedArgs passed\n");
if( TestExecute32Args() ) goto failed; else printf("-- TestExecute32Args passed\n");
if( TestExecute32MixedArgs() ) goto failed; else printf("-- TestExecute32MixedArgs passed\n");
if( TestCDecl_Class() ) goto failed; else printf("-- TestCDecl_Class passed\n");
if( TestCDecl_ClassA() ) goto failed; else printf("-- TestCDecl_ClassA passed\n");
if( TestCDecl_ClassC() ) goto failed; else printf("-- TestCDecl_ClassC passed\n");
if( TestCDecl_ClassD() ) goto failed; else printf("-- TestCDecl_ClassD passed\n");
if( TestCDecl_ClassK() ) goto failed; else printf("-- TestCDecl_ClassK passed\n");
// cdecl_objlast and cdecl_objfirst
if( TestCDeclObjLast::Test() ) goto failed; else printf("-- TestCDeclObjLast passed\n");
if( TestReturnWithCDeclObjFirst() ) goto failed; else printf("-- TestReturnWithCDeclObjFirst passed\n");
// thiscall
if( TestExecuteThis32MixedArgs() ) goto failed; else printf("-- TestExecuteThis32MixedArgs passed\n");
if( TestNotComplexThisCall() ) goto failed; else printf("-- TestNotComplexThisCall passed\n");
if( TestVirtualMethod() ) goto failed; else printf("-- TestVirtualMethod passed\n");
if( TestMultipleInheritance() ) goto failed; else printf("-- TestMultipleInheritance passed\n");
if( TestVirtualInheritance() ) goto failed; else printf("-- TestVirtualInheritance passed\n");
// stdcall
if( TestStdcall4Args() ) goto failed; else printf("-- TestStdcall4Args passed\n");
if( TestNotComplexStdcall() ) goto failed; else printf("-- TestNotComplexStdcall passed\n");
}


Comment out all other tests above these, until these ones work properly.

The MIPS code in as_callfunc_mips.cpp was written a long time back for the PSP. Hopefully the code will work with Android/MIPS too, but it is quite likely it will require a bit of adjusting to work perfectly.

Alternatively you should be able to use the AS_MAX_PORTABILITY mode, and use the autowrappers to register the application interface instead of registering the native functions.

Share this post


Link to post
Share on other sites
After 4 hours I still can't runt the test on android. I've managed to make it compile, but upon start, it crashes before the first line of main. So far I wasn't able to use the debugger for the MIPS device (not even for my own project) so I'm stuck.
I'm using generic calls for now :(
I'm willing to try it again. If someone makes an eclipse project that is working on ARM android and can be built by the android toolchain on windows, then I'll try it again.

Share this post


Link to post
Share on other sites
I'm pinning this topic on the forum so it can get a little more attention. Hopefully someone can lend a helping hand in getting AngelScript to work with native calling conventions on Android with MIPS.

Share this post


Link to post
Share on other sites

I've just implemented support for native calling conventions for Linux with MIPS (see latest revision in the SVN). I'm hopeful that this will make it fairly easy to also add support for Android with MIPS.

 

I've yet to learn how to compile and test the library against Android though, so if anyone else has experience in this area and has an Android system with MIPS processor I'll gladly accept aid in this department. :)

Share this post


Link to post
Share on other sites

I managed to find the time to learn how to use tools for working with Android (Android Studio, Android NDK, etc), and I'm happy to announce that AngelScript now supports native calling conventions on Android with MIPS CPUs too. :D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!