Bennu Game Development

English Forums => News and Releases => Mensaje iniciado por: EugeneP en Agosto 19, 2010, 08:01:05 am

Título: Haiku OS port
Publicado por: EugeneP en Agosto 19, 2010, 08:01:05 am
Is there Benuu port for Haiku OS?
Título: Re: Haiku OS port
Publicado por: EugeneP en Agosto 19, 2010, 08:06:02 am
Why I'm asking:
I successfully build latest Bennu for Haiku OS ( BeOS free open source remake http://www.haiku-os.org/ )
Fenix had full support of TARGET_BEOS and most of this code is still there, so I had only one minor problem.

And... er... I do not know what to do with this build :)
Is anyone here interested? Maybe someone already supports Haiku port and I just could not find it?
Título: Re: Haiku OS port
Publicado por: josebita en Agosto 19, 2010, 08:50:59 am
Hi!
I wrote that TARGET_BEOS code quite some time ago. I believe there was someone asking for this, yes, and I do try Haiku builds from time to time, too. Maybe you could PM me a copy of the build so I can upload it to the main BennuGD page as an unofficial build.

Also, just for reference: Did you have to do anything special to build the code? Any source changes? I assume you've created a GCC4 build, right? Any comments? :)
Título: Re: Haiku OS port
Publicado por: EugeneP en Agosto 19, 2010, 10:12:48 am
Yes, it is gcc4 build of course :)

Generally I followed "porting tips".
I have one build problem: a dependence on libm (is it really needed I wonder?) I simply removed it from modules/configure.in
And there was runtime problem with loading modules. Haiku returns really strange Dl_info from ldaddr (it is probably bug), so I add one check to loadlib.h
[code language="c"]#ifndef TARGET_BEOS
// On Haiku OS dladdr returns empty strings in info structure
// so condition below is always false
    if ( strcmp( ptr, handle->fname ) )
    {
        __dliberr = "Symbol not found (2)." ;
        return NULL;
    }
#endif [/code]

Here is my build: download (~400k) (http://uwolke.ru/s_haiku/dirty-bennu-build/bennugd-haiku-gcc4.zip)
Here is modified files, build scripts, required 3d-party packages and small "readme":  download (~12M) (http://uwolke.ru/s_haiku/dirty-bennu-build/bennugd-haiku-make-kit.zip)

I have not checked the build deeply, but it  runs packman and galaxian with no visible problems.
Título: Re: Haiku OS port
Publicado por: josebita en Agosto 19, 2010, 10:36:28 am
Thanks a lot! I'll upload your package ASAP.
Título: Re: Haiku OS port
Publicado por: josebita en Agosto 19, 2010, 10:46:37 am
I've tested your binaries in VirtualBox and they seem to be working just as advertised :) Just FYI, I'll strip the binaries before uploading, ok?
Título: Re: Haiku OS port
Publicado por: EugeneP en Agosto 19, 2010, 10:48:51 am
Not a problem :)
I think someone more wise should review my scripts anyway.
Título: Re: Haiku OS port
Publicado por: EugeneP en Agosto 20, 2010, 05:47:27 am
I've made some testing.
There are some joystick problems - it is 100% Haiku bug.
There is no scaling when going full screen. This probably could be fixed on bennu side.
No other issues yet.

I'll try to make popular bennu games running on Haiku, that would be nice addition to haikuware :)
Título: Re: Haiku OS port
Publicado por: josebita en Agosto 20, 2010, 09:25:28 am
Great to know :)

I'll try to upload your binaries this evening, sorry for the delay.
Título: Re: Haiku OS port
Publicado por: josebita en Agosto 21, 2010, 01:13:20 pm
Uploaded to the main downloads page.
Título: Re: Haiku OS port
Publicado por: EugeneP en Agosto 27, 2010, 05:07:08 am
Problem with dladdr() have been corrected in Haiku r38373, so it is possible now  to build unmodified Bennu sources for Haiku.
Give me some time and I provide a build script  ;)
Título: Re: Haiku OS port
Publicado por: SplinterGU en Agosto 27, 2010, 05:26:05 am
great! really great!

karma for you
Título: Re: Haiku OS port
Publicado por: Drumpi en Agosto 27, 2010, 01:03:27 pm
I don't use Haiku, but i give you a karma, just for made it ;)
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 06, 2010, 08:47:19 pm
I have done some experiments and I think it is better to build slightly patched version of Bennu for Haiku.
Here is a SCRIPT (http://uwolke.ru/_project/bgd-haiku/bennugd-haiku-builder.zip) I promised :)
Launch this script on Haiku with installed SDL and working internet. It will download sources from svn, will patch it and will build a package. More detailed README is inside.

(http://uwolke.ru/_project/bgd-haiku/bennu-at-haiku-2.png) (http://uwolke.ru/_project/bgd-haiku/bennu-at-haiku-2.png)

I started small page about the port ( http://uwolke.ru/node/7 ) and I'll try to keep it up to date (both, port and page :) ).

If anyone want to make a Bennu game run on Haiku, he may use one (http://uwolke.ru/_project/bgd-haiku/echo-bgd-haiku.zip) of test (http://uwolke.ru/_project/bgd-haiku/aggressivepong-bgd-haiku.zip) packs I prepared to examine this port.

Unfortunately there is a bug which probably make many mouse-based games unplayable. Be warned.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 06, 2010, 08:57:48 pm
Great EugeneP! Karma for you.

You can explain difference in your port vs. official version?

Thanks.
Título: Re: Haiku OS port
Publicado por: josebita en Septiembre 06, 2010, 11:49:12 pm
Thanks! Any chance of getting this into haikuports?
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 07, 2010, 05:01:14 am
Thanks! Any chance of getting this into haikuports?

Yes. As soon as I learn how to use HaikuPorter.
Título: Re: Haiku OS port
Publicado por: josebita en Septiembre 07, 2010, 07:35:48 am
Great! Thanks a lot!

PS: Splinter, the changes are in the script. He's basically not linking against libm (as its functionality is included in libroot in Haiku, but we don't really need to explicitly link against it as SDL relies on it).
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 07, 2010, 10:53:54 am
then no changes in code?
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 07, 2010, 11:17:37 am
then no changes in code?

Code with no changes will be compiled successfully but won't work. The problem in POSIX [not]compliance of Haiku dl-* functions. Work on this problem is being done but I decided that it is better to make a workaround for now (until next Haiku release).

This is my "patch" to avoid problems:

[code language="bash"]#removing dependence on libm
sed -i 's/ -lz -lm/ -lz/' modules/configure.in
#problems with dladdr on Haiku
sed -i 's/strcmp( ptr, handle->fname )/0/' core/include/loadlib.h[/code]

Literally changing 2 lines. This is kind of ugly but does trick for now.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 07, 2010, 11:28:46 am
please, let me know the return of "uname -a" command in your haiku os.

thanks.
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 07, 2010, 11:34:47 am
uname -a
Haiku shredder 1 r38492 Sep 1 2010 10:51:51 BePC Haiku

----edit---

It's a gcc4 hybrid.

there should not be any problems on Haiku past R1-rc1
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 07, 2010, 04:24:29 pm
one question more

if you run "./configure" ... what say in "Your machine:" ?

you can use "./configure |grep Your"

thanks
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 07, 2010, 06:24:31 pm
Your machine: i586 haiku

host system type: i586-pc-haiku
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 07, 2010, 08:53:54 pm
thanks!
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 07, 2010, 09:15:38 pm
I have a question.

what TARGET_* you set?
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 07, 2010, 09:19:57 pm
can you tell me that value give  ptr and handle->fname in loadlib.h when bennugd do strcmp?

this strcmp is needed.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 07, 2010, 09:27:12 pm
Can you update the svn and test it directly? without script.

I need the info in loadlib of ptr and handle->fname, for complete the port.

I suggest:

Código: [Seleccionar]
printf ("ptr:[%] handle->fname:[%s]\n", ptr, handle->fname ); fflush(stdout);

thanks.

PS: I add TARGET_HAIKU and new OS_ID = OS_HAIKU
Título: Re: Haiku OS port
Publicado por: josebita en Septiembre 07, 2010, 09:57:51 pm
I believe it's in the spirit of Haiku to be used as BeOS, so maybe having OS_ID OS_HAIKU=OS_BEOS should be appropriate.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 07, 2010, 10:11:35 pm
you are sure?

I think that BeOS for old versions... HAIKU for new versions... but maybe I wrong.
Título: Re: Haiku OS port
Publicado por: josebita en Septiembre 07, 2010, 10:32:17 pm
Haiku aims to be completely compatible (both at binary and at source code level) with BeOS R5, even if in some areas it's much more robust. I believe you should treat them both as the same thing.

As there is no other BeOS-like OS anymore, I'd suggest using TARGET_HAIKU in the source code and introducing OS_HAIKU but with the same value as OS_BEOS, so that older games that may be using TARGET_BEOS are treated the same as newer ones.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 07, 2010, 11:33:37 pm
I don't understand... if BEOS is same that HAIKU then what is the point of this port?
Título: Re: Haiku OS port
Publicado por: josebita en Septiembre 07, 2010, 11:46:31 pm
BeOS is dead and the current BennuGD C code doesn't work in Haiku as the code to support BeOS that has been inherited from Fenix doesn't compile directly on Haiku, even if the binary versions of Fenix I compiled then should work in today's Haiku.

Remember that when I created that code, Fenix still used static Makefiles for compilation. That's why eugeneP has had to touch the compilation scripts and the code in order to get the code working again.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 08, 2010, 01:19:48 am
I don't understand... well, I'll that haiku use beos code.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 08, 2010, 01:28:32 am
please... test again...
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 08, 2010, 03:49:29 am
Wait a second :)

1) I used TARGET_BEOS, and as josebita I think osid for Haiku and BeOS should be the same.

2)  Yes, I know this check is needed, but dladdr fails to find some symbols on Haiku. The easy way which I used is to drop this check and hope no one defines ambiguous functions. The middle way is to fix bug in Haiku - I reported it and some fixes were done, but problem is not resolved completely, I am searching for source of bug. The hard way is to add Haiku specific code to loadlib.h. Well, whenever I get spare time...

3) Actually testing could be done by anyone on virtual machine or real hardware using latest builds ( http://www.haiku-files.org ) I'll do some testing in few hours.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 08, 2010, 04:40:33 am
you can update svn and build the last svn version without your script? please?
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 08, 2010, 06:46:01 am
you can update svn and build the last svn version without your script? please?

SVN compiled successfully with no code modifications.

Doing autoreconf is yet required before configure (as described in http://ports.haiku-files.org/wiki/PortingTips )

[code language="bash"]libtoolize --force --copy --install
autoreconf -i[/code]

Unfortunately compiled bgdi fails to run a game ( I tested Adventures of Echo only ). Wait for few hours and I provide detailed report.

As I remember there were sets of complex tests for Fenix which allows to verify every language feature. Is there something like that for Bennu? Standard test would be useful now.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 08, 2010, 10:37:29 am
this have your changes, but TARGET_BEOS that use SVN version and I guess that you don't use it.

then Haiku is different that BeOS.

I continue thinking that need an OS_HAIKU, because all bennu's (and then Fenix) code for BEOS seem doesn't works in haiku.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 08, 2010, 10:54:01 am
EDIT: Please give more data... you said that you used TARGET_BEOS, but you don't tell me that you use it in your script.

well, I'm check yours script now, I'm see in bgd-configure.sh you use it.

then svn code must works exactly as works your patched version, you only forget tell me about this "-L/boot/system/lib"

but I don't think that this is the problem.

please, let me clear, your patched version works but the svn version don't works?
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 08, 2010, 11:02:14 am
I now add -L/boot/system/lib to configure.in

try again... but this must works same that works your version.
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 08, 2010, 12:19:45 pm
Oh, sorry :( I was not careful enough, svn r173 works fine. b^___^d

Also I suggest small changes to loadlib.h (diff attached) to avoid call buggy dladdr at all.

-L/boot/system/lib is not needed actually. it's an artefact form the very first tries.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 08, 2010, 12:29:00 pm
:(

I need revert changes.
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 08, 2010, 03:05:30 pm
Lets be calm in main svn branch. Debugging by forum posts in spare time is not the best development practice.

You need live Haiku to test everything by yourself. I'm going to make virtual machine installation to quick test svn builds. Which would you prefer? VirtualBox or Qemu?
Título: Re: Haiku OS port
Publicado por: FreeYourMind en Septiembre 08, 2010, 03:36:40 pm
VirtualBox for all members, thanks  ;D
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 08, 2010, 04:22:30 pm
I can't allow me more time for this now...

I already add a fix for avoid use dladdr.

thanks for all.

Haiku is already supported in the bennugd code.
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 08, 2010, 08:07:49 pm
Thank you for all your efforts. Results are great!

These games ( taken mostly from bennupack ) runs:

Adventures of Echo
Apocalypso
Aggressive Pong
CarreraSo-o
Carretera Peligrosa - Violeta
defendorx
Duck Gun - Javi
Energy
EEEEK! EEEEEK! HOOOOOOK!!!
Exploss
FenixLand
hiperbomb
JustFantasy
kakao
Last2007Game
Nazcadreams
NoFPGmatamata
Ofustris
Puzsion
SonicGates2
Space Invaders 2 - Jose
SquareAnihilation
Tetriss
Zomg


There is some mouse problem (probably came from SDL) which makes games like Puzsion or EEEEK! EEEEEK! HOOOOOOK!!! barely playable. Fixing it is my top priority for now, bughunt is starting.

Here is ARCIVE (118M) (http://uwolke.ru/_project/bgd-haiku/bennu-game-pack-for-haiku-01.zip) containing all these games and menu shortcuts. (unpack to /boot for install)
Archive does not contain bennu, but expects it installed in /boot/apps/bennugd (precompled bennu (http://uwolke.ru/_project/bgd-haiku/bennugd-r165-haiku-gcc4.zip))
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 08, 2010, 10:33:02 pm
thanks you!

please guys, do a karma gift to EugeneP.

About mouse bug, let me know details.

One question, all this games have sources?

thanks again.
Título: Re: Haiku OS port
Publicado por: FreeYourMind en Septiembre 08, 2010, 10:56:05 pm
Maybe not... I don't see any game of Geca soft in this list  ;D
This is a joke, of course, Karma Up.  ;)
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 09, 2010, 03:47:37 am
Most of these games are examples from here -->http://code.google.com/p/colombiandevelopers/downloads/list (http://code.google.com/p/colombiandevelopers/downloads/list), the sources are available.

I am writing test case on mouse issue.

2 FreeYourMind: Geca Blaster2 runs smoothly :)
Título: Re: Haiku OS port
Publicado por: FreeYourMind en Septiembre 09, 2010, 06:41:36 am
Can you try 'Skull' ?
What message apears at the detection of SO ?
Thanks :)
Título: Re: Haiku OS port
Publicado por: EugeneP en Septiembre 09, 2010, 08:32:26 am
I have found why mouse moves so jerky. Cleaning event queue in libsdlhandler is called on Haiku more frequently than do_mouse_events(), so most mouse events are thrown away.

I suggest small workaround: disabling queue cleaning (patch attached). Someone who knows Bennu core better than me should probably find nicer solution.

Other small bugs are non-fatal, most of Bennu games runs on Haiku now. I am totally happy. ^________________^
(http://forum.bennugd.org/index.php?action=dlattach;topic=1575.0;attach=1468) (http://forum.bennugd.org/index.php?action=dlattach;topic=1575.0;attach=1468)
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 09, 2010, 03:49:29 pm
thanks! karma!

I'll check your fix.
Título: Re: Haiku OS port
Publicado por: SplinterGU en Septiembre 09, 2010, 04:15:19 pm
I've check your fix...

I can't add it to official version, this is neccesary because in other ways, lot of events that we don't use, will be queued.

I need think in a better method for only remove pending event that haven't control.
Título: Re: Haiku OS port
Publicado por: Lt_Henry en Octubre 04, 2010, 10:56:15 am
HMFS!!! I was working on Haiku port just before summer, and I came several times to module import bug. What an annoying bug... great job EugeneP. :D
Título: Re: Haiku OS port
Publicado por: EugeneP en Octubre 07, 2010, 02:21:30 am
Tanks :)
Latest svn binaries are uploaded (see here (http://uwolke.ru/node/7))
Also I made package of few games prepared for Haiku (bennu game pack (http://uwolke.ru/_project/bgd-haiku/bennu-game-pack-for-haiku-01.zip) ~100Mb)

There is one small non-technical problem. I want nice Bennu icon. Vector icons are preferable in Haiku. I could not find any official icon, so I made one, but I am not skilled in arts :/

HERE IS (http://uwolke.ru/_project/bgd-haiku/bennu-haiku.svg) icon I created. Maybe someone can suggest a better variant?