Ubuntu rules; LTris sucks; Gnometris blows.

Thread in 'Discussion' started by tepples, 7 Nov 2008.

  1. tepples

    tepples Lockjaw developer

    I bought an ASUS Eee PC 900, a miniature laptop computer. It included a customized version of Xandros (a Linux distribution) with a tetromino game called LTris. The worst thing about LTris was the non-delayed auto-shift, a "feature" also found in Tetripz and Bedter that caused no end of misdrops as single presses would move the piece by 2 cells. Even worse was no indication of a C compiler available through CNR or any other means. I found instructions on how to add Xandros package repositories in order to get GCC, but none of them had a libc6-dev package (stdio.h, stdlib.h, etc.) that exactly matched the point release of libc6 on the Eee PC. So I needed to replace Xandros with something that made it easier to install GCC.

    I put on Ubuntu, a better known Linux distribution, by using UNetbootin on my Windows box to load an ISO onto a 2 GB SD card. The Linux kernel in Ubuntu Hardy Heron (8.04) isnt completely compatible with the Eee PC, so I had to put on a custom kernel build and tweak a shutdown script to get everything to work. But at least I could get into Synaptic to install libc6-dev, liballegro4.2-dev, libaldmb1-dev, and libvorbis-dev without incident. While those were installing, I tried Gnometris, part of the gnome-games package.

    Here's what I'm about to add to the wiki:
    Hardcoded well width: 14 columns. Ouch. This negates the slight I surplus that ordinarily makes back-to-back tetrising bearable; I had to do a lot more skimming. I checked SVN, and its TODO.txt lists configurable well width as a known missing feature.
    No wall kick, no hold piece. One preview.
    Ghost is present but disappears whenever it overlaps the falling piece.
    Clockwise OR counterclockwise rotation, chosen before the game starts..
    Sound effects do not interrupt each other; instead, they queue up. Even at 60 TPM, I could still easily play fast enough to get 15 seconds ahead of the sound effects.
    DAS is based on operating system autorepeat. System > Preferences > Keyboard lets me set it faster than Windows or Mac Control Panel ever did, but as with anything else that uses OS autorepeat, the rotate key will discharge DAS.

    Finally, I got the C compiler up and running. There's no deb for JPGAlleg, but I downloaded and compiled it from source without incident. Then I downloaded, compiled, and ran Lockjaw 0.45. It all worked, except the bottom row of blocks in the 800x600 pixel window was covered up by the panel (that is, the taskbar) at the bottom of the Eee PC's 1024x600 pixel, 8.9 inch screen. I could run it in full screen once I set wndW = 1024, although Gus looked a little fat as expected. I plugged in a Logitech USB gamepad, and key configuration Just Worked.
     
  2. I wish Heboris "Just Worked" when I used Ubuntu...
     
  3. I wonder what would happen if the rightsholders descended upon one of those clones that "live natively" in the F/OSS culture. As in, is open source, runs on an open source OS - often exclusively, was developed on an open source OS, is well-known enough to be frequently bundled by default in an open source OS distro. Folks in the F/OSS community I imagine would react more drastically than if it was a case of some Flash, Mac or Windows clone. It'd essentially be like Solitaire or Minesweeper getting a cease-and-desist.

    So far, there seems to be no clone that 1)lives and breathes F/OSS, 2)Plays like how TC players like it (therefore potentially invoking the ire of the rightsholders) and 3)Is installed by default on a number of popular distros, all at the same time - what would change if there was one?
     
  4. Shouldn't a well width of 14 mean you do less skimming, not more?
     
  5. tepples

    tepples Lockjaw developer

    I seem to remember that some distro (temporarily) removed some falling block games after getting a letter from TTC. But most of the time, free software projects have been quick to respond to trademark infringement allegations: witness Phoenix to Firebird to Firefox.

    If I knew how to write a successful request for packaging, I'd probably ask for JPGAlleg and Lockjaw in Ubuntu, now that I know it runs perfectly.

    Oh, my bad.
     
  6. m:)

    m:) Unregistered

    you should try open SuSE 11!

    the wine implementation is great.
     
  7. Zaphod77

    Zaphod77 Resident Misinformer

    WIth a well width of 14, if it were using bag with previews and hold, you would never need to skim. ever.

    If it's memoryless, well then... moar skiming would probably be required.
     
  8. But strictly less than memoryless 10-width.
     
  9. tepples

    tepples Lockjaw developer

    What gets me is that Gnometris used to use an 11-block-wide well until mid-2007. I linked to the relevant change on the wiki.
     
  10. Ubuntu 8.10 has a problem with joysticks: all they do is move the mouse cursor around the screen. I'm sure it will be fixed eventually, but it's pretty annoying right now. (I found some lines to add to xorg.conf to fix it, but I just don't feel like doing that right now.)
     
  11. skrisman

    skrisman Unregistered

    We should write our own linux tgm clone!

    edit: o lockjaw i c ...
     
  12. wat

    wat Unregistered

    Duders stepmania ran for me with wine at 6 fps you're crazy.
     
  13. Why are you running StepMania in WINE when there is a Linux port?

    Also hi wat. :V
     
  14. m:)

    m:) Unregistered

    first time dealing with winedoors and simply installing windows apps off the web, like yum
     
  15. jujube

    jujube Unregistered

    i'm trying to compile Lockjaw on Ubuntu 8.10 Intrepid Ibex but i'm having some difficulty. i installed libc6-dev, liballegro4.2-dev, libaldmb1-dev, libvorbis-dev, and jpgalleg-2.5 (compiled and installed fine), but i get tons of errors when i try to compile Lockjaw (using the 'make linux' command). i've gotten this far:

    Code:
    gcc -Wall -s -mwindows obj/win32/ljpc.o obj/win32/lj.o obj/win32/ljplay.o obj/win32/pcjoy.o obj/win32/gimmicks.o obj/win32/random.o obj/win32/wktables.o obj/win32/speed.o obj/win32/options.o obj/win32/debrief.o obj/win32/macro.o obj/win32/ljreplay.o obj/win32/ljmusic.o obj/win32/old_pc_options.o obj/win32/pcsound.o obj/win32/pcdebrief.o obj/win32/ljlocale.o obj/win32/scenario.o obj/win32/ljpath.o obj/win32/ljvorbis.o -laldmb -ldumb -lvorbisfile -lvorbis -logg -ljpgal `allegro-config --libs` -o lj
    but then i start getting errors:

    Code:
    obj/win32/pcjoy.o: In function `bmp_read24':
    pcjoy.c:(.text+0x0): multiple definition of `bmp_read24'
    obj/win32/ljpc.o:ljpc.c:(.text+0x0): first defined here
    obj/win32/pcjoy.o: In function `bmp_write24':
    pcjoy.c:(.text+0x20): multiple definition of `bmp_write24'
    obj/win32/ljpc.o:ljpc.c:(.text+0x20): first defined here
    obj/win32/pcjoy.o: In function `set_window_title':
    pcjoy.c:(.text+0x40): multiple definition of `set_window_title'
    obj/win32/ljpc.o:ljpc.c:(.text+0x40): first defined here
    obj/win32/pcjoy.o: In function `desktop_color_depth':
    pcjoy.c:(.text+0x60): multiple definition of `desktop_color_depth'
    obj/win32/ljpc.o:ljpc.c:(.text+0x60): first defined here
    i get about a million of these 'multiple definition' errors, then finally this:

    Code:
    collect2: ld returned 1 exit status
    make: *** [linux] Error 1
    any suggestions? i tried installing any and all libraries related to vorbis, ogg, dumb, and allegro, but didn't make any progress with compiling lj.

    edit:
    HeborisSDL runs really well in Wine. i experience hiccups with Lockjaw though.
     
  16. I seem to remember Lardarse having a similar problem building my customized version of Lockjaw 0.46a (depends on libjpeg, instead of jpgalleg; allows a 64-bit build, amongst other advantages). I think it has to do with some of Allegro's headers not using #ifndef's properly, thus the "multiple definition". It appears the headers I have for Allegro on my installation don't cause "multiple definition" when #include'd multiple times. I'd have to have a look at your headers, to see if they're missing #ifndef's. I believe the ones to look at are (from your include directory, it's probably /usr/include) "allegro.h", "allegro/color.h", "allegro/base.h"; if you want to post these somewhere so I can have a look at them, I might be able to figure something out.
     
  17. tepples

    tepples Lockjaw developer

    I have 8.04 (the LTS version); I'll check its GCC version when I get home. What version of GCC does 8.10 use?
     
  18. jujube

    jujube Unregistered

    nightmareci: thanks, i'll upload those files and link to them here. btw i'm running 32 bit if that makes any difference. in the meantime i'll install libjpeg and see what happens.

    tepples: 8.10 uses GCC version 4:4.3.1-1ubuntu2

    edit - looks like i already had libjpeg62 and libjpeg62-dev installed. it's probably easiest to post the header files here, so here they are:

    allegro.h
    Code:
    /*    ______ ___  ___
     *    /\ _ \ /\_ \ /\_ \
     *    \ \ \L\ \\//\ \ \//\ \   __  __ _ __ ___
     *    \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
     *     \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
     *     \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
     *      \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
     *                     /\____/
     *                     \_/__/
     *
     *   Main header file for the entire Allegro library.
     *   (separate modules can be included from the allegro/ directory)
     *
     *   By Shawn Hargreaves.
     *
     *   Vincent Penquerc'h split the original allegro.h into separate headers.
     *
     *   See readme.txt for copyright information.
     */
    
    
    #ifndef ALLEGRO_H
    #define ALLEGRO_H
    
    #include "allegro/base.h"
    
    #include "allegro/system.h"
    #include "allegro/debug.h"
    
    #include "allegro/unicode.h"
    
    #include "allegro/mouse.h"
    #include "allegro/timer.h"
    #include "allegro/keyboard.h"
    #include "allegro/joystick.h"
    
    #include "allegro/palette.h"
    #include "allegro/gfx.h"
    #include "allegro/color.h"
    #include "allegro/draw.h"
    #include "allegro/rle.h"
    #include "allegro/compiled.h"
    #include "allegro/text.h"
    #include "allegro/font.h"
    
    #include "allegro/fli.h"
    #include "allegro/config.h"
    #include "allegro/gui.h"
    
    #include "allegro/sound.h"
    
    #include "allegro/file.h"
    #include "allegro/lzss.h"
    #include "allegro/datafile.h"
    
    #include "allegro/fixed.h"
    #include "allegro/fmaths.h"
    #include "allegro/matrix.h"
    #include "allegro/quat.h"
    
    #include "allegro/3d.h"
    #include "allegro/3dmaths.h"
    
    
    #ifndef ALLEGRO_NO_COMPATIBILITY
     #include "allegro/alcompat.h"
    #endif
    
    #ifndef ALLEGRO_NO_FIX_CLASS
     #ifdef __cplusplus
       #include "allegro/fix.h"
     #endif
    #endif
    
    
    #ifdef ALLEGRO_EXTRA_HEADER
     #include ALLEGRO_EXTRA_HEADER
    #endif
    
    #endif     /* ifndef ALLEGRO_H */
    
    base.h
    Code:
    /*    ______ ___  ___
     *    /\ _ \ /\_ \ /\_ \
     *    \ \ \L\ \\//\ \ \//\ \   __  __ _ __ ___
     *    \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
     *     \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
     *     \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
     *      \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
     *                     /\____/
     *                     \_/__/
     *
     *   Base header, defines basic stuff needed by pretty much
     *   everything else.
     *
     *   By Shawn Hargreaves.
     *
     *   See readme.txt for copyright information.
     */
    
    
    #ifndef ALLEGRO_BASE_H
    #define ALLEGRO_BASE_H
    
    #ifndef ALLEGRO_NO_STD_HEADERS
     #include <errno.h>
     #include <limits.h>
     #include <stdarg.h>
     #include <stddef.h>
     #include <stdlib.h>
     #include <time.h>
     #include <string.h>
    #endif
    
    #if (defined DEBUGMODE) && (defined FORTIFY)
     #include <fortify/fortify.h>
    #endif
    
    #if (defined DEBUGMODE) && (defined DMALLOC)
     #include <dmalloc.h>
    #endif
    
    #include "internal/alconfig.h"
    
    #ifdef __cplusplus
     extern "C" {
    #endif
    
    #define ALLEGRO_VERSION     4
    #define ALLEGRO_SUB_VERSION   2
    #define ALLEGRO_WIP_VERSION   2
    #define ALLEGRO_VERSION_STR   "4.2.2"
    #define ALLEGRO_DATE_STR    "2007"
    #define ALLEGRO_DATE      20070722  /* yyyymmdd */
    
    /*******************************************/
    /************ Some global stuff ************/
    /*******************************************/
    
    #ifndef TRUE 
     #define TRUE    -1
     #define FALSE    0
    #endif
    
    #undef MIN
    #undef MAX
    #undef MID
      
    #define MIN(x,y)  (((x) < (y)) ? (x) : (y))
    #define MAX(x,y)  (((x) > (y)) ? (x) : (y))
    #define MID(x,y,z) MAX((x), MIN((y), (z)))
      
    #undef ABS
    #define ABS(x)   (((x) >= 0) ? (x) : (-(x)))
      
    #undef SGN
    #define SGN(x)   (((x) >= 0) ? 1 : -1)
    
    #define AL_PI    3.14159265358979323846
    
    #define AL_ID(a,b,c,d)  (((a)<<24) | ((b)<<16) | ((c)<<8) | (d))
    
    AL_VAR(int *, allegro_errno);
    
    typedef struct _DRIVER_INFO    /* info about a hardware driver */
    {
     int id;             /* integer ID */
     void *driver;          /* the driver structure */
     int autodetect;         /* set to allow autodetection */
    } _DRIVER_INFO;
    
    #ifdef __cplusplus
     }
    #endif
    
    #endif     /* ifndef ALLEGRO_BASE_H */
    
    color.h
    Code:
    /*    ______ ___  ___
     *    /\ _ \ /\_ \ /\_ \
     *    \ \ \L\ \\//\ \ \//\ \   __  __ _ __ ___
     *    \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
     *     \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
     *     \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
     *      \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
     *                     /\____/
     *                     \_/__/
     *
     *   Color manipulation routines.
     *
     *   By Shawn Hargreaves.
     *
     *   See readme.txt for copyright information.
     */
    
    
    #ifndef ALLEGRO_COLOR_H
    #define ALLEGRO_COLOR_H
    
    #include "base.h"
    #include "palette.h"
    
    #ifdef __cplusplus
     extern "C" {
    #endif
    
    struct BITMAP;
    
    AL_VAR(PALETTE, black_palette);
    AL_VAR(PALETTE, desktop_palette);
    AL_VAR(PALETTE, default_palette);
    
    typedef struct {
     unsigned char data[32][32][32];
    } RGB_MAP;
    
    typedef struct {
     unsigned char data[PAL_SIZE][PAL_SIZE];
    } COLOR_MAP;
    
    AL_VAR(RGB_MAP *, rgb_map);
    AL_VAR(COLOR_MAP *, color_map);
    
    AL_VAR(PALETTE, _current_palette);
    
    AL_VAR(int, _rgb_r_shift_15);
    AL_VAR(int, _rgb_g_shift_15);
    AL_VAR(int, _rgb_b_shift_15);
    AL_VAR(int, _rgb_r_shift_16);
    AL_VAR(int, _rgb_g_shift_16);
    AL_VAR(int, _rgb_b_shift_16);
    AL_VAR(int, _rgb_r_shift_24);
    AL_VAR(int, _rgb_g_shift_24);
    AL_VAR(int, _rgb_b_shift_24);
    AL_VAR(int, _rgb_r_shift_32);
    AL_VAR(int, _rgb_g_shift_32);
    AL_VAR(int, _rgb_b_shift_32);
    AL_VAR(int, _rgb_a_shift_32);
    
    AL_ARRAY(int, _rgb_scale_5);
    AL_ARRAY(int, _rgb_scale_6);
    
    #define MASK_COLOR_8   0
    #define MASK_COLOR_15   0x7C1F
    #define MASK_COLOR_16   0xF81F
    #define MASK_COLOR_24   0xFF00FF
    #define MASK_COLOR_32   0xFF00FF
    
    AL_VAR(int *, palette_color);
    
    AL_FUNC(void, set_color, (int idx, AL_CONST RGB *p));
    AL_FUNC(void, set_palette, (AL_CONST PALETTE p));
    AL_FUNC(void, set_palette_range, (AL_CONST PALETTE p, int from, int to, int retracesync));
    
    AL_FUNC(void, get_color, (int idx, RGB *p));
    AL_FUNC(void, get_palette, (PALETTE p));
    AL_FUNC(void, get_palette_range, (PALETTE p, int from, int to));
    
    AL_FUNC(void, fade_interpolate, (AL_CONST PALETTE source, AL_CONST PALETTE dest, PALETTE output, int pos, int from, int to));
    AL_FUNC(void, fade_from_range, (AL_CONST PALETTE source, AL_CONST PALETTE dest, int speed, int from, int to));
    AL_FUNC(void, fade_in_range, (AL_CONST PALETTE p, int speed, int from, int to));
    AL_FUNC(void, fade_out_range, (int speed, int from, int to));
    AL_FUNC(void, fade_from, (AL_CONST PALETTE source, AL_CONST PALETTE dest, int speed));
    AL_FUNC(void, fade_in, (AL_CONST PALETTE p, int speed));
    AL_FUNC(void, fade_out, (int speed));
    
    AL_FUNC(void, select_palette, (AL_CONST PALETTE p));
    AL_FUNC(void, unselect_palette, (void));
    
    AL_FUNC(void, generate_332_palette, (PALETTE pal));
    AL_FUNC(int, generate_optimized_palette, (struct BITMAP *image, PALETTE pal, AL_CONST signed char rsvdcols[256]));
    
    AL_FUNC(void, create_rgb_table, (RGB_MAP *table, AL_CONST PALETTE pal, AL_METHOD(void, callback, (int pos))));
    AL_FUNC(void, create_light_table, (COLOR_MAP *table, AL_CONST PALETTE pal, int r, int g, int b, AL_METHOD(void, callback, (int pos))));
    AL_FUNC(void, create_trans_table, (COLOR_MAP *table, AL_CONST PALETTE pal, int r, int g, int b, AL_METHOD(void, callback, (int pos))));
    AL_FUNC(void, create_color_table, (COLOR_MAP *table, AL_CONST PALETTE pal, AL_METHOD(void, blend, (AL_CONST PALETTE pal, int x, int y, RGB *rgb)), AL_METHOD(void, callback, (int pos))));
    AL_FUNC(void, create_blender_table, (COLOR_MAP *table, AL_CONST PALETTE pal, AL_METHOD(void, callback, (int pos))));
    
    typedef AL_METHOD(unsigned long, BLENDER_FUNC, (unsigned long x, unsigned long y, unsigned long n));
    
    AL_FUNC(void, set_blender_mode, (BLENDER_FUNC b15, BLENDER_FUNC b16, BLENDER_FUNC b24, int r, int g, int b, int a));
    AL_FUNC(void, set_blender_mode_ex, (BLENDER_FUNC b15, BLENDER_FUNC b16, BLENDER_FUNC b24, BLENDER_FUNC b32, BLENDER_FUNC b15x, BLENDER_FUNC b16x, BLENDER_FUNC b24x, int r, int g, int b, int a));
    
    AL_FUNC(void, set_alpha_blender, (void));
    AL_FUNC(void, set_write_alpha_blender, (void));
    AL_FUNC(void, set_trans_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_add_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_burn_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_color_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_difference_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_dissolve_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_dodge_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_hue_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_invert_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_luminance_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_multiply_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_saturation_blender, (int r, int g, int b, int a));
    AL_FUNC(void, set_screen_blender, (int r, int g, int b, int a));
    
    AL_FUNC(void, hsv_to_rgb, (float h, float s, float v, int *r, int *g, int *b));
    AL_FUNC(void, rgb_to_hsv, (int r, int g, int b, float *h, float *s, float *v));
    
    AL_FUNC(int, bestfit_color, (AL_CONST PALETTE pal, int r, int g, int b));
    
    AL_FUNC(int, makecol, (int r, int g, int b));
    AL_FUNC(int, makecol8, (int r, int g, int b));
    AL_FUNC(int, makecol_depth, (int color_depth, int r, int g, int b));
    
    AL_FUNC(int, makeacol, (int r, int g, int b, int a));
    AL_FUNC(int, makeacol_depth, (int color_depth, int r, int g, int b, int a));
    
    AL_FUNC(int, makecol15_dither, (int r, int g, int b, int x, int y));
    AL_FUNC(int, makecol16_dither, (int r, int g, int b, int x, int y));
    
    AL_FUNC(int, getr, (int c));
    AL_FUNC(int, getg, (int c));
    AL_FUNC(int, getb, (int c));
    AL_FUNC(int, geta, (int c));
    
    AL_FUNC(int, getr_depth, (int color_depth, int c));
    AL_FUNC(int, getg_depth, (int color_depth, int c));
    AL_FUNC(int, getb_depth, (int color_depth, int c));
    AL_FUNC(int, geta_depth, (int color_depth, int c));
    
    #ifdef __cplusplus
     }
    #endif
    
    #include "inline/color.inl"
    
    #endif     /* ifndef ALLEGRO_COLOR_H */
    
     
  19. Just found the issue. I just happen to have an Ubuntu 8.10 32-bit virtual machine right now, and I tried building my custom Lockjaw 0.46a in it. With the default makefile, "CC := gcc" and "LD := gcc", I get the same kinds of errors you were getting; installing gcc-4.2 (you can search for that exact package name in Synaptic) and then changing them to "CC := gcc-4.2" and "LD := gcc-4.2", the build works, and it runs fine. So GCC 4.3 is the culprit here.

    If you're using Tepples' 0.46a, you don't need libjpeg, only my custom version uses it. I had to modify Lockjaw so that it wouldn't depend on jpgalleg anymore, as jpgalleg is x86 32-bit only (it has some assembly code), but libjpeg is all C, so using libjpeg I can make a build in x86_64 Linux (and possibly other platforms, like Mac OS X PPC).
     
  20. jujube

    jujube Unregistered

    i tried installing gcc-4.2 and making those changes in the lj makefile but still no luck. i'm getting the same error messages as before.
     

Share This Page