I am really screewed to this foolish segmentation. Finally I found that
some of lines (PART X) causes this error;

"Signed .word overflow; switch may be too large; 33596 at 0x13ce
make: *** [soccer.o] Error 1"

If I disable these lines (which includes if(), WinCopyRectangle(), WinDrawBitMap()) no error occurs and app works. There are no special functions. Shouldnt I write more code lines here? Is it the end of road ? Is it a problem about capacity of switch() function ?
What a foolish thing ? Would you please help me ?


I'll be very happy if someone explains me what should I have to do ?
Really I dont understood what my mistake is !
Thanx

Yilmaz Yoru


Here is a full brief of my codes and also segmentation info;



//-------------------------------------------------------
void gamestate_preparedraw(void) SECT3;
static void intro_loop(void) SECT3;
static void teams_loop(void) SECT3;
static void options_loop(void) SECT3;
static void help_loop(void) SECT3;
static void game_loop(void);

//-------------------------------------------------------
static void gamestate_preparedraw(void)
{
   ...

   /*
     //--------- PART X -----------
     if(..) WinCopyRectangle(..);
     WinDrawBitmap(...);

     if(..) WinCopyRectangle(..);
     WinDrawBitmap(...);

     if(..) WinCopyRectangle(..);
     WinDrawBitmap(...);
   */

   ...
}
//-------------------------------------------------------
static void game_loop(void)
{
  ...
  gamestate_preparedraw();
  ...
}
//-------------------------------------------------------

UInt32 PilotMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
{
        Err err = 0;
        
        if (cmd == sysAppLaunchCmdNormalLaunch)
        {
                init_system();
                do
                {
                   switch(game.status)
                   {
                      case GAME_PLAY:
                         game_loop();
                         break;

                      case GAME_TEAMS:
                         teams_loop();
                         break;

                      case GAME_HELP:
                         help_loop();
                         break;

                      case GAME_OPTIONS:
                         options_loop();
                         break;
                
                      case GAME_INTRO:
                         intro_loop();
                         break;
                   }
                }while(game.status!=GAME_EXIT);
                
                if(!stopped) stop_app();
        }
        return err;
}


//-------------------------------------------------------

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 SEG2          00004744  00000000  00000000  00000120  2**2
                  CONTENTS, ALLOC, LOAD, CODE
  1 .text         000035d4  00000000  00000000  00004864  2**2
                  CONTENTS, ALLOC, LOAD, CODE
  2 .data         0000015c  00000000  00000000  00007e38  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  3 .bss          00001c2c  0000015c  0000015c  00000000  2**2
                  ALLOC
  4 SEG3          0000578c  00000000  00000000  00007f94  2**2
                  CONTENTS, ALLOC, LOAD, CODE
  5 .reloc        000002d0  00000000  00000000  0000d720  2**2
                  CONTENTS, ALLOC, LOAD

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to