Linux/PPC patch and problem

2003-09-01
2003-09-04
  • Heitham Omar
    Heitham Omar
    2003-09-01

    A patch to get it to compile on Linux/PPC:

    diff -ur etw/include/menu_externs.h etw.linuxppc/include/menu_externs.h
    --- etw/include/menu_externs.h  2003-08-26 15:54:16.000000000 +0100
    +++ etw.linuxppc/include/menu_externs.h 2003-09-01 20:21:08.000000000 +0100
    @@ -112,7 +112,7 @@
        menu_music,use_speaker,no_sound,use_crowd,special,random_draw,nopari,make_setup,id_change,
        window_opened,game_start,penalties,free_kicks,friendly,arcade_back,arcade_teams,newpitches,
        cgxmode,final,nointro,killer,savehigh,can_modify,warp,music_playing,golden_gol,newchange,network_game,
    -   audio_to_fast,use_ahi,using_ahi,powerpc,use_gfx_scaling,wpa8,triple,force_single,chunky_version;
    +   audio_to_fast,use_ahi,using_ahi,power_pc,use_gfx_scaling,wpa8,triple,force_single,chunky_version;
    extern LONG Pens[256],framerate,t_l,display_id,situation_time,framerate,overscan;
    extern ULONG detail_level,ahimode;
    extern struct Match turni[64][32];
    diff -ur etw/include/my_protos.h etw.linuxppc/include/my_protos.h
    --- etw/include/my_protos.h 2003-08-26 15:54:16.000000000 +0100
    +++ etw.linuxppc/include/my_protos.h    2003-09-01 20:22:52.000000000 +0100
    @@ -1,4 +1,4 @@
    -#if defined( __PPC__) && !defined(MORPHOS)
    +#if defined( __PPC__) && !defined(MORPHOS) && !defined(LINUX)
    #include <devices/ahi.h>
    #include <powerup/ppclib/interface.h>

    diff -ur etw/include/os_defs.h etw.linuxppc/include/os_defs.h
    --- etw/include/os_defs.h   2003-08-26 15:54:16.000000000 +0100
    +++ etw.linuxppc/include/os_defs.h  2003-09-01 20:19:18.000000000 +0100
    @@ -70,9 +70,14 @@
    #define SWAP_WORD(x)   (x=SDL_Swap16(x))
    #define SWAP_LONG(x)   (x=SDL_Swap32(x))
    #elif defined(LINUX)
    +#if defined(__PPC__)
    +#define SWAP_WORD(x)
    +#define SWAP_LONG(x)
    +#else
    #define IS_LITTLE_ENDIAN
    #define SWAP_WORD(x)   (x=SDL_Swap16(x))
    #define SWAP_LONG(x)   (x=SDL_Swap32(x))
    +#endif
    #define stricmp strcasecmp
    #define strnicmp strncasecmp
    #else
    diff -ur etw/specials.c etw.linuxppc/specials.c
    --- etw/specials.c  2003-08-26 15:54:16.000000000 +0100
    +++ etw.linuxppc/specials.c 2003-09-01 20:22:12.000000000 +0100
    @@ -33,7 +33,7 @@
    extern int FIXED_SCALING_WIDTH,FIXED_SCALING_HEIGHT;

    BOOL make_setup=FALSE,game_start=FALSE,can_modify=TRUE,savehigh=FALSE,
    -   powerpc=FALSE,triple=FALSE,chunky_version=FALSE,use_gfx_scaling=FALSE;
    +   power_pc=FALSE,triple=FALSE,chunky_version=FALSE,use_gfx_scaling=FALSE;
    BYTE selected_number=0,wanted_number=0,duration=1,field_type=0,daytime=0;
    char *enabled=msg_7,*disabled=msg_8;
    extern struct SoundInfo *busy[];
    @@ -1789,7 +1789,7 @@
        break;

         case MENU_SYSTEM_PREFS:
    -   if(powerpc)
    +   if(power_pc)
            m->Bottone[1].Testo=enabled;
        else
            m->Bottone[1].Testo=disabled;

    The program compiles now but crashes on chunkyblitting.c:171: the first line in the bltanimobj function

        register struct ALine *line=src->FirstLne;

    It's called from menu.c:1122

        if (actual_menu->Immagine >= 0)
            BltAnimObj(logos, main_bitmap, actual_menu->Immagine, actual_menu->X, actual_menu->Y, bitmap_width);

    Any ideas?

     
    • Gabriele Greco
      Gabriele Greco
      2003-09-03

      First of all thanks for your patches, I'll put them in the CVS today, the problem is for sure endianess, there is an os_defs.h that configure linux ALWAYS as litte endian, this is of course wrong, I'll try to fix it, maybe using SDL_SwapBE instead of SDL_Swap.

       
    • Heitham Omar
      Heitham Omar
      2003-09-03

      If I add -fsigned-char to the CFLAGS then it works. With gcc 3.3 it crashes at random places but gcc 2.95.3 is rock solid.

      One other problem is the keyboard config, when I select the keyboard config button the next screen is blank, so it's impossible to change the keys. A joypad works but the buttons can't be changed.

       
    • Gabriele Greco
      Gabriele Greco
      2003-09-03

      Yep, there is still a lot to do to make it stable on every platform... Maybe that GCC 3.3 crashes are dued to different alignment constraints... I use 3.2.3 here both for win32 (mingw) and linux (redhat) and it works, anyway if you want I can add you to etw developers so that you can commit changes directly, I've just added the changes you made (and a few others) to the repository.

       
    • Heitham Omar
      Heitham Omar
      2003-09-04

      I definately think alignment problems because compiling with -O0 (no optimisations) then the game runs fine. I'm not sure what is the proper way to fix it.

      Thanks for the offer to become a developer but I won't really have a lot of time to work on it, so i'll just stick to patches for now.

      Have you got a TODO list with current problems and future enhancements to see where the project is going?

      I keep trying to cvs update but it keeps returning with no updates, know what the problem is?