StarRuler2-Source
StarRuler2-Source copied to clipboard
Build fails on PowerPC 64
There is issue is with ~/StarRuler2-Source/source/angelscript/source/as_callfunc_ppc_64.cpp regarding asDWORD lines. Not getting ppcArgs from memory return? Around line 434: memcpy( &ppcArgs[argWordPos], &args[i], sizeof(double) );
Everything else builds okay up until the section for angelscript.
@kb-1000 @Skeletonxf Any thoughts? All I can contribute to this conversation is "Have you tried building/installing from the OpenSR repos?", which is not necessarily helpful. 😐
According to the code, it wasn't written for an actual 64-bit platform:
// This part was written and tested by Jeff Slutter
// from Reactor Zero, Abril, 2007, for PlayStation 3, which
// is a PowerPC 64bit based architecture. Even though it is
// 64bit it seems the pointer size is still 32bit.
// It still remains to be seen how well this code works
// on other PPC platforms, such as XBox 360, GameCube.
I also doubt it has been tested much on AngelScript's side, and PPC was never a platform Star Ruler 2 has been officially built for. If I may ask, why specifically are you compiling it for PPC? It's not exactly a common platform nowadays, even less so for gaming...
Upon further investigation, it seems there is no code generator for ppc64 in AngelScript. This is an issue with AngelScript rather than with Star Ruler 2, and this issue can probably be closed for now.
I also doubt it has been tested much on AngelScript's side, and PPC was never a platform Star Ruler 2 has been officially built for. If I may ask, why specifically are you compiling it for PPC? It's not exactly a common platform nowadays, even less so for gaming...
I bought Star Ruler 2 through GOG some years ago. After changing my workstation over to a Raptor Blackbird platform, I have been salvaging games from my library which provide source.
there is no code generator for ppc64 in AngelScript
If you mean the JIT, yes, that's true, but the JIT is not mandatory and is automatically disabled when not on an x86 platform. The JIT is also not a part of AngelScript itself, it actually was originally written for this game. What is part of AngelScript itself is that callfunc code, which is platform-specific code to dynamically call function pointers. That code is mandatory and is what you're having problems with, since it's not written for a real 64-bit platform as mentioned above. Unfortunately porting that goes beyond my knowledge, because I don't know ppc assembly, so I can't help there. But if you want to, you can try to port it and contribute upstream, we'll then pull it in as part of OpenSRProject/OpenStarRuler#10.
I've been searching a bit more about this, and it seems as if that code can still be disabled by defining AS_MAX_PORTABILITY, but I'm not sure if that would break the API. You could try doing that, it might work (or not, no one knows until you try)