Release Netwalk

Discussion in 'Software Releases' started by sm0kew0n, Jun 10, 2018.

  1. sm0kew0n

    sm0kew0n Very Active Member

    Joined:
    Apr 13, 2016
    Messages:
    329
    Location:
    Earth
    This is Netwalk, a clone of those 'connect the terminals to the server' type games. Built from this source, I only changed the game colours to pop a bit more on the pandy screen and the size of the game grids to fit nicely on 800x480.

    Repo link - http://repo.openpandora.org/?page=detail&app=sm0kew0n005

    Clicking on the 'About' menu crashes it for some reason....?

    Cheers.
     
    Tags:
    klapse likes this.
  2. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,206
    Location:
    Innsmouth, MA
    Hi @sm0kew0n !

    Thanks for creating this thread ;)

    Could you please recompile the game with the "-g" flag ? This way we could try to understand why the game segfaults when clicking on "help":
    Cheers, Magic Sam
     
  3. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,206
    Location:
    Innsmouth, MA
  4. sm0kew0n

    sm0kew0n Very Active Member

    Joined:
    Apr 13, 2016
    Messages:
    329
    Location:
    Earth
    I was going to upload the -g flag build today, are sure about the cursor? I was playing it with mouse controls, are using wasd?
     
  5. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,206
    Location:
    Innsmouth, MA
    @sm0kew0n : I'm playing with both nubs and stylus. If you believe the mouse cursor is useful, then please disregard my request :)

    Cheers, Magic Sam
     
  6. sm0kew0n

    sm0kew0n Very Active Member

    Joined:
    Apr 13, 2016
    Messages:
    329
    Location:
    Earth
    @Magic Sam Yup, I see what you're driving at now re: cursor. Updated it with the -g flag and minus cursor.
     
  7. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,206
    Location:
    Innsmouth, MA
    @sm0kew0n : thanks for the updated build ! I'll give it a try with gdb ASAP :)

    Cheers, Magic Sam
     
  8. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,206
    Location:
    Innsmouth, MA
    @sm0kew0n : here you go :)
    EDIT: the issue should be around these parts:
    Code:
    void open_submenu(widget_ptr p, void *data)
    {
    int i;
    int w = 0;
    menuitem_ptr it;
    
    openedmenu = (menuitem_ptr) p;
    menu_ptr m = openedmenu->submenu;
    
    for (i=0; i<m->item_count; i++) {
    it = m->item_list[i];
    if (w < it->img->w) w = it->img->w;
    }
    w += 12;
    
    m->widget.x = m->widget.parent->x;
    m->widget.y = m->widget.parent->y + vsize;
    
    m->widget.w = w;
    m->widget.h = vsize * m->item_count + 1;
    
    for (i=0; i<m->item_count; i++) {
    it = m->item_list[i];
    it->widget.x = 0 + m->widget.x;
    it->widget.y = vsize * i + 4 + m->widget.y;
    it->widget.w = w;
    it->widget.h = vsize;
    }
    }
    
    Hope that helps.

    Cheers, Magic Sam
     
    Last edited: Jun 24, 2018
  9. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    11,000
    Location:
    Somewhere off the coast of the EU
    Awesome! Which line is line 291 in that function by the way?
     
  10. sm0kew0n

    sm0kew0n Very Active Member

    Joined:
    Apr 13, 2016
    Messages:
    329
    Location:
    Earth
    Thanks @Magic Sam , I will, er, do my best to make something of that...

    Line 291 is openedmenu = (menuitem_ptr) p;
     
  11. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,206
    Location:
    Innsmouth, MA
    @sm0kew0n : I'm not a developer so I can't help you much ;)

    In your first post you mentioned changing the screen size to fit the 800x480 resolution, and it looks like this function deals with size. Could it be that the help menu doesn't fit in a 800x480 screen ?

    What puzzles me is that main.c is not 1745 lines long (only 1703):

    https://github.com/blynn/netwalk/blob/master/main.c

    That "no such file or directory" error is also weird IMHO.

    Cheers, Magic Sam
     
    Last edited: Jun 24, 2018
  12. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    11,000
    Location:
    Somewhere off the coast of the EU
    Most c source files go through the cpp preprocessor before they're compiled. If that's extending the file somehow (it usually shrinks the file by eliminating #IFDEFN conditional code I assume), that could explain that error line number.

    If it is that listed line that assigns openedmenu for the first time then I think that's an explicit cast, and at that point I reach the limit of my knowledge.
     
  13. sm0kew0n

    sm0kew0n Very Active Member

    Joined:
    Apr 13, 2016
    Messages:
    329
    Location:
    Earth
    That's line 291 from main.c in the release tar, not the master on github, the file I have is 1760 lines and line 1745 is;

    Selection_001.png
     
  14. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    11,000
    Location:
    Somewhere off the coast of the EU
    So, what's line 291 in the source that was actually built then? If the master in github is 1760 lines long it's not that either unless the ifdefn blocks removed happen to match it up to the right length (I think). Normally in development you leave symbols embedded so it tells you the contents of the line where it crashed, but without them you're sometimes left in this mess of trying to guess which source actually corresponded.
     
  15. sm0kew0n

    sm0kew0n Very Active Member

    Joined:
    Apr 13, 2016
    Messages:
    329
    Location:
    Earth
    To clarify, I built source from release tarball.
     
  16. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,206
    Location:
    Innsmouth, MA
    Hi all :)

    @levi : here is line 291 from the release tarball (looks identical to me):
    Code:
    void open_submenu(widget_ptr p,   void *data)
    {
        int i;
        int w = 0;
        menuitem_ptr it;
    
        openedmenu = (menuitem_ptr) p; // <-- LINE 291 /!\
        menu_ptr m = openedmenu->submenu;
    
        for (i=0; i<m->item_count; i++) {
       it = m->item_list[i];
       if (w < it->img->w) w = it->img->w;
        }
        w += 12;
    
        m->widget.x = m->widget.parent->x;
        m->widget.y = m->widget.parent->y + vsize;
    
        m->widget.w = w;
        m->widget.h = vsize * m->item_count + 1;
    
        for (i=0; i<m->item_count; i++) {
       it = m->item_list[i];
       it->widget.x = 0 + m->widget.x;
       it->widget.y = vsize * i + 4 + m->widget.y;
       it->widget.w = w;
       it->widget.h = vsize;
        }
    }
    
    @sm0kew0n : I think this part (main.c) of the code has been updated since that release in 2014:

    https://github.com/blynn/netwalk/commit/5b52c2c2af0929d4d792afa2be75d0ddd780fabc

    Could you please give that latest commit a try, see if it solves the issue ?

    Cheers, Magic Sam
     
    Last edited: Jun 25, 2018
  17. sm0kew0n

    sm0kew0n Very Active Member

    Joined:
    Apr 13, 2016
    Messages:
    329
    Location:
    Earth
    Updated.

    Issue solved @Magic Sam thanks for your help.
     

Share This Page

Loading...