Compiling Lockjaw on Linux

Thread in 'Discussion' started by Pineapple, 21 May 2007.

  1. Which flavour of Linux are you using? I managed to get it to compile on Ubuntu with a few changes to the makefile, so anything Debian based should be fairly possible.
     
  2. reivilo

    reivilo Unregistered

    im using ubuntu feisty, but i thought a game made for windows make calls to windows api so not possible to compile ?

    I tried make but i got logically an error at the call to windres to add the icon.

    can u please send me the makefile? Would be cool to put a debian version on the website too [​IMG]
     
  3. tepples

    tepples Lockjaw developer

    You can probably just drop the windres part when compiling Allegro apps (e.g. freepuzzlearena or LJ) for any platform that doesn't use windows icons.
     
  4. I'm using Edgy on mine, but it should be mostly the same. You'll need to do something similar to the following:


    sudo apt-get install libaldmb1-dev libogg-dev libvorbis-dev to get the dev versions of all but one of the required libraries.

    Download and extract http://www.pineight.com/lj/jpgalleg-2.5.tar.gz somewhere, then open a command window and navigate to inside that folder.

    ./fix.sx unix
    make
    sudo make install


    Extract LJ to a folder somewhere, and modify the makefile as mentioned on my user page (it's pretty much what tepples said while I was writing this)

    Then navigate to the folder and make. You may find that you have to make -B when upgrading to a new version.
     
  5. reivilo

    reivilo Unregistered

    okay thanks man in fact i had already downloaded the packeges for allegro, etc

    i just deleted the windres part and everything about the icon and it worked.

    Now lockjaw runs but when i press drop there is more than one piece that drops and nothing changes if i change the key settings in gnome. I also tried to copy my ini file from windows that worked well and there was still the same problem of more pieces dropping when i press drop.

    What c file should i modify and where to force a delay between keypresses (must be 150ms or so.
     
  6. cdsboy

    cdsboy Unregistered


    I don't believe theres any code that has something like that. I think you would have to talk to tepples to confirm that how ever. Also why are you guys talking about compiling lockjaw in the cultris thread? Wouldn't that be better suited in the Lockjaw thread?
     
  7. tepples

    tepples Lockjaw developer

    There is initial drop if the ARE and DAS are set in a certain relationship, but that's it. Delete lj.ini to restore near-Guideline behavior.

    Split.
     
  8. reivilo

    reivilo Unregistered


    huh?

    I think u didnt understand what i meant :

    when i press the alt firm drop key, there is more than one piece that gets on the ground,


    Anyway i did what u did and all it only added a lock delay which i dont want

    I want instant lock, but iwant a tiny small delay between two key presses so that not more than one piece drops.


    Here is a replay :

    http://www.tetrisconcept.com/wiki/index ... ge:Bug.ljm
     
  9. I've not seen this behaviour before, so I don't know how to deal with it. I do have one idea, though. Search ljpc.c for BPM_TO_TIMER and change the number there, to see if it still happens when the game is slowed down...
     
  10. tepples

    tepples Lockjaw developer

    I was able to reproduce your problem by setting Lock reset to Classic, setting Entry delay to 0, and holding down the Alt firm drop key.


    What you're seeing is the effect of Initial Actions. In the next version, I have disabled initial drop when lock delay is shorter than DAS delay. Go into macro.c, look around line 160 for "// Treat up the same way", and change the if condition to the following:

    Code:
      // Treat up the same way when hard drop lock is set to lock on release.
      if (c->hardDropLock != LJZANGI_SLIDE
        || p->lockReset == LJLOCK_NOW
        || p->lockDelay <= c->dasDelay) {
       c->repressKeys |= VKEY_UP | VKEY_MACRO(4);
      }
    
     
  11. reivilo

    reivilo Unregistered

    it works [​IMG]
    thanks [​IMG]
     
  12. I can get Lockjaw 0.34a to compile without any problems thanks to the modified makefile found on the wiki. I'm using Ubuntu Feisty Fawn 7.04.


    However, I tried to use Skins, but it didn't work. [​IMG]
    I get an error that it can't find the files in the Skins-folder although they are present in that exact same folder it gives me an error on.

    I even tried to rename all the files in there to not have spaces in their filenames and then modifying the .skins file to the same.

    But it didn't help..


    So I tried to get LJ 0.36 and try to compile it hoping that it would help me out.

    Well, problem is, both 0.35 and 0.36 won't compile for me in Ubuntu, although 0.34a works perfectly.


    Here's my output after running make with the modified makefile:

    Code:
    burbruee@burbruee-desktop:~/lockjaw$ make
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/ljpc.o src/ljpc.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/lj.o src/lj.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/ljplay.o src/ljplay.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/pcjoy.o src/pcjoy.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/gimmicks.o src/gimmicks.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/wktables.o src/wktables.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/options.o src/options.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/debrief.o src/debrief.c
    src/debrief.c: In function buildDebriefPage:
    src/debrief.c:90: warning: implicit declaration of function siprintf
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/macro.o src/macro.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/ljreplay.o src/ljreplay.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/ljmusic.o src/ljmusic.c
    gcc -Wall -O2 -std=gnu99 -DWITH_REPLAY=1 -MMD -c -o obj/unix/ljvorbis.o src/ljvorbis.c
    gcc -Wall -s obj/unix/ljpc.o obj/unix/lj.o obj/unix/ljplay.o obj/unix/pcjoy.o obj/unix/gimmicks.o obj/unix/wktables.o obj/unix/options.o obj/unix/debrief.o obj/unix/macro.o obj/unix/ljreplay.o obj/unix/ljmusic.o obj/unix/ljvorbis.o -laldmb -ldumb -lvorbisfile -lvorbis -logg -ljpgal -lalleg -o lj
    obj/unix/debrief.o: In function `buildDebriefPage':
    debrief.c:(.text+0x1c2): undefined reference to `siprintf'
    debrief.c:(.text+0x20c): undefined reference to `siprintf'
    debrief.c:(.text+0x238): undefined reference to `siprintf'
    debrief.c:(.text+0x279): undefined reference to `siprintf'
    debrief.c:(.text+0x2c9): undefined reference to `siprintf'
    obj/unix/debrief.o:debrief.c:(.text+0x364): more undefined references to `siprintf' follow
    collect2: ld returned 1 exit status
    make: *** [lj] Error 1
    Any ideas? Please? [​IMG]
     
  13. tepples

    tepples Lockjaw developer

    Can you give the exact text of the error message? And have you made sure to turn backslashes into forward slashes? Forward slashes work on all platforms, including Windows, but backslashes work only on Windows. Which skins did you try?

    On machines without a floating-point hardware (such as Game Boy Advance and Nintendo DS), some popular C library implementations give the 'siprintf' function, which is like 'sprintf' missing the %e, %f, and %g format specifiers. On machines with floating-point hardware, it is supposed to pass through to sprintf:

    Code:
    // On newlib, use a variant of sprintf that doesn't handle floating
    // point formats. On other C libraries, use standard sprintf.
    #ifdef HAS_FPU
    #define siprintf sprintf
    #endif
    
    So try passing -DHAS_FPU when compiling.
     
  14. Heh, I just noticed that in all of the .skin files I have tried there was only backslashes in them, so changing them to forward slashes obviously made the skins work.
    ( I must have been blind when checking these files the first three times. [​IMG] )

    I downloaded the 'Weeds_Lockjaw_Pack.zip' found on this forum.
    Perhaps the author should think of editing the .skin files to use forward slashed instead of backslashes for compability with linux.
    Well, I got the skins working with 0.34 but it would still be nice to be able to compile more recent versions. I didn't quite understand how to pass the -DHAS_FPU flags while compiling as I usually don't need to mess around with flags.

    ( Usually I just run 'make' or 'gmake' and it works. [​IMG] )


    Thanks for your help tepples. =)
     
  15. reivilo

    reivilo Unregistered

    Edit : i had extracted the zip in the same folder as the previous version and it didnt work.
     
  16. tepples

    tepples Lockjaw developer

    Look in the makefile for where it defines -DWITH_REPLAY=1 and add -DHAS_FPU after that.


    As for any crash bugs, I wish I could help you, but I don't have space on my machine for a copy of Ubuntu at the moment.
     

  17. Well, Ubuntu uses live-cd so you actually don't need to install anything on your harddrive at all. [​IMG]
    You can just boot from the cd and wait for it to boot up, you can even install applications on it, and when you restart your computer all will be back to normal, no harm done. =)
     
  18. tepples

    tepples Lockjaw developer

    But does the live CD include GCC with Allegro installed? And can programs execute from a FAT32 data partition? Or does that need a file system with support for permissions?
     

  19. You can install those things through the Synaptic Package manager or apt-get if you prefer, I don't know the details but you have some space available for installing applications with the live-cd temporarily.


    Oh, and by the way, I added -DHAS_FPU to the makefile but it didn't change anything, it outputs the exact same error.


    EDIT: And I don't think there should be any problems with executing programs from a FAT32 partition. NTFS on the other hand, since normally you have no support for writing on NTFS, it's read-only and it would cause problems if said program were to write back information ( for example an .ini file ) in the same folder, but executing should still work, but like I said it could give you errors for NTFS.
     
  20. Try doing make -B after updating.
     

Share This Page