-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
# By: rnugroho <[email protected]> +#+ +:+ +#+ # | ||
# +#+#+#+#+#+ +#+ # | ||
# Created: 2016/11/01 20:07:00 by rnugroho #+# #+# # | ||
# Updated: 2018/05/02 02:16:31 by rnugroho ### ########.fr # | ||
# Updated: 2018/05/02 15:26:33 by fpetras ### ########.fr # | ||
# # | ||
# **************************************************************************** # | ||
|
||
|
@@ -322,4 +322,4 @@ tests_vm_op_overflow: corewar | |
|
||
tests: tests_asm tests_vm | ||
|
||
.PHONY: all clean fclean re debug norm norm2 tests tests_asm test_asm_leak tests_asm_leak tests_asm_valid tests_asm_error tests_asm_v libft | ||
.PHONY: all clean fclean re debug norm norm2 tests tests_asm test_asm_leak tests_asm_leak tests_asm_valid tests_asm_error tests_asm_v libft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,13 +6,28 @@ | |
/* By: rnugroho <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2018/04/19 21:38:33 by rnugroho #+# #+# */ | ||
/* Updated: 2018/05/02 14:35:30 by rnugroho ### ########.fr */ | ||
/* Updated: 2018/05/02 15:51:07 by fpetras ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "ft_vm.h" | ||
#include "ft_vm_draw.h" | ||
|
||
void | ||
vm_free(t_vm *vm) | ||
{ | ||
int i; | ||
|
||
i = 0; | ||
while (i < vm->champ_size) | ||
{ | ||
free(vm->champ[i].op); | ||
fta_clear(vm->champ[i].processes); | ||
free(vm->champ[i].processes); | ||
i++; | ||
} | ||
} | ||
|
||
void | ||
vm_load_champs(t_vm *vm, unsigned char memory[MEM_SIZE]) | ||
{ | ||
|
@@ -111,5 +126,6 @@ int | |
ft_printfln("Contestant %d, \"%s\", has won !", | ||
vm.winner + 1, vm.champ[vm.winner].header.prog_name) : 0; | ||
(vm.v_lvl[V_LVL_1]) ? draw_end(&g_draw_win) : 0; | ||
vm_free(&vm); | ||
return (0); | ||
} |