removed unneeded precautions for reentrance related problems (longjmp() destroyes the current stack anyway)
This commit is contained in:
parent
108cf1321d
commit
ad44254968
|
@ -39,27 +39,11 @@ void borg_breakout_game()
|
||||||
|
|
||||||
void borg_breakout(uint8_t demomode)
|
void borg_breakout(uint8_t demomode)
|
||||||
{
|
{
|
||||||
// save pointer address just in case that the breakout demo was previously
|
|
||||||
// running so it can reentered
|
|
||||||
char (*old_playfield)[NUM_COLS][NUM_ROWS] = playfield;
|
|
||||||
// new playing field
|
|
||||||
char my_playfield[NUM_COLS][NUM_ROWS];
|
char my_playfield[NUM_COLS][NUM_ROWS];
|
||||||
playfield = &my_playfield;
|
playfield = &my_playfield;
|
||||||
|
|
||||||
uint8_t ignorescore_buffer = ignorescore;
|
|
||||||
uint16_t cycles = DEMO_CYCLES;
|
uint16_t cycles = DEMO_CYCLES;
|
||||||
uint8_t level;
|
uint8_t level = demomode ? random8() % 5 : 0;
|
||||||
if (demomode)
|
|
||||||
{
|
|
||||||
level = random8() % 5;
|
|
||||||
ignorescore = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
level = 0;
|
|
||||||
ignorescore = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ball_t balls[1];
|
ball_t balls[1];
|
||||||
|
|
||||||
/* spawn a ball in the middle bottom of the field, let it move upwards with random speed & direction */
|
/* spawn a ball in the middle bottom of the field, let it move upwards with random speed & direction */
|
||||||
|
@ -104,8 +88,4 @@ void borg_breakout(uint8_t demomode)
|
||||||
// alternate the value of the tick divider
|
// alternate the value of the tick divider
|
||||||
tick_divider = tick_divider ? 0 : 1;
|
tick_divider = tick_divider ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ignorescore = ignorescore_buffer;
|
|
||||||
// restore saved pointer
|
|
||||||
playfield = old_playfield;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,8 +20,7 @@ static uint16_t score = 0;
|
||||||
|
|
||||||
void score_add (uint8_t in_score)
|
void score_add (uint8_t in_score)
|
||||||
{
|
{
|
||||||
if (!ignorescore)
|
score += in_score;
|
||||||
score += in_score;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t score_get()
|
uint16_t score_get()
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
#ifndef SCORE_H
|
#ifndef SCORE_H
|
||||||
#define SCORE_H
|
#define SCORE_H
|
||||||
|
|
||||||
uint8_t ignorescore;
|
|
||||||
|
|
||||||
void score_add(uint8_t);
|
void score_add(uint8_t);
|
||||||
uint16_t score_get();
|
uint16_t score_get();
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue