Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on PowerPC 64 #82

Open
CloudyProton opened this issue Apr 13, 2022 · 5 comments
Open

Build fails on PowerPC 64 #82

CloudyProton opened this issue Apr 13, 2022 · 5 comments

Comments

@CloudyProton
Copy link

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.

Build Error.txt

@DaloLorn
Copy link
Contributor

@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. 😐

@kb-1000
Copy link
Contributor

kb-1000 commented Apr 13, 2022

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...

@CloudyProton
Copy link
Author

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.

@kb-1000
Copy link
Contributor

kb-1000 commented Apr 18, 2022

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.

@kb-1000
Copy link
Contributor

kb-1000 commented Apr 18, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants