static void readjoy(byte action, struct PLAYER *ply)
{
- int north = 0, east = 0, south = 0, west = 0;
- int snap = 0, drop = 0;
+ boolean north = FALSE;
+ boolean east = FALSE;
+ boolean south = FALSE;
+ boolean west = FALSE;
+ boolean snap = FALSE;
+ boolean drop = FALSE;
if (game_em.use_single_button && action & (JOY_BUTTON_1 | JOY_BUTTON_2))
action |= JOY_BUTTON_1 | JOY_BUTTON_2;
if (action & JOY_LEFT)
- west = 1;
+ west = TRUE;
if (action & JOY_RIGHT)
- east = 1;
+ east = TRUE;
if (action & JOY_UP)
- north = 1;
+ north = TRUE;
if (action & JOY_DOWN)
- south = 1;
+ south = TRUE;
if (action & JOY_BUTTON_1)
- snap = 1;
+ snap = TRUE;
if (action & JOY_BUTTON_2)
- drop = 1;
+ drop = TRUE;
/* always update drop action */
ply->joy_drop = drop;
{
prepare_em_level();
+ logic_init();
+
game_initscreen();
RedrawPlayfield_EM(FALSE);
game_em.random = game_em.random * 129 + 1;
- frame = (frame - 1) & 7;
+ frame = (frame + 1) % 8;
for (i = 0; i < MAX_PLAYERS; i++)
readjoy(action[i], &ply[i]);
- UpdateEngineValues(screen_x / TILEX, screen_y / TILEY, ply[0].x, ply[0].y);
+ UpdateEngineValues(CAVE_POS_X(screen_x / TILEX),
+ CAVE_POS_Y(screen_y / TILEY),
+ CAVE_POS_X(ply[0].x),
+ CAVE_POS_Y(ply[0].y));
logic();
ply[i].dynamite_cnt < 5)
any_player_dropping = TRUE;
- CheckSingleStepMode_EM(action, frame, game_em.any_player_moving,
- game_em.any_player_snapping, any_player_dropping);
+ boolean single_step_mode_paused =
+ CheckSingleStepMode_EM(action, frame, game_em.any_player_moving,
+ game_em.any_player_snapping, any_player_dropping);
+
+ // draw wrapping around before going to single step pause mode
+ if (single_step_mode_paused && logic_check_wrap())
+ logic_move();
RedrawPlayfield_EM(FALSE);
}