if (input.argc == 0)
{
- if (!sim_step(nodes, mosfets))
- return (0);
+ return (!sim_step(nodes, mosfets));
}
else if (input.argc == 1 && input.argv[0].type == num)
{
i = 0;
while (i < input.argv[0].val.num)
{
- if (!sim_step(nodes, mosfets))
+ if (sim_step(nodes, mosfets))
return (0);
++i;
}
return ;
}
+int schema_next(WINDOW *schematics_win, t_vec *nodes, t_vec *mosfets, t_position pos)
+{
+ if (sim_step(nodes, mosfets))
+ return (1);
+ refresh_schema_win(schematics_win, nodes, mosfets);
+ wmove(schematics_win, pos.y, pos.x);
+ return (0);
+}
+
int handle_key_press(int ch, WINDOW *schematics_win, t_vec *nodes, t_vec *mosfets)
{
t_position pos;
schema_user_draw_node(schematics_win, nodes, mosfets, pos);
else if (ch == 's')
schema_switch_mode(schematics_win, nodes, mosfets, pos);
+ else if (ch == 'n')
+ schema_next(schematics_win, nodes, mosfets, pos);
return (0);
}