here is the variables section unaltered:
////////////////////////////////
//game play variables
////////////////////////////////
U8 sgSpeed;
U8 sgCounter;
__local__ U8 sgLevel; //local means to store data per player
__boolean game_not_over;
score_t sgScore;
U8 numTOadvance;
U8 sound_timer;
__boolean sound_toggle;
////////////////////////////////
//gun and bullet variables
////////////////////////////////
U8 gun_xpos;
U8 numBulletsLeft;
U8 numBullets;
U8 Bullet_Index; //pointer to next bullet in chamber
__boolean isRshot; //a bullet was fired this frame
__boolean isLshot;
U8 bullet_xpos[20];
U8 bullet_ypos[20];
U8 bullet_state[20];
////////////////////////////////
//target variables
////////////////////////////////
U8 totalNumTargets;
U8 targetIndex; //pointer to next target in chute
U8 target_shot_frame_counter;
U8 next_target_delay; //delay time to wait before sending out next target
U8 num_targets_out_of_play; //out of play = shot plus fell off screen
U8 num_targets_shot;
struct target_struct{
U8 xpos;
U8 ypos;
U8 level;
U8 width;
__boolean swap;
U8 swap_counter;
U8 swap_speed;
U8 target_state;
U8 target_type;
} target[35];
This is 355 U8's. If I decrease amount of targets then crash goes away. I haven't narrowed down to the exact # limit but 355 is too many. I don't understand how this could be the problem either. Vars are init'ed in a later function but the crash happens before that function is called. Crash occurs at call of below function start_shooting_gallery - First line of this function is never executed on crash.
void start_shooting_gallery (void) { //this is the first function called
ball_search_monitor_stop ();
flag_off(FLAG_VIDEO_MODE_ENABLED);
flag_on(FLAG_VIDEO_MODE_RUNNING);
flipper_disable ();
leff_start(LEFF_TURN_OFF_GI);
shooting_gallery_init(); //all variables are init'ed here
deff_start_sync (DEFF_SG_INTRO);
shooting_gallery_engine();
deff_start_sync (DEFF_SG_END);
leff_start(LEFF_FLASH_GI);
leff_start(LEFF_TURN_ON_GI);
flipper_enable ();
flag_off(FLAG_VIDEO_MODE_RUNNING);
flag_off(FLAG_VIDEO_MODE_ENABLED);
} //end of function