OpenXcom Forum
Contributions => Offtopic => Topic started by: sergioreynel on January 10, 2015, 10:26:42 pm
-
Has anyone tried to port openxcom to wii since I think its made with sdl and I found this https://wiibrew.org/wiki/SDL_Wii
:)
also star control 2 has been ported to wii and it uses sdl https://wiibrew.org/wiki/The_Ur-Quan_Masters
-
so no comments :(
-
I guess. There are no people here interested in that and having skills in WII homebrew development. I don't know if it's possible since wii has too few memory.
-
Well, I'm trying.
Found sources and compile SDL library for wii.
Found sources and compile libyaml-cpp for wii
Set the environ for run configure:
export SDL_LIBS="-lSDL_net -lSDL_ttf -lSDL_gfx -lSDL_mixer -lSDL_image -lsmpeg -lSDL -ljpeg -lpng -lfreetype -lvorbisidec -lz -lfat -lwiiuse -lbte -lwiikeyboard -logc -lm"
export SDL_CFLAGS="-I/C/devkitPro/libogc/include/SDL -D__WII__"
export YAML_LIBS="-lyaml-cpp"
export YAML_CFLAGS="-std=gnu++11 -I/C/devkitPro/libogc/include"
and run it:
configure --host=powerpc-eabi
Then: now I have the Makefile, but when I run make I have this (first) error.
CXX src/Basescape/openxcom-BaseInfoState.o
src/Basescape/BaseInfoState.cpp: In member function 'virtual void OpenXcom::Base
InfoState::init()':
src/Basescape/BaseInfoState.cpp:302:49: error: 'floor' was not declared in this
scope
ss5 << (int)floor(_base->getUsedStores() + 0.05) << ":" << _base->getAvailable
Stores();
^
make[1]: *** [src/Basescape/openxcom-BaseInfoState.o] Error 1
make[1]: Leaving directory `/c/Users/Utente1/Downloads/WIIdev/OpenXcom-master'
make: *** [all-recursive] Error 1
I think that something is missing in my environ.
I'm a C programmer, not a C++ programmer, and now I need a BIG help to continue...
-
In this case, floor is just the basic floor() function from the standard library, so a #include <math.h> should solve this one error. But you may find many other problems...
-
Do you use yaml-cpp from git HEAD? If so, you forced to compile openxcom with c++11 features. Currently openxcom source code is not ready to it. These error can be easly fixed in code (I even have local branch for it), but i'm not sure for backward compatibility. If you like, I can provide my branch for testing.
-
He already doing that.
Overall yaml-cpp purge lot of unused headers from it source code causing breaking OXC because many files depend on yaml headers to include it. Simply adding `#include <math.h>` or `#include <algorithm>` should fix most of this errors.
[ps]
wrong header name: "algorithm" without "s".
-
In this case, floor is just the basic floor() function from the standard library, so a #include <math.h> should solve this one error. But you may find many other problems...
Perfect!
Include <math.h> solve the error.
Now I've some problems with missing SDL header files...
-
Perfect!
Include <math.h> solve the error.
Now I've some problems with missing SDL header files...
Then probably `SDL_CFLAGS` is not used by build script. I would suggest to place this value manually to script. In long run it isn't proper solution but it could save you lot of time in fighting with strange error caused by not properly configured environment.
Another casue could be that headers and nested deeper in directory (like `/SDL/SDL/` or something like that).
-
Then probably `SDL_CFLAGS` is not used by build script. I would suggest to place this value manually to script. In long run it isn't proper solution but it could save you lot of time in fighting with strange error caused by not properly configured environment.
Another casue could be that headers and nested deeper in directory (like `/SDL/SDL/` or something like that).
Not so easy :(
Problem was OpenGL headers needed by SDL.
I found this https://wiibrew.org/wiki/Gl2gx, compile (there was few errors, "Development is currently on hold until a new maintainer is found") then I install it in my environ.
Now, build stops with the error in the attached file.
-
add `#include <algorithm>`.
-
add `#include <algorithm>`.
Done.
Same problem in 2 other sources.
And we have complete the Basescape folder :D
-
An after a cast problem solved by myself:
src/Battlescape/BattlescapeGenerator.cpp: In member function 'void OpenXcom::Bat
tlescapeGenerator::loadRMP(OpenXcom::MapBlock*, int, int, int)':
src/Battlescape/BattlescapeGenerator.cpp:1672:30: error: comparison between sign
ed and unsigned integer expressions [-Werror=sign-compare]
if (*k - (int)nodeOffset == *i)
^
This is the next:
src/Battlescape/DebriefingState.cpp: In member function 'void OpenXcom::Debriefi
ngState::prepareDebriefing()':
src/Battlescape/DebriefingState.cpp:863:5: error: 'for_each' is not a member of
'std'
std::for_each(save->getAlienMissions().begin(), save->getAlienMissions().en
d(),
^
make[1]: *** [src/Battlescape/openxcom-DebriefingState.o] Error 1
make[1]: Leaving directory `/c/Users/Utente1/Downloads/WIIdev/OpenXcom-master'
make: *** [all-recursive] Error 1
Solved with google:
added #include <algorithm> :)
-
This is still error caused by lack of algorithms header: https://en.cppreference.com/w/cpp/algorithm/for_each
You should add this two headers (math too) until you get error that is not fix by this change.
Another suggestion is reduce error level in compiler. Right now I see that you have makefile with very aggressive setting (-Werror) that probably will not allow compiling OXC. In long run all this warnings should be fixed but is not your job to do this. Ignore it and try get AFAP working binary.
-
This is still error caused by lack of algorithms header: https://en.cppreference.com/w/cpp/algorithm/for_each
You should add this two headers (math too) until you get error that is not fix by this change.
Another suggestion is reduce error level in compiler. Right now I see that you have makefile with very aggressive setting (-Werror) that probably will not allow compiling OXC. In long run all this warnings should be fixed but is not your job to do this. Ignore it and try get AFAP working binary.
Thanks for the tip.
But now I have a big problem: no execinfo.h and no *backtrace* function in devKitPro environ.
Must i stub them?
CXX src/Engine/openxcom-CrossPlatform.o
src/Engine/CrossPlatform.cpp: In function 'void OpenXcom::CrossPlatform::stackTr
ace(void*)':
src/Engine/CrossPlatform.cpp:997:49: error: 'backtrace' was not declared in this
scope
size_t size = backtrace(array, MAX_STACK_FRAMES);
^
src/Engine/CrossPlatform.cpp:998:48: error: 'backtrace_symbols' was not declared
in this scope
char **strings = backtrace_symbols(array, size);
^
make[1]: *** [src/Engine/openxcom-CrossPlatform.o] Error 1
make[1]: Leaving directory `/c/Users/Utente1/Downloads/WIIdev/OpenXcom-master'
make: *** [all-recursive] Error 1
-
You can completely remove it for now, this is for debugging purposes.
-
At the end, all source was compiled, but...
I have a problem loading the final elf.
I think that I need a complete porting of OpenGL for WII... :(
-
Then simply drop it. OpenGL is only bonus feature. Define macro `__NO_OPENGL` to get ride of it.
-
Well.
At the end we have a .dol to load on dolphin emulator.
But it is too big.
$ powerpc-eabi-size openxcom.dol
text data bss dec hex filename
6742955 399516 70797632 77940103 4a54587 openxcom.dol
Original DOS version requires only 2 Mb of RAM.
Why openxcom is so "fatty"?
-
do you compile it with debug symbols? Usually on windows my working copy of exe have 200MiB but when I create final version then it have only 3MiB.
Most of this is debug information that used for debugging and not need for normal usage.
-
do you compile it with debug symbols? Usually on windows my working copy of exe have 200MiB but when I create final version then it have only 3MiB.
Most of this is debug information that used for debugging and not need for normal usage.
Removed -g and recompile all sources, but results are the same.
-
Removed -g and recompile all sources, but results are the same.
try add `-s` and maybe `-Os`: https://stackoverflow.com/questions/6687630/how-to-remove-unused-c-c-symbols-with-gcc-and-ld
-
It's too hard optimize this...
src/Engine/Scalers/init.cpp:uint32_t RGBtoYUV[16777216];
-
I don't touch that code but if I recall correctly you can drop some scalar out without any big consequences. Basic scalars don't use it.
-
After long time I go back to this project.
Finally I can start OpenXcom on a real Wii, but it stops during initial menu print.
I think that problem is that the game load all data files in memory at startup.
There is a way to load only needed file and free resource when they are not needed?
-
"free" is impossible, but "load" is already controlled by "lazyLoadResources" configure.
Another question what you try to load? if its base game that mean it would be hard to make it more slim. If some big mod, then load on demand loading will have big impact
-
It is works :D
Problem is a poor porting of SDL libraries on WII. I had to modify SDL libraries to see results.
Now I can see the main menu, can chose the level and can see Geoscape. To move the cursor for positioning thefirst base and stop: I need to emulate keyboard for the input phases ::)
Not sounds (for now).
A question: there is a way to completly replace original graphic and sounds? I can't (eventually) release the Wii version without graphics and sounds... ;D
-
In theory yes but we did not try do this as this could awake some ancients lawyers that would lay destruction on their path :)