Lambdarogue port?


klapse

Central Scrutinizer
Joined
Aug 30, 2012
Messages
1,932
Location
Germany
I have been playing a bit of LambdaRogue http://lambdarogue.net/ and think it is a good candidate for an Openpandora port.


It should be a simple recompile, requiring only libsdl, libsdl-image, libc and libx11.


It is a roguelike RPG with a nice story and multiple quests. I cannot compile for pandora for the time being, but wanted to suggest this game as an easy port for beginners. You should be able to install cdevtools, download lambdarogue source, compile it and package a PND without much trouble.


Cheers
 
From the sources page on Googlecode http://code.google.com/p/lambdarogue/

To compile, open fprl.lpi with Lazarus (Free Pascal IDE) and build everything.


You'll need to have SDL, SDL Mixer, and SDL Image libraries installed, incl. development headers.
I think is a good test to compile on the new Lazarus IDE just released on the Repo....but now don't have time...
 
I tested with Lazarus on the Pandora. It compiles with no error, but the game itself doesn't seem to recognize the screen resolution of 800x480 and falls back to 1024x768. The game doesn't seem to be playable without modification.


I neither have time to look at it for now...
 
Last edited by a moderator:
I tested with Lazarus ont the Pandora. It compile with no error, but the games itself doesn't seems to recognise the screen resolutio of 800x480 and fall back to 1024x768. The game doesn't seems to be playable without modification.


I won't heve time neither to look at it for now...

Get your Lazarus PND to build code with VFPv3 support and I'll make the necessary changes :-D


D.
 
:D


As a mater of facts, I am working on it (I wanted to do a quick test, it compiled quite quickly)...


I am having some difficulties with it (I think fpx does not send parameter to the assembler, so it doesn't recognise vfpv3 opcode), but I am not stuck (yet). I will update the Lazarus thread with some good news soon, I hope...
 
:D


As a mater of facts, I am working on it (I wanted to do a quick test, it compiled quite quickly)...


I am having some difficulties with it (I think fpx does not send parameter to the assembler, so it doesn't recognise vfpv3 opcode), but I am not stuck (yet). I will update the Lazarus thread with some good news soon, I hope...

not to derail the thread (much) but I had to override the assembler with a script:


-------8<-------------------


#!bin/sh


/usr/local/bin/arm-linux-as_org -meabi=5 -mcpu=cortex-a8 -mfloat-abi=softfp -mfpu=neon $@


-----------------------------


Which was called instead of "as" by FPC. This was for a cross-compiler under x86 though.


D.
 
The game has been modified for 800x480 here: https://gitorious.org/maemo-lambdarogue/maemo-lambdarogue/commits/master?page=2


There are many other changes as well. It might be fastest to use their source and just revert any maemo-specific changes which handle matchbox/x11 unique problems (edit) specifically ffc9dd8 which removes window icon settting.


Actually about half the commits look to be N900 specific for different keybindings, so maybe just using the 800x480 changes on newest lambdarogue sources would be best.


cheers
 
Last edited by a moderator:
@ZXDunny: yes, on the Pandora, it is the same, you have to define an "as" with all the right parameters. I haven't be that "agressive" on the pandora, but I will try those parameters.


@klapse: I won't look at this right now, I am rebuilding Lazarus PND with optimizations, but may be ZXDunny or someone else can.
 
I had a look at newer source code yesterday and it's seems to be, that any output to screen is hard coded in hundreds lines of codes. He uses text output and two different graphics modes, but this is done by checking "UseSDL" and "UseHiRes" - Flags at many positions in different source files, crazy. Changing may be very buggy and needs time.


I have no n900, but maybe the pandora version can run under n900, i'm using softfp and armel, I have uploaded a zip version, http://www.seban.de/download/games/lambdarogue.zip , please execute fprl and check, if program is running.


Thomas
 
I had a look at newer source code yesterday and it's seems to be, that any output to screen is ...
I think Aapo modified resources to fir 800x480. Did you download 1.6.1 source zip or is there a 1.6.4 source available?


I have freepascal compiler installed on n900 and I can compile some .pas files into object files, but 1) many give the error: Fatal: Can't find unit pthreads used by sdl, and 2) i do not see anything like a makefile to build the target executeable. Do i just type fpc fprl?


Your zipped build runs on my N900! Sound effects arent working but it feels fast. The version string says 1.6-maemo1. Which version is it? Thanks!


I would love to have 1.6.4 running someday!
 
Last edited by a moderator:
Lambdarogue is a Lazarus project, so Freepascal is not enough, you need, on your N900, to compile Lazarus (v1.02 for example) first.
 
Last edited by a moderator:
I take modified code for maemo and this is from 08.2011. Sound and music in maemo is done by calling external players, i have no idea, which program can be called for playing sound on N900. I compiled source with only with minimal changes.


Lambdarogue is not a Lazarus project, i can compile it without any modifcation in a pure fpc envrioment with "fpc fprl.pas -Mobjfpc". I can compile a pandora version from 1.6.1, but it has 800x600 size and keyboard controls. And i didn't found source from 1.6.4 version.


Thomas
 
Last edited by a moderator:
Ah, ok, sorry for the mistake. Anyway, you can compile with Lazarus.


I too haven't found where the 1.6.4 sources update is hidding in the site... It's not that clear :huh: .
 
Aapo gave me his buid command:


fpc -vewn -Tlinux -gl fprl.pas -olambdarogue


what is -Mobjfpc for?


I could not find unit pthreads and it gave error:


Fatal: Can't find unit pthreads used by sdl


Fatal: Compilation aborted


so I commented out the pthreads include and retried and got error:


Fatal: Can't find unit x used by sdl


Fatal: Compilation aborted


Any idea what packages might provide these? I could untar directly into my /usr/lib/fpc tree if needed.


I hope the 1.6.4 upstream will have the changes needed for 800x480 IFDEFd.


cheers


EDIT: I found dirs for both pthreads and x units here:


Nokia-N900-51-1:/opt/fpc/lib/fpc/2.6.0/units/arm-linux# ls |grep -e pthreads -e x11


pthreads


x11


... so why doesnt fpc FIND them? graaa
 
Last edited by a moderator:
"-Mobjfpc" - enable some language options, like class support, but you are right, not needed here


libpthread.so or libx11.so must bee in your library search path of fpc. Use paramter -Fl[Path to Libs] or edit fpc.cfg to setup the correct path.


Thomas
 
Last edited by a moderator:
ok, upgrading to fpc 2.6 and invoking with


fpc -vewn -Tlinux -Fl/opt/fpc/lib/fpc/2.6.0/units/arm-linux -gl fprl.pas -olambdarogue


built on N900!


this version expects 1024x768 though so now I guess I need to apply Aapo's 800x480 patches.


Also this version crashes for me with


/MyDocs/devel/LambdaRogue_1.6.1_Source $ ./lambdarogue


STATUS INFO : @ 11:34:59 MSG : Starting Application IN : Initialization


Error: SDL Mixer could not be initialized.


STATUS INFO : @ 11:34:59 MSG : Terminating Application IN : Finalization


~/MyDocs/devel/LambdaRogue_1.6.1_Source $


... though I have libsdl-mixer1.2 and -dev


anyone seen that error?


EDIT: got past the error by commenting-out InitMusic in fprl.pas


now it tries to open an 800x600 sdl window and fails, unsurprisigly...
 
Last edited by a moderator:
I got same error in windows, after changing audio paramter in unit externmusic.pas to



Code:
CONST

AUDIO_FREQUENCY : INTEGER = 22050;

AUDIO_FORMAT : WORD = AUDIO_S16;

AUDIO_CHANNELS : INTEGER = 2;

AUDIO_CHUNKSIZE : INTEGER = 4096;
, programs start, but in game loop no keys accepted.


Meanwhile i compiled the older maemo port with sound. I have uploaded a new pnd version to http://www.seban.de/.../ambdarogue.pnd . I changed mp3 to ogg, by taken sound from newer version. A ZIP Version for N900 is available under http://www.seban.de/...lambdarogue.zip


The maemo und 1.6.1 version are very different, good luck by adapting.


Thomas


Edit:


Compiled 1.6.1 for Pandora, works with music, but it's too big :)


Thomas
 
Last edited by a moderator:
Thanks Thomas, those constants fixed the sdl mixer init for me. I will chat with Aapo about adapting 1.6.4 to 800x480.


EDIT:


Mario has indicated he will release 1.6.4 source this weekend.


Aapo has indicated interest in applying his maemo patches to 1.6.4


EDIT2: N900 is still fun to hack with...
 
Last edited by a moderator:
Back
Top