🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Can't register object method: "Invalid configuration"

Started by
13 comments, last by mono2k 17 years, 3 months ago
Could you please explain what do I need to do to implement as_callfunc_arm.cpp? I've a lot of ARM based devices and a good knowledge in assembly, a little tutorial to AS internals would be highly appreciated :-)
Advertisement
Cool!

Well, the first thing is to modify the as_config.h file so that the ARM target platform can be identified and the proper flags set. You'll need to add a new flag for AS_ARM that should be defined when the native calling functions for this processor class should be compiled. Take a look at how the other flags, AS_X86, AS_MIPS, AS_SH4, etc are set in this file.

The second thing is to start a new as_callfunc_arm.cpp file. Base it on one of the other files, so that you know what will be needed.

PrepareSystemFunction() is used to set flags that tell AngelScript how the calling convention works, for example if values are returned in memory location or in registers, etc.

CallSystemFunction() is the function that the AngelScript VM will call in order to call the registered function. Here you'll get access to AngelScript's stack, the function calling convention, etc, so you can make the necessary preparations.

The implementation of these two functions and everything they use are specific to the target platform, so I cannot tell you exactly how that should be done, but if you know that the ARM ABI (application binary interface) is similar to one of the already supported platforms you can certainly use some ideas from those.

Once you have this begun, it's mostly an iterative process of writing the native code, running test_feature to see what works and what doesn't, change the code, and test again, and so on. I suggest you start with implementing support for CDECL which is the most common format. Once you have that done implement the CDECL_OBJLAST and CDECL_OBJFIRST which allow the developer to write light wrappers to class methods. The last step is to implement the THISCALL support.

If you can get at least CDECL support working, it will be a good enough start to include in the library. Once we have that other developers are sure to be able to build upon it to add support for the rest of the calling conventions.

Regards,
Andreas

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Thanks for pointing me the right direction! I've already looked through as_callfunc_*'s and the code is almost clear for me. There's a problem with floats on ARM based hardware (i.e. PDAs, phones), basically there's no FPU built into popular cores like PXA, OMAP & etc, everything is done via float point emulation. I need to investigate ABI...
I can implement a compiler flag to remove the float type. That way you'd be able to use AngelScript anyway. If float support via fixed point emulation is necessary an application registered type could be added for that.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

I'm very busy right now but I hope I'll look at this soon. I'm personally interested in ARM port so I hope this will be done in 1-2 months.

This topic is closed to new replies.

Advertisement