jump to navigation

Search:  

Retrospec Forum » Feedback on Retrospec Games

[closed]

Deflektor X4

(13 posts)

Tags:

No tags yet.

  1. Anonymous

    Well, a bit late, but here's the forum entry for Deflektor X4
    Any comments are most welcome!
    Posted 11 years ago #
    Login to Send PM
  2. Anonymous

    New version uploaded!
    It has that annoying hiscore bug fixed, appart from other minor improvements, like mouse wheel control.
    Posted 11 years ago #
    Login to Send PM
  3. robert@fm
    Administrator

    Er, what's the cheat code for the original remake? sad.gif

    And am I correct in believing that the "x4" of this version refers to the graphic cells being 16x16 rather than the 8x8 of the original, so that they're 4x larger (in area) than before? smile.gif
    Posted 11 years ago #
    Login to Send PM
  4. Anonymous

    Hi, and excuse me becouse of the late answer, I know I don't come arround here as often as I should...
    QUOTE(robert@fm @ Oct 9 2006, 09:22 PM)
    Er, what's the cheat code for the original remake? sad.gif

    Well, it¡s been five years since it was released, so I think I can tell you: just type the word "mortadelo" when playing the game, and a new button will appear wink.gif
    And no, it doesn't work on the x4 version wink.gif
    QUOTE(robert@fm @ Oct 9 2006, 09:22 PM)
    And am I correct in believing that the "x4" of this version refers to the graphic cells being 16x16 rather than the 8x8 of the original, so that they're 4x larger (in area) than before? smile.gif
    [right][snapback]1916[/snapback][/right]

    Your'e nearly right smile.gif Original Speccy tiles where 16x16 and this remake's are 64x64. In fact, the Spectrum's screen resolution was 256x192, and this new remake is 1024x768, hence the x4 on the title biggrin.gif
    Posted 11 years ago #
    Login to Send PM
  5. RedDwarf
    Member

    The source code from http://retrospec.sgn.net/users/ignacio/dow...lektor_x4_f.zip is the last available?
    When trying to play in Linux I found that the buttons from the main menu had no text. After debugging...

    - dlg_inicializar() doesn't specifies a default value for "boton.dialogo".
    - dlg_incorporar_boton() makes the next test:
    CODE
      for(f=num_boton=0;f<NUM_BOTONES && boton[f].dialogo>=0;f++)
        if(boton[f].dialogo==dialogo) num_boton++;

    the test is correct... if default boton[f].dialogo != 0. Since you don't specify a default value the compiler specifies it, and '0' is value a lot of compliers would use. gcc does, and so the buttons from te main menu have no text.

    But even if I add a "boton[f].dialogo = -1" to dlg_inicializar() the buttons still appear without text.
    The problem is
    CODE
    for(f=0;f<NUM_BOTONES;f++)
     {
      tipo_fuente[f].fuente=NULL;
      tipo_fuente[f].dy_fuente=0;
     }

    inside dlg_inicializar().
    It should be:
    CODE
    for(f=0;f<NUM_FUENTES;f++)
     {
      tipo_fuente[f].fuente=NULL;
      tipo_fuente[f].dy_fuente=0;
     }

    NUM_BOTONES must be replaced by NUM_FUENTES.
    Since NUM_BOTONES > NUM_FUENTES the original code overwrites the array boton[] in the code generated by gcc.

    I was thinking about packaging the game for Linux. But is this source the last one available? I can't even believe your compiler generated a working code from this source... that would be a lot of luck.
    Posted 9 years ago #
    Login to Send PM
  6. RedDwarf
    Member

    I have wrote the missing code that adds support for sending highscore for Linux (or any other OS with libcurl support...). But then I found this in introducir_puntuacion() from deflektor.c
    CODE
      if(f)
       {int pntt;
        char cd[21];
        for(;f<28;nombre[f++]=' ');
        for(f=27,pntt=puntuacion; f>21 && pntt; f--,pntt/=10) nombre[f]='0'+pntt%10;
        for(f=0;f<21;cd[f++]=0);
        for(f=8;f>i;f--)
         {// Desplazamos hacia abajo los récords menores
          for(n=0;n<28;n++) max_txt[f*29+n]=max_txt[(f-1)*29+n];
          max_pnt[f]=max_pnt[f-1];
          for(n=0;n<12;n++) max_cod[f*13+n]=max_cod[(f-1)*13+n];
         }
        for(f=0;f<28;f++) max_txt[i*29+f]=nombre[f];
        max_pnt[i]=puntuacion;
        for(f=0;f<12;f++) max_cod[i*13+f]=cd[f];
        escribir_pnt();
        puntuaciones(10+i);
       }


    These two lines
    CODE
        for(f=0;f<21;cd[f++]=0);
        for(f=0;f<12;f++) max_cod[i*13+f]=cd[f];

    ensure that max_cod[] will be all zero. And since max_cod is the part that stores the score that is send to the server, the score is never added to the website.

    Is this some kind of proteccion against cheats or the source code available for download is really an old version?

    In any case, here there is a patch that corrects the bugs and adds Internet highscore support to Linux:
    CODE
    --- dlg.c 2006-10-13 13:51:50.000000000 +0200
    +++ dlg.c 2008-02-03 15:00:22.000000000 +0100
    @@ -54,12 +54,13 @@
       boton[f].x[0]=boton[f].x[1]=boton[f].x[2]=boton[f].x[3]=0;
       boton[f].y[0]=boton[f].y[1]=boton[f].y[2]=boton[f].y[3]=0;
       boton[f].estado=boton[f].dialogo=boton[f].numero=-1;
    +   boton[f].dialogo=-1;
       boton[f].texto=NULL;
       boton[f].func=NULL;
      }
     botones_usados=0;

    - for(f=0;f<NUM_BOTONES;f++)
    + for(f=0;f<NUM_FUENTES;f++)
      {
       tipo_fuente[f].fuente=NULL;
       tipo_fuente[f].dy_fuente=0;
    --- internet.c 2006-03-17 19:51:12.000000000 +0100
    +++ internet.c 2008-02-03 19:28:25.000000000 +0100
    @@ -3,9 +3,9 @@
    #include "stdio.h"

    // USE HERE THE PROPER DEFINITION FOR THE OS YOU ARE COMPILING DEFLEKTOR ON
    -#define DEFL_WIN // Windows
    +//#define DEFL_WIN // Windows
    //#define DEFL_MAC // Macintosh
    -//#define DEFL_LNX // Linux
    +#define DEFL_LNX // Linux
    //#define DEFL_OTR // Other

    #ifdef DEFL_WIN
    @@ -93,18 +93,70 @@

    #ifdef DEFL_LNX
    // Linux internet functions ****************************************************
    +#include <curl/curl.h>
    +static CURL *internet;
    +static char *serv;
    +
    +size_t static dummy(void *ptr, size_t size, size_t nmemb, void *stream){return size*nmemb;}
    +
    int inet_connect(char *server)
    {
    - return INET_INTERNET_FAILED;
    + int result=INET_SUCCESS;
    +
    + if(curl_global_init(CURL_GLOBAL_NOTHING))
    + {
    +  return INET_INTERNET_FAILED;
    + }
    +
    + internet = curl_easy_init();
    + if(internet!=NULL)
    + {
    +  // Attempt to open connection
    +  curl_easy_setopt(internet, CURLOPT_WRITEFUNCTION, &dummy);
    +  curl_easy_setopt(internet, CURLOPT_URL, server);
    +  curl_easy_setopt(internet, CURLOPT_CONNECT_ONLY, 1);
    +  CURLcode connection = curl_easy_perform(internet);
    +  serv = server;
    +  curl_easy_setopt(internet, CURLOPT_CONNECT_ONLY, 0);
    +  if(connection)
    +  {
    +   inet_close();
    +   result = INET_CONNECT_FAILED;
    +  }
    + }
    + else
    + {
    +  inet_close();
    +  result = INET_INTERNET_FAILED;
    + }
    +
    + return result;
    }

    void inet_close(void)
    {
    + if(internet!=NULL) curl_easy_cleanup(internet);
    + curl_global_cleanup();
    }

    int inet_sendscore(char *name, char *scorecode)
    {
    - return INET_INTERNET_FAILED;
    + char url[1000];
    + int result=INET_SUCCESS;
    +
    + // Create request URL
    + sprintf(url,"%s/highscore.php?yourname=%s&code=%s",serv,name,scorecode);
    + curl_easy_setopt(internet, CURLOPT_URL, url);
    +
    + // Send data
    + CURLcode connection = curl_easy_perform(internet);
    + if(connection)
    + {
    +  result = INET_SENDREQUEST_FAILED;
    + }
    +
    + return(result);
    +
    }
    #endif


    Since the code tries to look like the windows version (looking for a future merge) it can be considered a derived work under the same licence that the rest of the game. But if someone is going to release binaries that link statically against libcurl remember that it is MIT lincensed, and so it requires the original license to be distributed with the game.
    Posted 9 years ago #
    Login to Send PM
  7. Anonymous

    Hi there!
    QUOTE(RedDwarf @ Feb 2 2008, 11:40 PM)
    - dlg_inicializar() doesn't specifies a default value for "boton.dialogo".
    Yes it does smile.gif
    Just look at the first for instruction, where it says:
    CODE
    boton[f].estado=boton[f].dialogo=boton[f].numero=-1;

    QUOTE(RedDwarf @ Feb 2 2008, 11:40 PM)
    The problem is
    CODE

    for(f=0;f<NUM_BOTONES;f++)
    {
     tipo_fuente[f].fuente=NULL;
     tipo_fuente[f].dy_fuente=0;
    }

    inside dlg_inicializar().
    It should be:
    CODE

    for(f=0;f<NUM_FUENTES;f++)
    {
     tipo_fuente[f].fuente=NULL;
     tipo_fuente[f].dy_fuente=0;
    }

    NUM_BOTONES must be replaced by NUM_FUENTES.
    Now your'e dead right there! ohmy.gif Of course it should be NUM_FUENTES!
    I've done a few tests to see why it's not causing any apparent problems on the Windows version, and all I've seen is the code generated by my compiler is not overwriting the botones array. The compiler only knows wtf is it overwriting then, but it must not be any important stuff, as it works just fine despite of such an ugly bug unsure.gif
    I could investigate it a bit more, but I'm just too busy right now, so I'll just upload a fixed version when I have the time and forget about it. And of course, you'll be credited for such a bug hunt; you can even hang it's head over the chimney if you want biggrin.gif

    QUOTE(RedDwarf @ Feb 3 2008, 04:27 PM)
    since max_cod is the part that stores the score that is send to the server, the score is never added to the website.

    Is this some kind of proteccion against cheats or the source code available for download is really an old version?
    The code that generates the hiscore code being sent has been deliberately censored to avoid cheating. Otherwise, anyone could compile it to get any fake score uploaded, spoiling all the fun on it dry.gif

    Well, thanks again for spotting that bug!
    Posted 9 years ago #
    Login to Send PM
  8. RedDwarf
    Member

    QUOTE(ignacio @ Feb 4 2008, 09:48 PM)
    Hi there!
    Yes it does smile.gif
    Just look at the first for instruction, where it says:
    CODE
    boton[f].estado=boton[f].dialogo=boton[f].numero=-1;


    Just a line before laugh.gif I saw a '0' in the debugger (probably because the NUM_FUENTES) and so seems I not searched very deeply :-p
    Well, so isn't so unincredible that the compiler generated working code after all.

    QUOTE(ignacio @ Feb 4 2008, 09:48 PM)
    The code that generates the hiscore code being sent has been deliberately censored to avoid cheating. Otherwise, anyone could compile it to get any fake score uploaded, spoiling all the fun on it  dry.gif

    So can you add the Linux/curl code to your (complete) Linux build? So Linux users can also upload their highscores. I verified with Wireshark that it sent the correct URL (but with the missing code). The server doesn't requires any specific User-Agent, HTTP version or so to accept the scores, true? Just any GET petition with the correct URL and code?
    Posted 9 years ago #
    Login to Send PM
  9. Anonymous

    hello,
    whenever we port games it's usually done by people we know, or if the person doing the conversion seems honest enough we give them the code but ask them not to show anyone the highscore code.

    as such, any source code release we do for games we always exclude the hs stuff.

    if you want to do a conversion and will honour this high-score code them I'm sure we can let you have it.
    Posted 9 years ago #
    Login to Send PM
  10. RedDwarf
    Member

    If you need someone to create the static builds that are hosted here sure, give me the code and I will build it. But you have here the patch with the missing code needed for Linux, if you have a Linux box available you can create it yourself without trusting noone else (i.e. me ;-) ).
    When publishing distribution specific packages in the openSUSE Build Service the source code is also published. So these packages can't have upload support anyway.
    Posted 9 years ago #
    Login to Send PM
  11. Keiichi
    Member

    Any sign of the Mac port that RetroSpec says there is?

    Posted 9 years ago #
    Login to Send PM
  12. Ignacio
    Member

    It will be out very soon :)

    Posted 9 years ago #
    Login to Send PM
  13. Ignacio
    Member

    Done!
    You can already get the Mac port from the website :)

    Posted 9 years ago #
    Login to Send PM

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.