Strange bgdc crash when trying to compile mapedit

Started by handsource-dyko, January 07, 2011, 12:40:12 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

handsource-dyko

I was adding some code for a new entity in mapedit, and bgdc crashed during the compilation stage.
Is there perhaps some limitation to the size of the program that bdgc can compile?

Here's the error message:

AppName: bgdc.exe AppVer.  1.0.0.1 ModName: msvcrt.dll
ModVer: 7.0.2600.5512 Offset 00032a16

I haven't test on linux yet, However, I must admid, the code is part of a very large process. (I split it up in a lot of Includes).
This worked normally before. I also tried with the latest bennu release, here even the unmodified source causes a crash.

I suspect my program is becoming too large.


Below are the two source files that cause the problem



ed_ins_spikes.prg


      // Insert routine for SPIKES
      IF ((key(_ins) AND key(_v)) OR (mouse.left AND gui_trigger==M_SPIKES) AND inserting==FALSE)
         
// frame 1000, and destroy all menu's, unselect the gui trigger and mark the routine "buisy".
insert_init(1000);
         
         // walk through the struct entries and seek for an empty slot.
         // if an empty slot is found, we can insert an entity there.
         // the entity will be placed at the position of the "hand" cursor.
         FOR (c=0; c<(NUM_SPIKES+1); c+=1)
         
             IF (stage.spikes[c].used==FALSE)                                           
                stage.spikes[c].x=x;
                stage.spikes[c].y=y;
                stage.spikes[c].graph=0;
                stage.spikes[c].flags=0;
                stage.spikes[c].orientation=HORIZONTAL;
                stage.spikes[c].animtype=SUDDEN;
                stage.spikes[c].animspeed=100;                                 
                stage.spikes[c].used=TRUE;
               
                // create the process instance and assign an identifier to it.
                spikes_id[c]=spikes(stage.spikes[c].x,stage.spikes[c].y,stage.spikes[c].graph,stage.spikes[c].flags,stage.spikes[c].orientation,stage.spikes[c].animtype,stage.spikes[c].animspeed,c);
                BREAK;
               
             ELSE // used is true, so the struct must be full.
             
                IF (c==NUM_SPIKES)                                   
                   messagebox3_id=message_text(I_INSERT_STRUCT_FULL,"Sorry, you can't insert any more spikes, the struct is full.",450,100,DISABLE_MENU);   
                   FRAME(2000);
                   signal(messagebox3_id,s_kill);     
                   BREAK;
                END
             END
             
         END
         
         // the routine has completed it's work
         inserting=FALSE;         
      END




ed_mvs_spikes.prg



   
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// **************** SPIKES
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     
     
      // change the position of the selected SPIKES instance,
      // and update the data in the struct.
      IF (id_code=collision(TYPE spikes))   
         // unselect the colorpicker tool
         picker=FALSE;
         
         snap=TRUE;         
         IF (key(_space) AND snap==TRUE)
            x=id_code.x;
            y=id_code.y;
            snap=FALSE;
         END
         
         // The dragmode is activated when the spacebar is pressed.
         // This selects the object, the user can now drag it around whilst
         // the spacebar keeps beeing pressed.
         WHILE (key(_space))   

            // update the data of th selected object
            drag_entity(DE_SPIKES,id_code,selectedgraph);
           
            // check if the cursor is going out of screen
            cursor_check();
            FRAME;
         END
         
         // check if the delete key is pressed, to remove the selected
         // entity (this kills the process instance and it's child
         // processes, also it updates the "used" flag in the stage struct.
         IF (key(_del) OR gui_trigger==M_DELETE)
         
            // redraw menu's, unselect the mouse cursor, invoke action_delete
    delete_init();

            REPEAT               
               FRAME;
            UNTIL (ok_delete==TRUE OR ok_delete==FALSE)
           
            IF (ok_delete==TRUE)
               stage.spikes[id_code.count].used=FALSE;
               signal(id_code,s_kill_tree);
            END   
         END
         
         // show the properties manupilation window
         IF (key(_p) OR gui_trigger==M_OBJECTPROPS)
            FRAME(100);           
            property_window(DE_SPIKES,id_code,300,140);
         END
                         
         graph=movementgraph; 

  ELSE
         // reset the id-code when the cursor no longer collides with the entity.
         id_code=0;
      END
     
     
     




Both sources are included in this file

editor-cursorroutines.prg




/* "CASTLE OF DR MALVADO, orginal game by DANIEL NAVARRO."
*
* BennuGD updated version, with DYKO routines.
*
* Copyright (C) 1997 DANIEL NAVARRO.
* Copyright (C) 2010 Pieter kuperus/DYKO.
*
* This PROGRAM is free software; you can redistribute it AND/OR modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, OR
* (at your option) any later version.
*
* This PROGRAM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License FOR more details.
*
* You should have received a copy of the GNU General Public License
* along with this PROGRAM; IF NOT, write TO the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
*/



/* Source file: EDITOR-CURSOR ROUTINES
*
*/


// included shared functions for INSERT, DELETE, MOVE routines
INCLUDE "ed_cursorroutines_shared.prg";



//-----------------------------------------------------------------------------
// Process used for the placement cursor in the levelmap
// Entries: 'x' and 'y'
//         
//-----------------------------------------------------------------------------
PROCESS cursor(x,y);


PRIVATE


byte picker=FALSE;

int movementgraph=14;
int selectedgraph=16;
int colorpickergraph=22;

int messagebox_id; messagebox2_id; messagebox3_id; messagebox4_id;

int id_code; // hold the identfication code of the process instance that the
             // cursor is currently colliding with. with this code, we can
             // access the data fields of that particulair instance.


// information for storing the controlpoints
int c_point; cpx; cpy;         


byte snap;
   
int tempcount=0;
         
BEGIN

   ctype=c_scroll;   // puts it in the scroll
         
   file=editor_cursorfile;

   graph=movementgraph;
   
   z=-30;
   
   // check if the cursor is going out of screen
   cursor_check();
   
   
 
   LOOP
     
 
     
      SWITCH (scroll_lock_status)
         CASE TRUE:
            scroll.camera=0;
         END
         CASE FALSE:
            scroll.camera=id; // assign the cursor process to the scroll movement
         END
      END
   

      IF ((key(_c) AND key(_control)) OR ((mouse.left) AND gui_trigger==M_PIXELCURSOR))
         FRAME(500);
         IF (picker==FALSE)
   
            // unselect the mouse cursor
            gui_trigger=0; 
             
            picker=TRUE;
            graph=colorpickergraph;
            delete_text(all_text);
            write(0,400,15,3,"x= ");
            write_int(0,450,15,3,&x);
            write(0,500,15,3,"y= ");
            write_int(0,550,15,3,&y);
         END
      END
     
      IF ((key(_c) AND key(_control)) OR ((mouse.left) AND gui_trigger==M_PIXELCURSOR))
         IF (picker==TRUE)
            FRAME(500);
   
            // unselect the mouse cursor
            gui_trigger=0; 
             
            picker=FALSE;
            graph=movementgraph;
         END   
      END

     
     
//-----------------------------------------------------------------------------
// INSERT routines
//-----------------------------------------------------------------------------   
     
     
        INCLUDE "ed_ins_object.prg";     
                   
        INCLUDE "ed_ins_bear.prg";       
             
        INCLUDE "ed_ins_flying.prg";
       
        INCLUDE "ed_ins_first_plane.prg";

        INCLUDE "ed_ins_spider.prg";         

        INCLUDE "ed_ins_fire.prg";         
             
        INCLUDE "ed_ins_p_bonus.prg";
       
        INCLUDE "ed_ins_p_extralife.prg";

        INCLUDE "ed_ins_metal_platform.prg";
       
        INCLUDE "ed_ins_floating_platform.prg";
             
        INCLUDE "ed_ins_spikes_ball.prg";     

        INCLUDE "ed_ins_chain.prg";       
             
        INCLUDE "ed_ins_pumpkin.prg"; 
             
        INCLUDE "ed_ins_head.prg";       

        INCLUDE "ed_ins_savepoint.prg"; 
             
        INCLUDE "ed_ins_deathline.prg";     

        INCLUDE "ed_ins_fish.prg";     
       
        INCLUDE "ed_ins_bubble.prg";   

        INCLUDE "ed_ins_falling_block.prg";           

        INCLUDE "ed_ins_spikes.prg";       
       
   
//-----------------------------------------------------------------------------
// Move, Select and Delete routines
//----------------------------------------------------------------------------- 

        INCLUDE "ed_mvs_jack.prg";     

        INCLUDE "ed_mvs_goal.prg";     
             
        INCLUDE "ed_mvs_malvado_son.prg";         

        INCLUDE "ed_mvs_malvado.prg";       

        INCLUDE "ed_mvs_object.prg";       

        INCLUDE "ed_mvs_bear.prg";       
             
        INCLUDE "ed_mvs_flying.prg";   
       
        INCLUDE "ed_mvs_first_plane.prg";   
             
        INCLUDE "ed_mvs_spider.prg";         

        INCLUDE "ed_mvs_fire.prg";     
           
        INCLUDE "ed_mvs_p_bonus.prg";   

        INCLUDE "ed_mvs_p_extralife.prg";           
             
        INCLUDE "ed_mvs_metal_platform.prg";
       
        INCLUDE "ed_mvs_floating_platform.prg";
             
        INCLUDE "ed_mvs_spikes_ball.prg";
             
        INCLUDE "ed_mvs_chain.prg";

        INCLUDE "ed_mvs_pumpkin.prg";
             
        INCLUDE "ed_mvs_head.prg";     
             
        INCLUDE "ed_mvs_savepoint.prg";       
           
        INCLUDE "ed_mvs_savepoint_markers.prg";       
           
        INCLUDE "ed_mvs_default_savepoint.prg";       
             
        INCLUDE "ed_mvs_deathline.prg";

        INCLUDE "ed_mvs_fish.prg";
       
        INCLUDE "ed_mvs_bubble.prg";   

        INCLUDE "ed_mvs_falling_block.prg";           

        INCLUDE "ed_mvs_spikes.prg";       
   
      FRAME;
   END // end of loop
   
   
END // end of cursor process




//-----------------------------------------------------------------------------
// Process used for checking if the cursor goes out of screen
// Entries: -
//         
//-----------------------------------------------------------------------------

INCLUDE "cursor_check.prg";

//-----------------------------------------------------------------------------
// Process used for displaying information about the selected instance
// This routine is called by the process instance itself.
//
// Entries: 'enetity'
//         
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Process used for displaying information about the selected instance
// This routine is called by the process instance itself.
//
// Note: slightly altered version for processes JACK, METAL_PLATFORM, SPIKESBALL
//
// Entries: 'enetity'
//         
//-----------------------------------------------------------------------------

INCLUDE "cursor_tag.prg";

//-----------------------------------------------------------------------------
// Process used for the mousecursor
// Entries: -
//         
//-----------------------------------------------------------------------------

INCLUDE  "mousecursor.prg";




So you see, a very very large process, it's the heart of mapedit.

SplinterGU

Download Lastest BennuGD Release: http://www.bennugd.org/node/2

handsource-dyko

I just tested in on Linux. Guess what? It compiles! This maybe a windows specific issue.
The linux version of bennu on my system may even be a bit older though.

I have uploaded a snapshot of the current 1.6 version, (not on google code yet)

The 7zip file contains the whole lot, binairies and sources. The mapedit code is slighlty spagettios.

here's the url: http://www.mediafire.com/file/9sgn337vba2ozmm/malvado2011-dev-test.7z

To compile and run mapedit, type me.bat
to generate exe file afterwards, type me-exe.bat

on linux ./me.sh

Anyway, Just try compiling with the bennu version included, specificly on windows.


SplinterGU

Download Lastest BennuGD Release: http://www.bennugd.org/node/2

handsource-dyko

#4
I tried the latest version yesterday, but it also crashed, even without the two extra bits of code. I just updated the linux
version of bennu on my computer, it compiles, but now mapedit crashes on startup. This also happened yesterday on windows
when I tried the latest version. Then I revrted back to the previous version of bennu.

SplinterGU

Download Lastest BennuGD Release: http://www.bennugd.org/node/2

handsource-dyko

I compile it with debug mode activated.

the me.bat script does this:


%9

bgdc -d -g src\mapedit.prg

rem bgdc -d -g src\mapedit.prg > compilelog_mapedit.txt

rem notepad compilelog_mapedit.txt

echo
echo
echo
echo moving exucatable file


move src\mapedit.dcb %9


bgdi mapedit.dcb %1


SplinterGU

Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

Download Lastest BennuGD Release: http://www.bennugd.org/node/2

handsource-dyko

#9
oops. I made the archive too quickly. I will replace it.

here's a link to the new archive (I checked for sources)

http://www.mediafire.com/file/ecann3ggpvs0rnw/malvado2011.rar

maybe 7z does not interpret my distribution script  correctly.

handsource-dyko

I have tried the new bennu version on windows again. When compiling the game or some of the other programs, It complains
about a data type not accepted here, in menu-misc.prg at line 56. When I remove that line, it compiles fine. Stangly, the older versions
didn't seem to mind. Mapedit compiles, but does not run with the new version, while all the other programs that come with malvado seem
to work fine at first glance.

Does it have something to do with the internal changes? My program did not change. Did file loading change? The lev files are structs with
strings in 'em. (you can find extracts of the lev files, or create them with datextract).

SplinterGU

I need full sources.

I can't test your problem without sources.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2

handsource-dyko

The package contains all the sources, you need to download the rar file
http://www.mediafire.com/file/ecann3ggpvs0rnw/malvado2011.rar

I just downloaded it on my mom's computer to verify if the package is complete
an did a few test compiles, and it works as on my computer.



SplinterGU

compile with your (old) bgdc version (included in the rar):



Z:\tmp\bug\editor>bgdc src/mapedit.prg
BGDC 1.0.0 (Nov 29 2010 01:30:51)
Copyright ® 2006-2010 SplinterGU (Fenix/BennuGD)
Copyright ® 2002-2006 Fenix Team (Fenix)
Copyright ® 1999-2002 JosÚ Luis Cebrißn Pag³e (Fenix)
Bennu Game Development comes with ABSOLUTELY NO WARRANTY;
see COPYING for details

src/librender:0: warning: Variable redeclared ("ALPHA_STEPS")
src/libscroll:0: warning: Variable redeclared ("CTYPE")
src/libscroll:0: warning: Variable redeclared ("CNUMBER")

File src/mapedit.dcb compiled (569870 bytes):

  Processes                   134
  Global data               86884 bytes
  Local data                  384 bytes
  Private data               2660 bytes
  Public data                   0 bytes
  Code                     223540 bytes
  System processes            342
  Globals vars                259
  Locals vars                  69
  Private vars                566
  Publics vars                  0
  Identifiers                2058
  Structs                      83
  Strings                     806 (16743 bytes)


Z:\tmp\bug\editor>


my new version in linux


splinter@debian:~/tmp/bug/editor$ bgdc src/mapedit.prg
BGDC 1.0.0 (Jan  4 2011 04:19:10)
Copyright � 2006-2010 SplinterGU (Fenix/BennuGD)
Copyright � 2002-2006 Fenix Team (Fenix)
Copyright � 1999-2002 Jos� Luis Cebri�n Pag�e (Fenix)
Bennu Game Development comes with ABSOLUTELY NO WARRANTY;
see COPYING for details


File src/mapedit.dcb compiled (564640 bytes):

  Processes                   134
  Global data               86884 bytes
  Local data                  384 bytes
  Private data               2660 bytes
  Public data                   0 bytes
  Code                     223540 bytes
  System processes            347
  Globals vars                259
  Locals vars                  69
  Private vars                566
  Publics vars                  0
  Identifiers                2063
  Structs                      83
  Strings                     535 (12174 bytes)

splinter@debian:~/tmp/bug/editor$


my new windows version


Z:\tmp\bug\editor>bgdc src/mapedit.prg
BGDC 1.0.0 (Jan  5 2011 11:01:01)
Copyright ® 2006-2010 SplinterGU (Fenix/BennuGD)
Copyright ® 2002-2006 Fenix Team (Fenix)
Copyright ® 1999-2002 JosÚ Luis Cebrißn Pag³e (Fenix)
Bennu Game Development comes with ABSOLUTELY NO WARRANTY;
see COPYING for details


File src/mapedit.dcb compiled (564640 bytes):

  Processes                   134
  Global data               86884 bytes
  Local data                  384 bytes
  Private data               2660 bytes
  Public data                   0 bytes
  Code                     223540 bytes
  System processes            347
  Globals vars                259
  Locals vars                  69
  Private vars                566
  Publics vars                  0
  Identifiers                2063
  Structs                      83
  Strings                     535 (12174 bytes)


Z:\tmp\bug\editor>


with debug info (linux):


splinter@debian:~/tmp/bug/editor$ bgdc -g src/mapedit.prg
BGDC 1.0.0 (Jan  4 2011 04:19:10)
Copyright � 2006-2010 SplinterGU (Fenix/BennuGD)
Copyright � 2002-2006 Fenix Team (Fenix)
Copyright � 1999-2002 Jos� Luis Cebri�n Pag�e (Fenix)
Bennu Game Development comes with ABSOLUTELY NO WARRANTY;
see COPYING for details


File src/mapedit.dcb compiled (620447 bytes):

  Processes                   134
  Global data               86884 bytes
  Local data                  384 bytes
  Private data               2660 bytes
  Public data                   0 bytes
  Code                     276196 bytes
  System processes            347
  Globals vars                259
  Locals vars                  69
  Private vars                566
  Publics vars                  0
  Identifiers                2063
  Structs                      83
  Strings                     535 (12174 bytes)



windows:


Z:\tmp\bug\editor>bgdc -g src/mapedit.prg
BGDC 1.0.0 (Jan  5 2011 11:01:01)
Copyright ® 2006-2010 SplinterGU (Fenix/BennuGD)
Copyright ® 2002-2006 Fenix Team (Fenix)
Copyright ® 1999-2002 JosÚ Luis Cebrißn Pag³e (Fenix)
Bennu Game Development comes with ABSOLUTELY NO WARRANTY;
see COPYING for details


File src/mapedit.dcb compiled (620447 bytes):

  Processes                   134
  Global data               86884 bytes
  Local data                  384 bytes
  Private data               2660 bytes
  Public data                   0 bytes
  Code                     276196 bytes
  System processes            347
  Globals vars                259
  Locals vars                  69
  Private vars                566
  Publics vars                  0
  Identifiers                2063
  Structs                      83
  Strings                     535 (12174 bytes)


Z:\tmp\bug\editor>

Download Lastest BennuGD Release: http://www.bennugd.org/node/2

SplinterGU

this works... please, update your bennugd instalation... I suggest you that remove all dll and exe from your project folder and use the bennugd installer.
Download Lastest BennuGD Release: http://www.bennugd.org/node/2