🎉 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!

AngelScript and Mac OS X

Started by
35 comments, last by afb 18 years, 4 months ago
Mandrav from code::blocks has ported as to x64 and PPC I believe now.
Advertisement
Quote: Mandrav from code::blocks has ported as to x64 and PPC I believe now.


LOL, I haven't :)

One of our users supplied an as_callfunc_ppc.cpp (which I sent to WL), but it was just a placeholder. The only think it did was actually define the three functions (DetectCallingConvention() and friends) so that he got no linker errors.

And, about 64bit, what I did was fix a couple int-to-void* casts add the following in as_config.h (just before the end):

// None of the above#if (!defined(AS_X86) && !defined(AS_SH4))    #ifndef AS_MAX_PORTABILITY        #define AS_MAX_PORTABILITY    #endif#endif


This just forces AS_MAX_PORTABILITY if a supported configuration is not found. This too just solves the linker errors.

But since we 're really starting to extend the IDE using AS, I 'm very interested in supporting 64bit and PPC. So I 'm trying to help WL with his efforts to create ports for those platforms.

It's ultimately up to WL when support will be available, since he's the one that knows the internal workings of AS better than anyone else ;).
But from my part, I 'm doing everything I can :)

Cheers,
Yiannis.
Quote: Original post by WitchLord
What's needed for the port is an implementation of as_callfunc_x86.cpp for the Mac OS X platform. It would require knowledge of inline assembly, but not too much as most of the actual assembly code could be taken from disassemblies of compiled code.


I've started on an implementation of "as_callfunc_ppc.cpp"...
(part of a larger effort to try get Code::Blocks running on Mac)

Are there any unit test or simple test cases, ready to use ?
Quote: Are there any unit test or simple test cases, ready to use ?


Never mind, found the "tests" directory :-)
Quote: One of our users supplied an as_callfunc_ppc.cpp


Quote: I've started on an implementation of "as_callfunc_ppc.cpp"...
(part of a larger effort to try get Code::Blocks running on Mac)


And, as you can understand, afb is the user ;)
Yes, with the help from mandrav and afb (and anyone else who might be interested in helping), I'm sure we will soon have support for PPC and 64bit processors.

The support for 64bit processors will be a bit longer though, since it requires quite a lot of changes to the internals of the script engine, it's not just a new as_callfunc_x86_64.cpp as it is for PPC. I'm working on these changes though, and hopefully I should be able to release a version that works on 64bit processors in MAX_PORTABILITY mode soon enough.

As I mentioned before, the fact that mandrav included AngelScript in Code::Blocks have increased AngelScript's user base immensely, and it's only a question of time now before the support for all major platforms are available.

Thank you very much for taking that decision, mandrav. [grin]

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

This is definitely going to take a while to complete,
and my time is divided between this and Lua 5.1...

But the idea is still to make AngelScript support
Darwin (Mac OS X), both for PPC and X86 architecture.
Will it be possible for you to provide the inline assembly code for the cdecl calling convention to start with? If I have that, then I think it will be easier for other people to help with the port.

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

Hi,
I'm really happy to see that there came some movement in the OS X port. afb if you should really manage to make the OS X port (PPC and X86) you would be my hero of the day.

By,
Martin
Quote: Original post by WitchLord
Will it be possible for you to provide the inline assembly code for the cdecl calling convention to start with? If I have that, then I think it will be easier for other people to help with the port.


Yeah, that's what I'm doing - should also provide for "this" calls, I believe.

On PowerPC, it goes something like:
- sort all parameters into: int, float (convert these to double), double, stack
- pass number of each type and a pointer to where they can be loaded in memory to asm
- before calling the function, load up registers r3-r10 and f1-f13 from memory
- r3 might be used as a pointer to struct, if such return types are used
- the stack is set up as usual, even if passed in as registers too
- floating point registers also use up int register "space" as well
- upon return, copy r3 back into a "result" variable and return that to caller

Totally ignoring AltiVec and PPC64 for now, so no vector or doubleword registers.
The registers will need 8 * 4 + 13 * 8, assuming that floats are converted to doubles.

On Intel, it should use a fairly normal System V IA-32 ABI - with some exceptions.
I don't have any Intel Mac, so I can't test whether those are working OK or not...

This topic is closed to new replies.

Advertisement