james cardona
unread,Feb 14, 2013, 11:15:13 AM2/14/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fre...@googlegroups.com
So I have been banging my head on the wall trying to figure out this mystery bug for several weeks now. Here is what happens:
If a function in one page starts a timed mode or another function in another page sometimes I get a crash. The crash can happen on the start of the call or on the return from the call. All the files, functions, deffs etc are all properly decorated/declared with their appropriate page info. Here is an example:
in the center of my eyeball_hit code there is some code to start the explode mode as follows:
CALLSET_ENTRY (eyeball, sw_eyeball_standup) {
if (in_game) {
if (++eyeball_switch_debounce == 1) {
ballsave_add_time (1);
++eyeball_shots_made;
sound_start (ST_SAMPLE, EXPLOSION1_MED, SL_2S, PRI_GAME_QUICK1);
leff_start(LEFF_EYEBALL);
if ( !flag_test(FLAG_IS_EYEBALL_EB_MADE)
&& (eyeball_shots_made >= eyeball_eb_goal) ) eyeball_eb_award();//award extraball
else if (!flag_test(FLAG_BACK_IN_THE_FRIDGE_RUNNING)
&& eyeball_shots_made >= eyeball_goal) eyeball_goal_award();//start explode
else {
deff_start (DEFF_EYEBALL_EFFECT);
if (eyeball_goal - eyeball_shots_made <= 1) flag_on(FLAG_IS_EXPLODE_MODE_ENABLED);//set flag if one shot away
The start explode code starts the timed mode which calls the init code and starting deff and all that works fine. What happens is when the code pointer falls out of the explode init code and returns to its place in eyeball, I get a crash. I have had these type problems before also and the solution has always been to place them in the same page --even though they are properly decorated!
Another mystery bug happens when I call deff_start_sync - but again, this only happens sometimes. I have used this call all over the place, but in some modes it causes a crash, others don't. No idea why that call would cause a page fault when the deff that I am calling is in the same page! I change the call to deff_start and slap a timer behind it and the crash goes away - weird right?
Anyway, if anyone has an idea of something I can try I am all ears.
score (EYEBALL_SCORE);
}//end of if DEBOUNCER
task_create_gid1 (GID_EYEBALL_DEBOUNCE, eyeball_switch_debounce_task);
}
}//end of function